AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Surf Passthrough Help (https://forums.alliedmods.net/showthread.php?t=17543)

Hawk552 09-03-2005 16:18

Surf Passthrough Help
 
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 }

knekter 09-03-2005 21:18

Code:
public pfn_touch(ptr,ptd) {     if(ptr > 0 && ptd >= 0)     {         if(is_user_connected(ptr) && is_user_alive(ptr))         {             if(surfmap == false)                 return PLUGIN_CONTINUE         }                 if(get_cvar_num("surf_passthrough")==0)             return PLUGIN_CONTINUE                 new classname[64]         entity_get_string(ptd,EV_SZ_classname,classname,63)                 if(containi(classname,"trigger_"))             entity_set_int(ptr,EV_INT_solid,SOLID_TRIGGER)                 }     return PLUGIN_CONTINUE }

Hawk552 09-03-2005 21:20

No, I DON'T want it to SOLID_TRIGGER when it's touching a trigger_. Being solid 0 while touching a trigger_teleport crashes the server, and touching a trigger_hurt doesn't kill you.


All times are GMT -4. The time now is 14:33.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.