18.03.2012, 15:58
Made from scratch -
Not Tested.
Should work properly.
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;
}
Should work properly.