02.03.2016, 09:47
Quote:
he's asking about Sending a message to otherid and playerid.
PHP код:
|
PHP код:
dcmd_pay(playerid, params[])
{
new otherid, cash;
new otheridname[MAX_PLAYER_NAME], playeridname[MAX_PLAYER_NAME], string[128+MAX_PLAYER_NAME];
GetPlayerName(otherid, otheridname, sizeof(otheridname));// Your Posted Wrong at Here
GetPlayerName(playerid, playeridname, sizeof(playeridname));
if(sscanf(params, "ui", otherid, cash)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /pay [ID] [Cash]");
if(GetPlayerMoney(playerid) > cash) return SendClientMessage(playerid, COLOR_RED, "You don't have that much!");
if(!IsPlayerConnected(otherid)) return SendClientMessage(playerid, COLOR_RED, "That PlayerID is not connected!");
if(otherid == playerid) return SendClientMessage(playerid, COLOR_RED, "It is pointless to pay yourself..");
GivePlayerMoney(playerid, -cash);
format(string, sizeof(string),"You have successfully give $%i to %s",cash, otheridname);
SendClientMessage(playerid, COLOR_GREEN, string);
GivePlayerMoney(otherid, cash);
format(string, sizeof(string),"You have received $%d from %s",cash, playeridname);//Wrong at Here
SendClientMessage(otherid, COLOR_GREEN, string);//And Wrong at Here
return 1;
}