Hey, I got this so far for the surfing passthrough thing that was requested in the suggestions / requests forum, but it seems to crash the server, I was wondering if anyone would be willing to fix it or know how.
Code:
#include <amxmodx>
#include <engine>
#include <fun>
new bool:surfmap = false
public plugin_init()
{
new surftrue = check_surf()
if(surftrue == 1)
{
surfmap = true
}
register_plugin("Surf Passthrough","1.0","Hawk552")
register_cvar("surf_passthrough","1")
}
stock check_surf()
{
new mapname[64]
get_mapname(mapname,63)
if(containi(mapname,"surf_")!=-1)
{
return 1
}
return 0
}
public pfn_touch(ptr,ptd)
{
if(ptd == 0 || ptr == 0)
{
return PLUGIN_CONTINUE
}
if(is_user_connected(ptr) && is_user_alive(ptr))
{
if(surfmap == false)
{
return PLUGIN_CONTINUE
}
if(get_cvar_num("surf_passthrough")==0)
{
return PLUGIN_HANDLED
}
new classname[64]
entity_get_string(ptd,EV_SZ_classname,classname,63)
if(containi(classname,"trigger_")!=-1)
{
return PLUGIN_CONTINUE
}
else
{
entity_set_int(ptr,EV_INT_solid,SOLID_TRIGGER)
}
}
return PLUGIN_CONTINUE
}
__________________