Код:
CMD:pay(playerid, params[])
{
new id;
new money2;
new Float:XX1, Float:YY1, Float:ZZ1;
if(!sscanf(params, "ud", id, money2))
{
new string[128];
GetPlayerPos(id, XX1, YY1, ZZ1);
if(IsPlayerInRangeOfPoint(playerid, 5.0, XX1, YY1, ZZ1))
{
if(PlayerInfo[playerid][Cash] >= money2 && money2 > 0)
{
new name[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, pname, sizeof(pname));
GivePlayerMinusCash(playerid, money2);
GivePlayerCash(id, money2);
format(string, sizeof(string), "**%s Takes out some money and gives it to %s (($%d))", name, pname, money2);
LocalChat(15.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);
printf("[CMD: pay] %s Gives $%d to %s", name, pname, money2);
return 1;
}
else return SendClientMessage(playerid, COLOR_GREY, "Not enough money!");
}
else return SendClientMessage(playerid, COLOR_GREY, " You are not near the other player! ");
}
else return SendClientMessage(playerid, COLOR_GREY, " UASGE: /pay [Player ID/ PlayerName] [Ammount] ");
}