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

Advanced Parachute


Post New Thread Reply   
 
Thread Tools Display Modes
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 04-25-2015 , 18:22   Re: Parachute 2015 v0.0.6
Reply With Quote #41

Saving the entid on a global variable is really a baaaad idea.

The entid change on every round. If the var keeps the old entid value, you can crash the server by removing a different entity just because now, that value it's another entity not related to the parachute.

Think about that and use find_ent_by_owner.

It's unusual the crash, but it can happen.


I saw a lot of plugins codes like that way, so don't give me examples about other plugins, they're bad coded...

Last edited by baneado; 04-25-2015 at 18:27.
baneado is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 04-25-2015 , 18:56   Re: Parachute 2015 v0.0.6
Reply With Quote #42

Quote:
Originally Posted by baneado View Post
Saving the entid on a global variable is really a baaaad idea.

The entid change on every round. If the var keeps the old entid value, you can crash the server by removing a different entity just because now, that value it's another entity not related to the parachute.

Think about that and use find_ent_by_owner.

It's unusual the crash, but it can happen.


I saw a lot of plugins codes like that way, so don't give me examples about other plugins, they're bad coded...
Thanks for bringing this to my attention. I'll look into it when I get home tonight.

Update v0.0.7 - 26/04/2015 12:12 PM
- Removed g_iPara_Ent global variable, Replaced with find_ent_by_owner.
__________________

Last edited by Blizzard_87; 04-25-2015 at 22:23.
Blizzard_87 is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 04-26-2015 , 19:34   Re: Parachute 2015 v0.0.7
Reply With Quote #43

Sometimes the parachute is not active when i respawn and I dont have errors in logs..

Last edited by wicho; 04-26-2015 at 19:50.
wicho is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 04-26-2015 , 20:17   Re: Parachute 2015 v0.0.7
Reply With Quote #44

Quote:
Originally Posted by wicho View Post
Sometimes the parachute is not active when i respawn and I dont have errors in logs..
What do you mean "not active" when you respawn?
__________________
Blizzard_87 is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 04-26-2015 , 23:34   Re: Parachute 2015 v0.0.7
Reply With Quote #45

Holy shit, please remove that 'find_ent_by_owner',

The check is done every 0.1 (I dunno), but alot, wich eats ur server alive lol..
There was no problem, resetting on spawn and so, was all fine.
__________________
Retired.

Last edited by Xalus; 04-26-2015 at 23:35.
Xalus is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 04-27-2015 , 00:58   Re: Parachute 2015 v0.0.7
Reply With Quote #46

Quote:
Originally Posted by Xalus View Post
Holy shit, please remove that 'find_ent_by_owner',

The check is done every 0.1 (I dunno), but alot, wich eats ur server alive lol..
There was no problem, resetting on spawn and so, was all fine.
Really. I didn't realise is was that bad.

Will reverse the change.
__________________
Blizzard_87 is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 04-27-2015 , 08:39   Re: Parachute 2015 v0.0.7
Reply With Quote #47

Quote:
Originally Posted by Xalus View Post
Holy shit, please remove that 'find_ent_by_owner',

The check is done every 0.1 (I dunno), but alot, wich eats ur server alive lol..
There was no problem, resetting on spawn and so, was all fine.
LOL for you. RemoveParachute function can crash the server at player Spawn, I'm sure.

I didn't see how he had changed the code, but I do it now myself (not tested yet)
Attached Files
File Type: sma Get Plugin or Get Source (parachute_2015.sma - 483 views - 4.9 KB)

Last edited by baneado; 04-27-2015 at 08:46.
baneado is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 04-27-2015 , 09:55   Re: Parachute 2015 v0.0.7
Reply With Quote #48

Quote:
Originally Posted by baneado View Post
LOL for you. RemoveParachute function can crash the server at player Spawn, I'm sure.

I didn't see how he had changed the code, but I do it now myself (not tested yet)
Ive fixed RemoveParachute by resetting the variable back to 0 for the player.

as my code now resets the variable to 0 on spawning, i can not see how it would crash as players are unable to execute the parachute while on ground or touching a ladder. so there is no way a parachute entity can be created at spawn, and if player jumps then presses E it creates a new one thru giving a new entity number since when spawning it gets reset anyway.

Plus, i cant reproduce this crash you talk about. sorry.
__________________
Blizzard_87 is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 04-27-2015 , 13:04   Re: Parachute 2015 v0.0.7
Reply With Quote #49

Quote:
Originally Posted by baneado View Post
LOL for you. RemoveParachute function can crash the server at player Spawn, I'm sure.

I didn't see how he had changed the code, but I do it now myself (not tested yet)
A pev_valid (and if wanted a classname check), would be way more efficient!
__________________
Retired.
Xalus is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 04-28-2015 , 09:25   Re: Parachute 2015 v0.0.8
Reply With Quote #50

Quote:
Originally Posted by Blizzard_87 View Post
Ive fixed RemoveParachute by resetting the variable back to 0 for the player.

as my code now resets the variable to 0 on spawning, i can not see how it would crash as players are unable to execute the parachute while on ground or touching a ladder. so there is no way a parachute entity can be created at spawn, and if player jumps then presses E it creates a new one thru giving a new entity number since when spawning it gets reset anyway.

Plus, i cant reproduce this crash you talk about. sorry.
No, you didn't fix it, you remove entity and then reset the var ._.

I said it's a unusual crash (once a three days-week ?), but anyways it can happen.

Quote:
Originally Posted by Xalus View Post
A pev_valid (and if wanted a classname check), would be way more efficient!
pev_valid, yes, and you might remove an other entity too, but without crash I'm think.

classname, yes, but if the classname it isn't "parachute", the real parachute entity wouldn't be removed.

More efficient? What is the problem to use find_ent_by_owner two times?? I really don't understand to you.

Anyways I combine two codes to use find_ent_by_owner only one time. Not tested.
Attached Files
File Type: sma Get Plugin or Get Source (parachute_2015.sma - 445 views - 4.8 KB)

Last edited by baneado; 04-28-2015 at 09:27.
baneado is offline
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 13:16.


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