pawn Код:
CMD:search( playerid, params[ ] )
{
if( isnull( params ) )
{
if( hung_IsPlayerAthunger( playerid ) )
{
if( isfilling[ playerid ] ) return SendClientMessage( playerid, 0xFFC800FF, "You are already eating!" );
if( hungers[ playerid ] > 80 ) return SCM( playerid, red, "You are not hungry!" );
TogglePlayerControllable( playerid, 0 );
isfilling[ playerid ] = 1;
timerfill[ playerid ] = SetTimerEx( "timer_fill", 5500, true, "i", playerid ); //setting refueltimer
}
}
if( !strcmp( params, "ammu", true ) )
{
if( isfilling[ playerid ] ) return SendClientMessage( playerid, 0xFFC800FF, "You are already searching!" );
if( !ammu_IsPlayerAtammu( playerid ) ) return SendClientMessage( playerid, red, "You are not at a ammunation!" );
TogglePlayerControllable( playerid, 0 );
timerammu[ playerid ] = SetTimerEx( "timer_ammu", 5000, true, "i", playerid ); //setting refueltimer
isfilling[ playerid ] = 1; //resetting anti-spam thingy :3
}
else if( !strcmp( params, "base", true ) )
{
if( isfilling[ playerid ] ) return SendClientMessage( playerid, 0xFFC800FF, "You are already searching!" );
if( !base_IsPlayerAtme( playerid ) ) return SendClientMessage( playerid, red, "You are not at the base!" );
TogglePlayerControllable(p layerid, 0 );
isfilling[ playerid ] = 1; //resetting anti-spam thingy :3
timerbase[ playerid ] = SetTimerEx( "timer_base", 5000, true, "i", playerid ); //setting refueltimer
}
else SendClientMessage( playerid, -1, "Usage: /search OR /search <Ammu/Base>" );
return 1;
}