/togphone command not working
#1

Here's the code: http://pastebin.com/gk1iqd9i

Sorry I didn't bother to copy the code and place it here, on the forums. (line 65 anyway)

If anyone could help me figure out what is the problem, that would make really happy.
Reply
#2

First, instead of all this:
pawn Код:
if(isnull(params)) return SendClientMessage(playerid, LIGHT_GRAY, "{EE7181}USAGE{C0C0C0}: /togphone [on/off]");
new input[8] = "on off";
sscanf(input, "ss", PHONE_STATUS_ON, PHONE_STATUS_OFF);
You should just use the isnull, there's really no reason to use new input or sscanf.
Second, use strcmp to compare 2 strings.
Etc instead of:
pawn Код:
if(params[4] == PHONE_STATUS_ON)
It should be:
pawn Код:
if(!strcmp(params, "PHONE_STATUS_ON", true))
And same with the PHONE_STATUS_OFF.
Reply
#3

Thanks for the answer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)