Strange bug in /setmoney command.
#10

Try This
PHP код:
CMD:setcash(playeridparams[])
{
    new 
tmp[256],tmp2[256],ammount,playerIndextmp strtok(params,Index); tmp2 strtok(params,Index);
    
player strval(tmp);
    
ammount strval(tmp2);
    if(
IsPlayerConnected(player))
    {
         if(
PlayerInfo[playerid][Adminlevel] >= 3)
           {
            if(!
strlen(tmp))
            {
                   return 
SendClientMessage(playeridCOLOR_RED"USAGE: {0ce800}/setcash {0000ff}[PlayerId/PartOfName]{ff0000} [Ammount]");// Here When You Say "PartOfName" The Player Who Use This CMD Send The 'Money' To Player Who Have ID : "0"
            
}
            if(!
strlen(tmp2))
            {
                   return 
SendClientMessage(playeridCOLOR_RED"USAGE: {0ce800}/setcash {0000ff}[PlayerId/PartOfName]{ff0000} [Ammount]");// Here When You Say "PartOfName" The Player Who Use This CMD Send The 'Money' To Player Who Have ID : "0"
            
}
            if(
ammount <= 99999999)
               {
                new 
string[64]; new Name[MAX_PLAYER_NAME]; new PlayerName[MAX_PLAYER_NAME];
                
GetPlayerName(playeridNamesizeof(Name));
                 
GetPlayerName(playerPlayerNamesizeof(PlayerName));
                
format(stringsizeof(string), "Administrator \"%s\" has set your cash to '$%d'"Nameammount);
                
SendClientMessage(playerCOLOR_GREENstring);
                   
format(stringsizeof(string), "You Gave $%d Money To \"%s\" ."ammountPlayerName);
                   
SendClientMessage(playeridCOLOR_GREENstring);
                   
SetPlayerCash(playeridammount);
               }
            else return 
SendClientMessage(playeridCOLOR_RED"You can't give so much");
        }
           else return 
SendClientMessage(playerid,COLOR_RED,"You Can't Use This Command");
    }
    else return 
SendClientMessage(playeridCOLOR_RED"Player is not connected.");
    return 
1;
}
stock SetPlayerCash(playeridcash)
{
    
GivePlayerMoney(playerid, -GetPlayerMoney(playerid));
     
GivePlayerMoney(playeridcash);
    return 
1;

Quote:

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Reply


Messages In This Thread
Strange bug in /setmoney command. - by ricardo178 - 14.02.2012, 13:11
Re: Strange bug in /setmoney command. - by demonarn - 14.02.2012, 14:14
Re : Strange bug in /setmoney command. - by ricardo178 - 14.02.2012, 14:56
Re: Strange bug in /setmoney command. - by bestr32 - 18.03.2012, 15:35
Re: Strange bug in /setmoney command. - by bestr32 - 18.03.2012, 15:37
Re: Strange bug in /setmoney command. - by bestr32 - 18.03.2012, 15:39
Re: Strange bug in /setmoney command. - by Shabi RoxX - 18.03.2012, 15:48
Re: Strange bug in /setmoney command. - by Alexy_Dramon - 18.03.2012, 15:50
Re: Strange bug in /setmoney command. - by Ronaldo_raul™ - 18.03.2012, 15:58
Re: Strange bug in /setmoney command. - by HoussamMaroc - 26.07.2017, 23:09

Forum Jump:


Users browsing this thread: 1 Guest(s)