30.07.2014, 15:51
How would I assign a random 5 digit number to targetid? Here is the code:
Код:
CMD:agivecellphone(playerid,params[]) { if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid,-1,"{AA3333}ERROR:{FFFFFF} Only administrators may use this command."); { new targetid, string[128], string2[128]; if(sscanf(params,"u",targetid)) return SendClientMessage(playerid,-1,"{AA3333}USAGE:{FFFFFF} /agivecellphone (id)"); if(PlayerInfo[targetid][pCellNumber] > 0) return SendClientMessage(playerid,-1,"{AA3333}ERROR:{FFFFFF} Player already has a cellphone."); { // Assign a random 5 digit number to targetid, PlayerInfo[targetid][pCellNumber] format(string,128,"{AA3333}AdminCMD:{FFFFFF} You have given %s a cellphone.",RemoveUnderScore(targetid)); SendClientMessage(playerid,-1,string); format(string2,128,"{AA3333}AdminCMD:{FFFFFF} You have been given a cellphone by an administrator."); SendClientMessage(targetid,-1,string2); } } return 1; }