31.12.2011, 22:44
I'm working on a script currently, but I want to know how it's possible to get it to work?
Obviously the "pay" is part of a bigger "loan" command which has a ton of parameters, however I'm not entirely sure if I can get this one too work. TargetID and Cash are both defined.
So, would this work? Or is there a better way of doing it? Thank you!
Obviously the "pay" is part of a bigger "loan" command which has a ton of parameters, however I'm not entirely sure if I can get this one too work. TargetID and Cash are both defined.
pawn Код:
if(szOption, "pay", true))
{
if(!sscanf(params, "di", TargetID, Cash)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /loan pay [Cash]");
if(GetPlayerMoney(playerid) < Cash) return SendClientMessage(playerid, COLOR_WHITE, "You do not have that much money.");
if(GetPlayerMoney(playerid) > Cash)
GivePlayerMoney(playerid, -Cash);
GivePlayerMoney(TargetID, Cash);
return 1;
}