AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved AddToFullPack - Solid Prediction (https://forums.alliedmods.net/showthread.php?t=300048)

gabuch2 08-03-2017 17:36

AddToFullPack - Solid Prediction
 
Hello

I run a metamod plugin that allows semiclipping however it doesn't alter the client collision prediction.

I'm building a simple amxx plugin, however it crashes (Segfault)

What am I doing wrong?

Code:
#include <amxmodx> #include <fakemeta> #include <engine> public plugin_init() {     register_plugin("Semiclip Prediction","1.0","Gabe Iggy")     register_forward(FM_AddToFullPack,"test") } //struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet public test(ent_state,e,edict_t_ent,edict_t_host,hostflags,player,pSet) {       if(player)     {         if(0 < e <= get_maxplayers())         {             if(0 < pev(edict_t_host, pev_groundentity) <= get_maxplayers())                 set_es(e, ES_Solid, 1)             else                 set_es(e, ES_Solid, 0)             return FMRES_OVERRIDE;         }     }         return FMRES_IGNORED; }

PRoSToTeM@ 08-04-2017 00:56

Re: AddToFullPack - Solid Prediction
 
Change hook to post and remove overriding.

NiHiLaNTh 08-04-2017 04:50

Re: AddToFullPack - Solid Prediction
 
Quote:

set_es(e, ES_Solid, 1)
First argument of the get/set_es is entity state handle, not the entity itself. So it should be set_es(ent_state.....

gabuch2 08-04-2017 20:28

Re: AddToFullPack - Solid Prediction
 
Quote:

Originally Posted by NiHiLaNTh (Post 2539567)
First argument of the get/set_es is entity state handle, not the entity itself. So it should be set_es(ent_state.....

It "works" now, as in, no longer crashes.

However I'm being pulled down on the map (is the plugin making ME non-solid in prediction?)

EDIT: Tested it in lan, apparently the code above is making me separating my fov from the player entity.

EDIT 2: FIXED it by following PRoSToTeM@'s instructions.

Quote:

Originally Posted by PRoSToTeM@ (Post 2539548)
Change hook to post and remove overriding.



All times are GMT -4. The time now is 23:11.

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