PHP Code:
/* Include File generated by Pawn Studio */
#include <amxmodx>
#include <engine>
new uw_on
public plugin_init()
{
register_plugin("Underwater Breathing","1.0","NeoHazard")
uw_on = register_cvar("amx_uw","1")
}
public Client_preThink(id)
{
if( is_user_alive( id ) && entity_get_int( id, EV_INT_waterlevel ) == 3 && uw_on == 1)
entity_set_float( id, EV_FL_air_finished, entity_get_float( id, EV_FL_air_finished ) + 1.0 )
}
amx_uw 1/0 - turns it on or off
Not tested BTW
Edit: If you want a fakemeta version of this you'd need to post the fakemeta code for it...i don't feel like doing that right now
EditEdit: Didn't see you wanted it on a specific person one second
Editx3: Heres the one you wanted
PHP Code:
/* Include File generated by Pawn Studio */
#include <amxmodx>
#include <engine>
new bool: g_underwater
public plugin_init()
{
register_plugin("Underwater Breathing","1.0","NeoHazard")
register_concmd("amx_uw","uw_onoff")
}
public uw_onoff(id,on)
if(on == 1)
{
g_underwater = true
}
else
{
g_underwater = false
}
public Client_preThink(id)
if(g_underwater == true)
{
if( is_user_alive( id ) && entity_get_int( id, EV_INT_waterlevel ) == 3)
entity_set_float( id, EV_FL_air_finished, entity_get_float( id, EV_FL_air_finished ) + 1.0 )
}
public client_disconnect(id)
g_underwater = false
public client_connect(id)
g_underwater = false
Editx4: Yami his last bump was valid, i think
__________________