05.01.2016, 20:43
Код:
CMD:pay(playerid, params[]) { new otherid,cash,string[128],namez[MAX_PLAYER_NAME], namez1[MAX_PLAYER_NAME]; if (sscanf(params, "ui", otherid, cash)) SendClientMessage(playerid, -1, "{5CFF6F}USAGE: {FFFFFF}/pay [ID] [Amount]"); else { if(GetPlayerMoney(playerid) < cash) return SendClientMessage(playerid, -1, "{FF6347}ERROR: {FFFFFF}You don't have that much!"); else if(!IsPlayerConnected(otherid)) return SendClientMessage(playerid, -1, "{FF6347}ERROR: {FFFFFF}That desired ID is not connected."); else if(otherid == playerid) return SendClientMessage(playerid, -1, "{FF6347}ERROR: {FFFFFF}You can't pay yourself."); else { GivePlayerMoney(playerid, -cash); GetPlayerName(otherid,namez1,sizeof(namez1)); format(string,sizeof(string),"{5CFF6F}NOTICE: {FFFFFF}You have sent {5CFF6F}$%d {FFFFFF}to {5CFF6F}%s{FFFFFF}.",cash,namez1); SendClientMessage(playerid,-1,string); GivePlayerMoney(otherid, cash); GetPlayerName(playerid,namez,sizeof(namez)); format(string,sizeof(string),"{5CFF6F}NOTICE: {FFFFFF}You have recieved {5CFF6F}$%d {FFFFFF}from {5CFF6F}%s{FFFFFF}.",cash,namez); SendClientMessage(otherid,-1,string); } } return 1; }