Help (rep)
#10

Quote:
Originally Posted by MicroKyrr
Посмотреть сообщение
he's asking about Sending a message to otherid and playerid.

PHP код:
dcmd_pay(playeridparams[])
{
    new 
otheridcash;
    new 
otheridname[MAX_PLAYER_NAME], playeridname[MAX_PLAYER_NAME], string[128+MAX_PLAYER_NAME];
    
GetPlayerName(playeridplayeridnamesizeof(playeridname));
    
GetPlayerName(playeridplayeridnamesizeof(playeridname));
    if(
sscanf(params"ui"otheridcash)) return SendClientMessage(playerid0xFF0000AA"Usage: /pay [ID] [Cash]");
    if(
GetPlayerMoney(playerid) > cash) return SendClientMessage(playeridCOLOR_RED"You don't have that much!");
    if(!
IsPlayerConnected(otherid)) return SendClientMessage(playeridCOLOR_RED"That PlayerID is not connected!");
    if(
otherid == playerid) return SendClientMessage(playeridCOLOR_RED"It is pointless to pay yourself..");
    
GivePlayerMoney(playerid, -cash);
    
format(stringsizeof(string),"You have successfully give $%i to %s",cashotheridname);
    
SendClientMessage(playeridCOLOR_GREENstring);
    
GivePlayerMoney(otheridcash);
    
format(stringsizeof(string),"You have received $%d from %s",cashplayeridname);
    
SendClientMessage(playeridCOLOR_GREENstring);
    return 
1;

Edit: Didn't know someone already post a script. :/
PHP код:
dcmd_pay(playeridparams[])
{
    new 
otheridcash;
    new 
otheridname[MAX_PLAYER_NAME], playeridname[MAX_PLAYER_NAME], string[128+MAX_PLAYER_NAME];
    
GetPlayerName(otheridotheridnamesizeof(otheridname));// Your Posted Wrong at Here
    
GetPlayerName(playeridplayeridnamesizeof(playeridname));
    if(
sscanf(params"ui"otheridcash)) return SendClientMessage(playerid0xFF0000AA"Usage: /pay [ID] [Cash]");
    if(
GetPlayerMoney(playerid) > cash) return SendClientMessage(playeridCOLOR_RED"You don't have that much!");
    if(!
IsPlayerConnected(otherid)) return SendClientMessage(playeridCOLOR_RED"That PlayerID is not connected!");
    if(
otherid == playerid) return SendClientMessage(playeridCOLOR_RED"It is pointless to pay yourself..");
    
GivePlayerMoney(playerid, -cash);
    
format(stringsizeof(string),"You have successfully give $%i to %s",cashotheridname);
    
SendClientMessage(playeridCOLOR_GREENstring);
    
GivePlayerMoney(otheridcash);
    
format(stringsizeof(string),"You have received $%d from %s",cashplayeridname);//Wrong at Here
    
SendClientMessage(otheridCOLOR_GREENstring);//And Wrong at Here
    
return 1;

Try This...
Reply


Messages In This Thread
Help (rep)[SOLVED] - by Shaheen - 29.02.2016, 18:24
Re: Help (rep) - by Amit1998 - 29.02.2016, 21:53
Re: Help (rep) - by Shaheen - 01.03.2016, 03:02
Re: Help (rep) - by Shaheen - 02.03.2016, 07:42
Re: Help (rep) - by LocMax - 02.03.2016, 08:37
Re: Help (rep) - by xTURBOx - 02.03.2016, 08:57
Re: Help (rep) - by MicroKyrr - 02.03.2016, 09:08
Re: Help (rep) - by Shaheen - 02.03.2016, 09:40
Re: Help (rep) - by JeaSon - 02.03.2016, 09:44
Re: Help (rep) - by Amunra - 02.03.2016, 09:47

Forum Jump:


Users browsing this thread: 1 Guest(s)