Jump to content
  • 0

pomoc Příkaz může použít jenom admin.


FrOsTy14

Dotaz

Zdravím, prosím jestli by někdo přehodil tento kod na to že půjde jedině když bude admin lvl 3,4,5:

{
if(strcmp("/azbranao", cmdtext, true, 10) == 0)
{
MoveObject(brana, -1665.7998000,1420.9004000,138.1000100, 1);
    SendClientMessage(playerid, 0xFF000000,"Brána je otevřena!");
}
}
děkuji
Link to comment
Share on other sites

18 odpovědí na tuto otázku

Recommended Posts

  • 0
static JeHracAdmin[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/prikaz", true))
    {
        if(JeHracAdmin[playerid] > 2) // pokiaľ je jeho admin level vyšší ako 2 ..
        {
            // .. tak sa vykoná nejaká akcia.
        }
        return 1;
    }
    return 0;
}

Nezabudni niekde nastaviť hráčovi admin level.

Link to comment
Share on other sites

  • 0
static JeHracAdmin[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/prikaz", true))
    {
        if(JeHracAdmin[playerid] > 2) // pokiaľ je jeho admin level vyšší ako 2 ..
        {
            // .. tak sa vykoná nejaká akcia.
        }
        return 1;
    }
    return 0;
}

Nezabudni niekde nastaviť hráčovi admin level.

 

error 055: start of function body without function header

error 010: invalid function or declaration

error 010: invalid function or declaration

error 010: invalid function or declaration

error 010: invalid function or declaration

code:

{
    if(!strcmp(cmdtext, "/azbranao", true))
    {
        if(JeHracAdmin[playerid] > 3) 
        {
    MoveObject(brana, -1665.7998000,1420.9004000,138.1000100, 1);
    SendClientMessage(playerid, 0xFF000000,"Brána je otevřena!");
        }
        return 1;
    }
    return 0;
}
{
    if(!strcmp(cmdtext, "/azbranaz", true))
    {
        if(JeHracAdmin[playerid] > 3) 
        {
    MoveObject(brana, -1665.7998000,1420.9004000,148.1000100, 1);
    SendClientMessage(playerid, 0xFF000000,"Brána je zavřena!");
        }
        return 1;
    }
    return 0;
}
Link to comment
Share on other sites

  • 0

{
if(!strcmp(cmdtext, "/azbranao", true))
{
if(JeHracAdmin[playerid] > 3)
{
MoveObject(brana, -1665.7998000,1420.9004000,138.1000100, 1);
SendClientMessage(playerid, 0xFF000000,"Brána je otevřena!");
}
return 1;
}

{
if(!strcmp(cmdtext, "/azbranaz", true))
{
if(JeHracAdmin[playerid] > 3)
{
MoveObject(brana, -1665.7998000,1420.9004000,148.1000100, 1);
SendClientMessage(playerid, 0xFF000000,"Brána je zavřena!");
}
return 1;
}

Link to comment
Share on other sites

  • 0
{
    if(!strcmp(cmdtext, "/azbranao", true))
    {
        if(JeHracAdmin[playerid] > 3) 
         {
             MoveObject(brana, -1665.7998000,1420.9004000,138.1000100, 1);
             SendClientMessage(playerid, 0xFF000000,"Brána je otevřena!");
        }
        return 1;
}

{
    if(!strcmp(cmdtext, "/azbranaz", true))
    {
        if(JeHracAdmin[playerid] > 3) 
        {
    MoveObject(brana, -1665.7998000,1420.9004000,148.1000100, 1);
    SendClientMessage(playerid, 0xFF000000,"Brána je zavřena!");
        }
        return 1;
    }

error 030: compound statement not closed at the end of file (started at line 94)

94:  if(!strcmp(cmdtext, "/azbranaz", true))

Link to comment
Share on other sites

  • 0

error 030: compound statement not closed at the end of file (started at line 94)

94:  if(!strcmp(cmdtext, "/azbranaz", true))

 

Pokud je /azbranaz poslední příkaz v public OnPlayerCommandText(playerid, cmdtext[]) tak to musíš uzavřít --> tedy return 0;

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/azbranao", true))
    {
        if(JeHracAdmin[playerid] > 3) 
         {
             MoveObject(brana, -1665.7998000,1420.9004000,138.1000100, 1);
             SendClientMessage(playerid, 0xFF000000,"Brána je otevřena!");
        }
        return 1;
}

    if(!strcmp(cmdtext, "/azbranaz", true))
    {
        if(JeHracAdmin[playerid] > 3) 
        {
    MoveObject(brana, -1665.7998000,1420.9004000,148.1000100, 1);
    SendClientMessage(playerid, 0xFF000000,"Brána je zavřena!");
        }
        return 1;

    }
    return 0;
}
Link to comment
Share on other sites

  • 0

Daj celý OnPlayerCommandText

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/azbranao", true))
    {
        if(adminlvl[playerid] > 3) 
         {
             MoveObject(brana, -1665.7998000,1420.9004000,138.1000100, 1);
             SendClientMessage(playerid, 0xFF000000,"Brána je otevřena!");
             return 1;
        }
        }
   if(!strcmp(cmdtext, "/azbranaz", true))
    {
        if(adminlvl[playerid] > 3) 
        {
    MoveObject(brana, -1665.7998000,1420.9004000,148.1000100, 1);
    SendClientMessage(playerid, 0xFF000000,"Brána je zavřena!");
return 1;
        }
}
        return 0;
    
}
Už mi to jde dát do amx ale když to napíšu do chatu tak mi to napíše Příkaz ......... neexistuje
Link to comment
Share on other sites

  • 0

A co toto : if(!strcmp(cmdtext, "/azbranao", true,9))  takto  if(!strcmp( "/azbranaz",cmdtext, true,9)) 

 

Já s strcmp moc nepracuju, tak nevím. Ale může se to hádat třeba s módem - alespoň mi to dělá dcmd. Příkazy z FS fungují ale z módu to už ne :d

Link to comment
Share on other sites

  • 0

Předpokládám, že máš rze... Takže admin system je rozdílný. Něco jiného je admin system v módu a ve fs. Aby ti to šlo, tak si ho musíš nastavit i v FS - ovšem budeš muset každému dávat 2 typy admin levlů - jeden k módu a druhý k bráně... Ovšem pokud máš .pwn soubor od svého módu ,tak to nebude problém...

Link to comment
Share on other sites

  • 0
  • Globální moderátor

Nejde to. OMG!!!

tak skúšaj preboha, ešte povedz že oni za to môžu že ti to nejde

Link to comment
Share on other sites

  • 0

Předpokládám, že máš rze... Takže admin system je rozdílný. Něco jiného je admin system v módu a ve fs. Aby ti to šlo, tak si ho musíš nastavit i v FS - ovšem budeš muset každému dávat 2 typy admin levlů - jeden k módu a druhý k bráně... Ovšem pokud máš .pwn soubor od svého módu ,tak to nebude problém...

Takže kde to mám nastavit v tom fs? pwn od rze nemám.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...