AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Semiclip crashes server (https://forums.alliedmods.net/showthread.php?t=28836)

SentryIII 05-23-2006 22:55

Semiclip crashes server
 
Hello,
Im running Asskicrs kz_multiplugin, and if someone has semiclip and walks into a teleport it crashes the server. I tried making a plugin to disable semiclip if they are near a teleport but it doesnt seem to be working. So, I am asking for assistance now after 24 hours of trial and error.

Code:
/* Auto Semiclip Standalone */ #include <amxmodx> #include <amxmisc> #include <fun> #include <engine> #include <cstrike> #define PLUGIN "Auto Semiclip Standalone" #define VERSION "1" #define AUTHOR "SentryIII" //new Float:entcolor[3] = {127.0,20.0,20.0} public plugin_init() {     register_plugin(PLUGIN,VERSION,AUTHOR)     register_cvar("auto_semiclip","1") } public client_PreThink(id) {     if(!is_user_alive(id))         return PLUGIN_CONTINUE         if(get_cvar_num("auto_semiclip"))     {         new iEnts[1], iEntFlag, Float:flRadius = 200.0                 find_sphere_class(id,"player",flRadius,iEnts,1)         if(iEnts[0])             iEntFlag = 0                 find_sphere_class(id,"trigger_hurt",flRadius,iEnts,1)         if(iEnts[0])             iEntFlag = 2                     //find_sphere_class(id,"trigger_teleport",flRadius,iEnts,1)         //if(iEnts[0])         //  iEntFlag = 1                 if(iEntFlag == 2)         {             entity_set_int(id,EV_INT_solid,2)             /*             entity_set_int(id,EV_INT_rendermode,0)             entity_set_int(id,EV_INT_renderfx,kRenderFxGlowShell)             entity_set_float(id,EV_FL_renderamt,255.0)             entity_set_vector(id,EV_VEC_rendercolor,entcolor)             */         }         /*else if(iEntFlag == 1)         {             entity_set_int(id,EV_INT_solid,1)                         entity_set_int(id,EV_INT_rendermode,2)             entity_set_int(id,EV_INT_renderfx,kRenderFxGlowShell)             entity_set_float(id,EV_FL_renderamt,175.0)             entity_set_vector(id,EV_VEC_rendercolor,entcolor)                     }*/         else if(iEntFlag == 0)         {             entity_set_int(id,EV_INT_solid,0)             /*             entity_set_int(id,EV_INT_rendermode,2)             entity_set_int(id,EV_INT_renderfx,kRenderFxGlowShell)             entity_set_float(id,EV_FL_renderamt,175.0)             entity_set_vector(id,EV_VEC_rendercolor,entcolor)             */         }     }         return PLUGIN_CONTINUE }

Im not worried about the player transparency atm, unless someone knows how to make it work without having to look it up.

Anyways, once again my problem is semiclipping crashes the server when the player goes into a teleport, kz_multiplugin also crashes server.

Id like to get the plugin I posted to work because it enables automatically on the player when the player is near another player.

DarkSnow 05-24-2006 00:26

Something like this i guess, hope it will help

Code:
new ent new Float: f_eorg[3] ent = find_ent_by_class(-1, "func_teleport") if (!ent)   return PLUGIN_CONTINUE get_brush_entity_origin (ent, f_teorg)

Code:
distance_to_teleport = get_distance_f(f_player_origin, f_eorg)

Cheers mate :)

SentryIII 05-24-2006 02:03

Heres where Im at now:

Code:
/* Auto Semiclip Standalone */ #include <amxmodx> #include <amxmisc> #include <fun> #include <engine> #include <cstrike> #define PLUGIN "Auto Semiclip Standalone" #define VERSION "1" #define AUTHOR "SentryIII" //new Float:entcolor[3] = {127.0,20.0,20.0} public plugin_init() {     register_plugin(PLUGIN,VERSION,AUTHOR)     register_cvar("auto_semiclip","1") } public client_PreThink(id) {     if(!is_user_alive(id))         return PLUGIN_CONTINUE         if(get_cvar_num("auto_semiclip"))     {         new origin[3], Float: forigin[3]         new ent, classname[32]         get_user_origin(id, origin, 0)         IVecFVec(origin, forigin)         while((ent = find_ent_in_sphere(ent,forigin,200.0)) != 0 ){             entity_get_string(ent,EV_SZ_classname,classname,31);                         if (equali(classname,"func_teleport"))             {                 entity_set_int(id,EV_INT_solid,SOLID_TRIGGER)                 set_user_rendering(id,kRenderFxNormal,0,0,0,kRenderNormal,0)                 return PLUGIN_CONTINUE             }             else if(equali(classname,"player"))             {                 entity_set_int(id,EV_INT_solid,SOLID_NOT)                 set_user_rendering(id,kRenderFxHologram,200,200,200,kRenderTransAlpha,25)                 return PLUGIN_CONTINUE             }             else             {                 entity_set_int(id,EV_INT_solid,SOLID_BBOX)                 set_user_rendering(id,kRenderFxNormal,0,0,0,kRenderNormal,0)                 return PLUGIN_CONTINUE             }         }     }     return PLUGIN_CONTINUE }

The problem now is that when it searches for the player class it obviouslly finds the player on the client, but I need it to skip the first player found. Any suggestions?

Also, Im not sure if my rendering is setup correctly...

Hawk552 05-24-2006 08:34

Read my surf tools plugin, specifically the extras plugin. The code in there works, and it does exactly what you're trying to.

SentryIII 05-24-2006 18:43

Hawk, Im sure you probably noticed, but your plugin was the foundation of what I started with. Ill go back and try again, maby the problem Im having is my own fault like most issues are...

Hawk552 05-24-2006 18:47

Uhh not really, I was referring to this:

Code:
        new iEnts[1], bool:bEntFlag, Float:flRadius = 200.0                 find_sphere_class(id,"trigger_hurt",flRadius,iEnts,1)         if(iEnts[0])             bEntFlag = true                     find_sphere_class(id,"trigger_teleport",flRadius,iEnts,1)         if(iEnts[0])             bEntFlag = true                 if(bEntFlag)             entity_set_int(id,EV_INT_solid,3)         else             entity_set_int(id,EV_INT_solid,0)

You might have been looking at an older version which sucked.

SentryIII 05-24-2006 19:05

So am I, what I need to happen is have semiclip disabled normally untill another player is within the radius, then it turns on, unless theres a teleport inside the radius then it turns off.

Thats why your plugin wont work as is because semiclip is always on and you cant see other players names.

Hawk552 05-24-2006 19:08

Quote:

Originally Posted by SentryIII
So am I, what I need to happen is have semiclip disabled normally untill another player is within the radius, then it turns on, unless theres a teleport inside the radius then it turns off.

Thats why your plugin wont work as is because semiclip is always on and you cant see other players names.

That's a slow and stupid method, I think it's better to just live without the names.

3.5-3.9 used that, and the semiclip never worked. Also, if 2 people land on the teleporter near the same time, it'll crash the server.

SentryIII 05-24-2006 22:55

I dont see why its slow, and I certainly dont care if you think its stupid. The problem with it is I cant use jedigrab on players to help them out. I have my reasons for this, thanks for your input.

Im sure it can be made so that semiclip disables completely if the player is near a teleport, even if theres another player at the teleport. Its not impossible to do, it will just take trial and error to figure out what works.

Hawk552 05-25-2006 08:13

Quote:

Originally Posted by SentryIII
I dont see why its slow, and I certainly dont care if you think its stupid. The problem with it is I cant use jedigrab on players to help them out. I have my reasons for this, thanks for your input.

Im sure it can be made so that semiclip disables completely if the player is near a teleport, even if theres another player at the teleport. Its not impossible to do, it will just take trial and error to figure out what works.

Good luck.


All times are GMT -4. The time now is 16:27.

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