Question about ZCMD & SSCANF
#3

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
Made it quirckly, just look in both commands and try get their logic's by your self.

pawn Код:
CMD:givemoney(playerid,params[])
{
   new money,people;
   if(sscanf(params,"ud",people,money))return SendClientMessage(playerid,-1,#usage /givemoney [id] [amount]);
   if(!IsPlayerConnected(people)) return SendClientMessage(playerid,-1,#not connected);
   if(playerid == people) return SendClientMessage(playerid,-1,#you can't give money to yourself.);
   GivePlayerMoney(playerid,-money);
   GivePlayerMoney(people,money);
   return 1;
}
new keys[MAX_PLAYERS];
CMD:givekey(playerid,params[])
{
   new people,key;
   if(sscanf(params,"ud",people,keys))return SendClientMessage(playerid,-1,#usage /givekey [id]);
   if(!IsPlayerConnected(people)) return SendClientMessage(playerid,-1,#not connected);
   if(playerid == people) return SendClientMessage(playerid,-1,#you can't give the key to yourself.);
   keys[playerid]-=key;
   keys[people]+=key;
   return 1;
}
You misunderstood me. I can do those normal commands easy, but i want to do a command as this:
/give key (playerid)
/give money (playerid) (amount)
/give phone (playerid)
/give...
/give... You see, /give is one command. I hope you understand what do i mean.
Reply


Messages In This Thread
Question about ZCMD & SSCANF - by ddnbb - 11.08.2012, 19:23
Re: Question about ZCMD & SSCANF - by leonardo1434 - 11.08.2012, 19:38
Re: Question about ZCMD & SSCANF - by ddnbb - 11.08.2012, 19:49
Re: Question about ZCMD & SSCANF - by leonardo1434 - 11.08.2012, 19:56
Re: Question about ZCMD & SSCANF - by FalconX - 11.08.2012, 19:56
Re: Question about ZCMD & SSCANF - by MeDaKewlDude - 11.08.2012, 20:04
Re: Question about ZCMD & SSCANF - by ddnbb - 11.08.2012, 20:29

Forum Jump:


Users browsing this thread: 3 Guest(s)