01.09.2009, 18:58
I don't know why this doesn't work. I don't get any errors but the player doesn't get paid the amount the other player puts in and the player giving the money doesn't get a decrease in the chosen amount.
pawn Код:
dcmd(pay, 3,cmdtext);
pawn Код:
dcmd_pay(playerid,params[]){
new giveid, cash;
if (sscanf(params, "ud",giveid,cash))
{
return SendClientMessage(playerid,COLOR_YELLOW,"/pay [ID] [amount]");
}
else if(!IsPlayerConnected(giveid))
{
return SendClientMessage(playerid,COLOR_RED,"Wrong ID");
}
else if(playerid==giveid)
{
return SendClientMessage(playerid,COLOR_RED,"You cannt pay yourself");
}
else if(cash>GetPlayerMoney(playerid) || cash<0)
{
return SendClientMessage(playerid,COLOR_RED,"You don't have so much money");
}
else
{
GivePlayerMoney(playerid, -cash);
GivePlayerMoney(giveid, cash);
}
return 1;
}