A phone system
#2

you might want to try sscanf, as this will not work, or cause epic lagg when you have more numbers.

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
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:
Код:
if (strcmp("/phone number", cmdtext, true, 10) == 0)
You're saying that you're command is 10 characters long, but it's actually 13(?). So you should fix that too.
Reply


Messages In This Thread
A phone system - by Fallenmaster - 04.05.2011, 10:38
Re: A phone system - by alpha500delta - 04.05.2011, 11:15
Re: A phone system - by Fallenmaster - 04.05.2011, 11:41
Re: A phone system - by Cameltoe - 04.05.2011, 11:51
Re: A phone system - by Fallenmaster - 04.05.2011, 12:01
Re: A phone system - by Cameltoe - 04.05.2011, 12:04
Re: A phone system - by alpha500delta - 04.05.2011, 13:38
Re: A phone system - by Cameltoe - 04.05.2011, 21:03

Forum Jump:


Users browsing this thread: 1 Guest(s)