Need help on understanding the coding of a plugin
Hi ,
I am a learner . I try to read many source code of plugins . I was going through one code but I can't understand a bit of it :( . Please help . The plugin url http://forums.alliedmods.net/showthread.php?p=597185 The part I can't understand stock fm_find_ent_by_owner(index, const classname[], owner, jghgtype = 0) { new strtype[11] = "classname", ent = index switch (jghgtype) { case 1: strtype = "target" case 2: strtype = "targetname" } while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner) {} return ent } |
Re: Need help on understanding the coding of a plugin
It finds an entity of "classname" that is owned by "owner". Also, I believe the search starts at "index".
|
Re: Need help on understanding the coding of a plugin
It is a fakemeta conversion of Engine's find_ent_by_owner() function.
|
Re: Need help on understanding the coding of a plugin
Quote:
|
Re: Need help on understanding the coding of a plugin
so can i block a firing completely with this function ?
|
Re: Need help on understanding the coding of a plugin
Quote:
|
Re: Need help on understanding the coding of a plugin
Quote:
|
Re: Need help on understanding the coding of a plugin
Quote:
You have to understand what the code does by knowing what specific functions do. |
Re: Need help on understanding the coding of a plugin
If a player buys or picks up a weapon, he becomes the owner of that weapon.
The player's id gets assigned to pev_owner of the weapon. What that stock does is go through all the weapons & check if the weapon belongs to the id that is passed as the thirth param of the function. It are these that change the fire rate. PHP Code:
|
Re: Need help on understanding the coding of a plugin
Quote:
|
| All times are GMT -4. The time now is 23:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.