Posts: 1,219
Threads: 51
Joined: Jul 2012
Quote:
Originally Posted by RyderX
No need to check ip to dis-allow yourself to send money to urself,
just use this one:
PHP код:
COMMAND:pay(playerid, params[])
{
new otherid, cash;
if (sscanf(params, "dd", otherid, cash)) SendClientMessage(playerid, COLOR_RED, "[ERROR]: {FFFFFF}/pay [ID] [Amount]");
else
{
if(GetPlayerMoney(playerid) < cash) SendClientMessage(playerid, COLOR_RED, "[ERROR]: {FFFFFF}You don't have that much!");
else if(!IsPlayerConnected(otherid)) SendClientMessage(playerid, COLOR_RED, "[ERROR]: {FFFFFF}Invalid ID (Player not connected)");
else if(otherid == playerid) SendClientMessage(playerid, COLOR_RED, "[ERROR]: {FFFFFF}Invalid ID (You can't pay yourself)");
else
{
GivePlayerMoney(playerid, -cash);
GivePlayerMoney(otherid, cash);
}
}
return 1;
}
|
Dude ... he doesn't to check if it the same player but another character of the same person ... so your answer makes no sense