Strange bug in /setmoney command.
#9

Made from scratch -
pawn Код:
CMD:setmoney ( playerid , params [] )
{
    if ( !PlayerInfo[playerid][AdminLevel] >= 3 ) return NotAdmin(playerid);
    new id , ammount;
    if ( !IsPlayerConnected ( id ) ) return SendClientMessage ( playerid , -1 , "Invalid Player ID" ) ;
    if ( ammount < 0 || ammount > 10000000000 ) return SendClientMessage ( playerid , -1 , "You can give more than 10000000000$" ) ;
    if ( GetPlayerMoney ( playerid ) < ammount ) return SendClientMessage ( playerid , -1 , "You cant give money more than you have." ) ;
    if ( sscanf ( params , "ui" , id , ammount ) ) return SendClientMessage ( playerid , -1 , "Usage :  /setmoney [ID] [Ammount]" ) ;
    else
    {
    new IName [ MAX_PLAYER_NAME ] , PName [ MAX_PLAYER_NAME ] , Str [ 128 ] ;
    GetPlayerName ( id , IName , MAX_PLAYER_NAME ) ;
    GetPlayerName ( playerid , IName , MAX_PLAYER_NAME ) ;
    format ( Str , 128 , "%s Has Given You %d" , IName , ammount ) ;
    SendClientMessage ( id , COLOR_DARKGOLD , Str ) ;
    format ( Str , 128 , "You Gave %d Money To %s" , ammount , PName ) ;
    SendClientMessage ( playerid , COLOR_DARKGOLD , Str ) ;
    GivePlayerMoney ( id , ammount ) ;
    }
    return 1;
}
Not Tested.
Should work properly.
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)