SA-MP Forums Archive
Help me fixing this 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help me fixing this command... (/showthread.php?tid=133070)



Help me fixing this command... - Miguel - 10.03.2010

http://pawn.pastebin.com/yVWUkuF7

pawn Код:
else if(0 > hour > 23) return SendClientMessage(playerid, SYSTEM_DENIAL, "* The new hour has to be between 0 and 23!");
else if(0 > minutes > 59) return SendClientMessage(playerid, SYSTEM_DENIAL, "* The new minutes has to be between 0 and 59!");


Can you help me fixing that? (I believe it's a pretty simple mistake)...


Re: Help me fixing this command... - pen_theGun - 10.03.2010

pawn Код:
else if(0 > hour || hour > 23) return SendClientMessage(playerid, SYSTEM_DENIAL, "* The new hour has to be between 0 and 23!");
else if(0 > minutes || minutes > 59) return SendClientMessage(playerid, SYSTEM_DENIAL, "* The new minutes has to be between 0 and 59!");



Re: Help me fixing this command... - Miguel - 10.03.2010

Quote:
Originally Posted by pen_†ĥęGun
pawn Код:
else if(0 > hour || hour > 23) return SendClientMessage(playerid, SYSTEM_DENIAL, "* The new hour has to be between 0 and 23!");
else if(0 > minutes || minutes > 59) return SendClientMessage(playerid, SYSTEM_DENIAL, "* The new minutes has to be between 0 and 59!");
So it won't work by the other way... thank buddy!

Edit:

Since I don't want to make another topic:

pawn Код:
else if(strcmp(SubCom, "vas", true) == 0)
{
    new
      state[4]; // 2214

    if(sscanf(params, "s[4]s[4]", SubCom, state)) return SendClientMessage(playerid, SYSTEM_DENIAL, "* Usage: /set vas [on / off]"); // 2216
    else if(strcmp(state, "on", true) == 0) // 2217
    {
        if(Server[VACSystem] == 1) return SendClientMessage(playerid, SYSTEM_DENIAL, "* The vehicle aceleration system is already enabled!");
        else
        {
            Server[VACSystem] = 1;
            SendClientMessage(playerid, SYSTEM, "* You have enabled the vehicle acleration system!");
            return 1;
        }
    }
    else if(strcmp(state, "off", true) == 0) // 2227
    {
        if(Server[VACSystem] == 0) return SendClientMessage(playerid, SYSTEM_DENIAL, "* The vehicle aceleration system is already disabled!");
        else
        {
            Server[VACSystem] = 0;
            SendClientMessage(playerid, SYSTEM_DENIAL, "* You have disabled the vehicle acleration system!");
            return 1;
        }
    }
}
Код:
(2214) : error 001: expected token: "-identifier-", but found "state"
(2216) : error 001: expected token: "-identifier-", but found ")"
(2217) : error 001: expected token: "-identifier-", but found ","
(2227) : error 001: expected token: "-identifier-", but found ","
Nvm, I found out I can't use "state" as a variable...