help with /pay cmd
#1

PHP код:
CMD:pay(playeridparams[])
{
  new 
otherid,cash,string[128],namez[MAX_PLAYER_NAME],names[MAX_PLAYER_NAME];
  if (
sscanf(params"dd"otheridcash)) SendClientMessage(playeridCOLOR_RED"Usage: /pay [ID] [Cash]");
  if(
otherid == playeridSendClientMessage(playeridCOLOR_RED"It is pointless to pay yourself..");
  else
  {
    if(
GetPlayerMoney(playerid) < cashSendClientMessage(playeridCOLOR_RED"You don't have that much!");
    else if(!
IsPlayerConnected(otherid)) SendClientMessage(playeridCOLOR_RED"That PlayerID is not connected!");
    else
    {
      
GivePlayerMoney(playerid, -cash);
            
GetPlayerName(otherid,names,sizeof(namez));
            
format(string,sizeof(string),"You gave $%d to %s",cash,names);
            
SendClientMessage(otherid,COLOR_BLUE,string);
    }
    {
      
GivePlayerMoney(otheridcash);
      
GetPlayerName(playerid,namez,sizeof(namez));
            
format(string,sizeof(string),"%s gave you $%d",cash,namez);
            
SendClientMessage(otherid,COLOR_BLUE,string);
    }
  }
  return 
1;

Can someone help me ?When i try to pay to myself the error msg shows two times...And i want when you give cash to someone to show you a msg:You gave [] to[] and player who get cash to get msg:[]Gave you[]
Reply


Messages In This Thread
help with /pay cmd - by bustern - 05.09.2013, 19:10
Re: help with /pay cmd - by bustern - 06.09.2013, 07:37
Re: help with /pay cmd - by dusk - 06.09.2013, 07:40
Re: help with /pay cmd - by AaronKillz - 06.09.2013, 07:51
Re: help with /pay cmd - by Dragonsaurus - 06.09.2013, 08:01
Re: help with /pay cmd - by bustern - 06.09.2013, 08:13
Re: help with /pay cmd - by Dragonsaurus - 06.09.2013, 08:14
Re: help with /pay cmd - by bustern - 06.09.2013, 08:16
Re: help with /pay cmd - by Dragonsaurus - 06.09.2013, 08:22
Re: help with /pay cmd - by AaronKillz - 06.09.2013, 08:24

Forum Jump:


Users browsing this thread: 2 Guest(s)