18.10.2011, 04:51
I'm trying to make it, so if a person does /loan then the target they did /loan on would have to "/take loan" In order to receive it. How would I add it to this?
Thanks for your help.
pawn Код:
CMD:loan(playerid, params[])
{
new Target, Amount;
if( !sscanf(params, "ui", Target, Amount) )
{
if( Amount < 5000 ) return SendClientMessage(playerid, -1, "You can only pay a minimum ammount of 5000");
if( Target == INVALID_PLAYER_ID ) return SendClientMessage(playerid, -1, "That person is Offline");
if( Target == playerid ) return SendClientMessage(playerid, -1, "You can not give a loan to yourself!");
if( GetPlayerMoney(playerid) < Amount ) return SendClientMessage(playerid, -1, "You don't have enough cash.");
GivePlayerMoney(playerid, -Amount);
GivePlayerMoney(Target, Amount);
} else return SendClientMessage(playerid, -1, "Usage: /loan [playerid] [amount]");
return 1;
}