04.05.2011, 11:15
you might want to try sscanf, as this will not work, or cause epic lagg when you have more numbers.
You should also run a check to see if the phone number actually exists, use the wiki for that. Also you should use ZCMD with this code. Good luck!
Also:
You're saying that you're command is 10 characters long, but it's actually 13(?). So you should fix that too.
pawn Код:
new pID; //Making variable for other playerid
if(sscanf(params, "d", pID, params)) return SendClientMessage(playerid, COLOR, "Usage: /call [number]"); //If the player just typed "/call"
else if(params <= 1111 || params >= 9999) return 1;//If the phone number was invalid.
SendClientMessage(pID, COLOR, "Hey, someone calls you...");//Sending message to that player that he is being called
Also:
Код:
if (strcmp("/phone number", cmdtext, true, 10) == 0)