Hello, I am making (or creating) a plugin. It has lots of line more than 3000.
So I've gotta be careful to use correct codes. Firstly, I am using this includes;
1) I want to delete hamsandwich. Because I don't like using hamsandwich.
I want to change it to fakemeta or reapi module. (I know reapi is not supported here)
Here are what I want to change
ExecuteHamB(Ham_CS_RoundRespawn, Uid) // could I use spawn(id) instead of this?
set_pdata_int(get_pdata_cbase(id, 373), 51, g_MaxClipAmmo[read_data(2)], 4) //get_pdata_cbase will be changed
2) FM_Touch
Actually, It's not problem to use fm_touch. But I am not sure about it's the best.
What I should use in these codes?
Spoiler
PHP Code:
register_forward(FM_Touch, "Forward_Touch") register_touch("player", "player", Forward_Touch") RegisterHam(Ham_Touch, "player", "Forward_Touch") // I hope this is not :)
3) set_lights
I don't use this due to I don't use engine include. So I use it usually.
I have a code I've just heard. Should I use this code instead of set_lights
First of all script lines dosent matter how much they are.. You might have 3k lines can be optimized into 1000 line..
Second of all there is no lame using hamsandwich. Beside its the best module for dealing with entites..
Hooking register_touch is the best choice because the forward will be called just when every two players touch
About set lights both the same except you are calling a stock then calling to set the lights
About find entity by model
You need to loop throw all entities using engfunc_findentbystring theres alot of tutorials if you just search!
I have thought so much about using register_touch.
It's in engine include but I just use fakemeta, reapi and %60 hamsandwich.
If I use FM_Think instead, Would I see any inequality?
And I am using this but I couldn't find what is default for it.
If I have made it "#OFF". I saw it was too bright.
Don't try to remove a module just to reduce the number of modules. In many cases, you will end up writing worse/less efficient code if you do it for this reason.
Okay. I started using engine. I use "find_ent_by_owner & set_lights etc."
I have done my plugin. But If I bury players, they can unbury while pressing "Ctrl + Space".
Can I block using IN_DUCK and IN_JUMP while the player stucked & buried?
Thanks for helping