11.08.2012, 19:38
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;
}