01.07.2014, 00:05
From Egypt too
أتفضل
أتفضل
Код:
CMD:givecash(playerid, params[]) { new giveplayerid, amount, Message[128], pName16[MAX_PLAYER_NAME],pName17[MAX_PLAYER_NAME],Message1[128]; #define COLOR_RED 0xFF0000AA #define COLOR_ORANGE 0xFF9500FF if (sscanf(params, "ud", giveplayerid, amount)) SendClientMessage(playerid, COLOR_RED, "Usage: /givecash [playerid/partname] [amount]"); else if (!IsPlayerConnected(giveplayerid)) SendClientMessage(playerid, COLOR_RED, "Player Not Connected"); else if (giveplayerid == playerid) SendClientMessage(playerid, COLOR_RED, "You Cannot Send Money To Yourself!"); else if (amount > GetPlayerMoney(playerid)) SendClientMessage(playerid, COLOR_RED, "You Don't Have That Much!"); else if (amount > 500000) SendClientMessage(playerid, COLOR_RED, "You Cannot Send More Than $500000!"); else if (amount < 0) SendClientMessage(playerid, COLOR_RED,"Wrong Value!"); else { GetPlayerName(playerid,pName,MAX_PLAYER_NAME); GetPlayerName(giveplayerid,pName1,MAX_PLAYER_NAME); GivePlayerMoney(giveplayerid, amount); GivePlayerMoney(playerid, -amount); format(Message, sizeof(Message), "Received $%d From %s (%d)!",amount, pName, playerid); SendClientMessage(giveplayerid,COLOR_ORANGE, Message); format(Message1, sizeof(Message1), "Successfully Sent $%d To %s (%d)!",amount, pName1, giveplayerid); SendClientMessage(playerid,COLOR_ORANGE, Message1); } return 1; }