SA-MP Forums Archive
What is wrong in that command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: What is wrong in that command (/showthread.php?tid=315865)



What is wrong in that command - boyan96 - 04.02.2012

if(strcmp(cmd, "/pay", true) == 0)
{
if(IsPlayerConnected(playerid) && (boxevent == 0) && if (PlayerInfo[playerid][pAdmin] >= 1337
{
boxevent = 1;
BroadCast(COLOR_GREEN, " ***************!");
}
else if(IsPlayerConnected(playerid) && (boxevent == 1) && IsPlayerAdmin(playerid))
{
boxevent = 0;
BroadCast(COLOR_GREEN, " ******************.");
}
return 1;
}


Re: What is wrong in that command - boyan96 - 04.02.2012

someone ?


Re: What is wrong in that command - ServerScripter - 04.02.2012

can you explain what's the problem with the command?


Re: What is wrong in that command - Thunderbolt - 04.02.2012

I think that you forgot some brackets, anyway try this one,

pawn Код:
if(strcmp(cmd, "/pay", true) == 0)
{
    if(IsPlayerConnected(playerid) && (boxevent == 0) && if (PlayerInfo[playerid][pAdmin] >= 1337))
    {
        boxevent = 1;
        BroadCast(COLOR_GREEN, " ***************!");
    }
    else if(IsPlayerConnected(playerid) && (boxevent == 1))
    {
        if(IsPlayerAdmin(playerid))
        {
            boxevent = 0;
            BroadCast(COLOR_GREEN, " ******************.");
        }
    }
    return 1;
}



Re: What is wrong in that command - Konstantinos - 04.02.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmd, "/pay", true) == 0) {
        if(IsPlayerConnected(playerid) ) {
            if (boxevent == 0 && PlayerInfo[playerid][pAdmin] >= 1337) {
                boxevent = 1;
                BroadCast(COLOR_GREEN, " ***************!");
            }
            else if(boxevent == 1 && IsPlayerAdmin(playerid)) {
                boxevent = 0;
                BroadCast(COLOR_GREEN, " ******************.");
            }
        }
        return 1;
    }
    // Rest
    return 0;
}