10.07.2015, 01:03
pawn Код:
new
bool:Hunt[ MAX_PLAYERS ]
;
public OnPlayerConnect(playerid)
{
Hunt[ playerid ] = false;
return 1;
}
CMD:allhunt( playerid, params[] )
{
new
id, str[ 144 ], name[ MAX_PLAYER_NAME - 1 ]
;
if( sscanf( params, "u", id ) ) return SendClientMessage( playerid , -1 , "Syntax: /allhunt <playerid/name>" );
if( !IsPlayerConnected( id ) ) return SendClientMessage ( playerid, -1, "Player is not connected" );
if( Hunt [ id ] == true ) return SendClientMessage( playerid, -1, "Already activated." );
GetPlayerName( id, name, sizeof( name ) ) ;
Hunt[ id ] = true;
SetPlayerHealth( id, 100 ) ;
SetPlayerArmour( id , 100 );
format( str, sizeof( str ) , "All hunt %s..", name );
SendClientMessageToAll( -1 , str ) ;
return true;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if( Hunt[ playerid ] == true )
{
GivePlayerMoney( killerid, 100 ); //Give him the reward you want.
Hunt[ playerid ] = false;
}
return 1;
}