/givemoney and /setmoney
#10

Код:
CMD:setmoney ( playerid , params [] )
{
    if ( !PlayerInfo[playerid][pAdmin] >= 4 ) return SendClientMessage (playerid , COLOR_CORRECTION , "You are not admin!" ) ;
    new id , ammount;
    if ( !IsPlayerConnected ( id ) ) return SendClientMessage ( playerid , COLOR_CORRECTION , "Invalid player specified !" ) ;
    if ( ammount < 0 || ammount > 900000000 ) return SendClientMessage ( playerid , -1 , "You can't set more than $900.000.000" ) ;
    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 [PlayerID / PartOfName] [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_RED , Str ) ;
    format ( Str , 128 , "You Gave %d Money To %s" , ammount , PName ) ;
    SendClientMessage ( playerid , COLOR_GREEN , Str ) ;
    GivePlayerMoney ( id , ammount ) ;
    }
    return 1;
}
Reply


Messages In This Thread
/givemoney and /setmoney - by Jaua10 - 12.07.2018, 08:08
Re: /givemoney and /setmoney - by DerickClark - 12.07.2018, 08:09
Re: /givemoney and /setmoney - by Mike861 - 12.07.2018, 08:11
Re: /givemoney and /setmoney - by DerickClark - 12.07.2018, 08:12
Re: /givemoney and /setmoney - by Jaua10 - 12.07.2018, 08:25
Re: /givemoney and /setmoney - by DerickClark - 12.07.2018, 08:32
Re: /givemoney and /setmoney - by Jaua10 - 12.07.2018, 08:57
Re: /givemoney and /setmoney - by Jaua10 - 12.07.2018, 08:59
Re: /givemoney and /setmoney - by Verc - 12.07.2018, 09:02
Re: /givemoney and /setmoney - by DerickClark - 12.07.2018, 09:06

Forum Jump:


Users browsing this thread: 1 Guest(s)