Raised This Month: $51 Target: $400
 12% 

Solved AddToFullPack - Solid Prediction


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 08-03-2017 , 17:36   AddToFullPack - Solid Prediction
Reply With Quote #1

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; }
__________________

Last edited by gabuch2; 08-04-2017 at 20:37.
gabuch2 is online now
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 08-04-2017 , 00:56   Re: AddToFullPack - Solid Prediction
Reply With Quote #2

Change hook to post and remove overriding.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 08-04-2017 , 04:50   Re: AddToFullPack - Solid Prediction
Reply With Quote #3

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.....
__________________


Last edited by NiHiLaNTh; 08-04-2017 at 04:50.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 08-04-2017 , 20:28   Re: AddToFullPack - Solid Prediction
Reply With Quote #4

Quote:
Originally Posted by NiHiLaNTh View Post
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@ View Post
Change hook to post and remove overriding.
__________________

Last edited by gabuch2; 08-04-2017 at 20:37.
gabuch2 is online now
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:41.


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