Reading All Three Commands
#2

You need to put the rank checks in the commands with a return like
pawn Код:
if(strcmp(cmdtext, "/gotos", true) == 0)
{
    if(AccountInfo[playerid][aLevel] <= 0)
        return SendClientMessage(playerid, COLOR_RED, "You need to be a Helper to use gotos command!");
    SetPlayerPos(playerid, -1470.45617676,2611.21215820,59.36460875);
    SendClientMessage(playerid,red, "Welcome to Staff Base.");
    return 1;
}
But I like this methode, so the unqualified people get a Unknown Command error
pawn Код:
if(AccountInfo[playerid][aLevel] > 0)
{
    if(strcmp(cmdtext, "/gotos", true) == 0)
    {
        SetPlayerPos(playerid, -1470.45617676,2611.21215820,59.36460875);
        SendClientMessage(playerid,red, "Welcome to Staff Base.");
        return 1;
    }
    if(strcmp(cmdtext, "/agateo", true)==0)
    {
        SendClientMessage(playerid, COLOR_RED, "You have opened the staff gate!");
        MoveObject(agate, -1481.26208496,2660.61840820,48, 3);
        return 1;
    }
    if(strcmp(cmdtext, "/agatec", true)==0)
    {
        SendClientMessage(playerid, COLOR_RED, "You have closed the staff gate!");
        MoveObject(agate, -1481.26208496,2660.61840820,56.58593750, 3);
        return 1;
    }
}
Reply


Messages In This Thread
Reading All Three Commands - by Joshua1987 - 30.01.2011, 15:48
AW: Reading All Three Commands - by Nero_3D - 30.01.2011, 16:30
Re: Reading All Three Commands - by Joshua1987 - 30.01.2011, 18:53
AW: Re: Reading All Three Commands - by Nero_3D - 31.01.2011, 14:02

Forum Jump:


Users browsing this thread: 1 Guest(s)