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

[Suggestions] AMXX 1.8.3


Post New Thread Reply   
 
Thread Tools Display Modes
Depresie
Veteran Member
Join Date: Nov 2013
Old 01-10-2017 , 09:46   Re: [Suggestions] AMXX 1.8.3
Reply With Quote #21

Quote:
Having a native to do it doesn't prevent race conditions like this.
Yes, it does, because it will set the last custom speed instead of the speed value set in the last plugin loaded

Quote:
Not all stocks should be converted to natives. If you think all your stocks should be natives for efficiency then maybe you should expect everyone to write MetaMod plugins and ditch AMX Mod X entirely.
I agree here, but such stocks that are used pretty often should, it's not about the efficiency, it's more about the accessibility and the ease of use, which is one of the main reasons why there is amxmodx
__________________
Depresie is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-10-2017 , 19:27   Re: [Suggestions] AMXX 1.8.3
Reply With Quote #22

Quote:
Originally Posted by Depresie View Post
Yes, it does, because it will set the last custom speed instead of the speed value set in the last plugin loaded
Perhaps you should review the definition of a race condition. As far as I can tell, you can't prevent a race condition when setting a parameter like this without properly implementing the code in both plugins (a native wouldn't solve this). Granted, I'm sure there are some cases where it won't be possible at all.

You'll need to be more specific about what your two plugins are doing for me to better understand how you might use this functionality. If you already posted this, you can PM the link to the post.


Quote:
Originally Posted by Depresie View Post
I agree here, but such stocks that are used pretty often should, it's not about the efficiency, it's more about the accessibility and the ease of use, which is one of the main reasons why there is amxmodx
Accessibility and ease of use are not good reasons to add something to an API if they can easily be constructed using existing API functions. I.e. functions derived from other functions are effectively just macros.

If you find that you use a particular function often then you should create your own custom include that you can use in your plugins.
__________________

Last edited by fysiks; 01-10-2017 at 19:28.
fysiks is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 01-11-2017 , 14:30   Re: [Suggestions] AMXX 1.8.3
Reply With Quote #23

The only way to set and reset the speed properly is to set it on ham deploy
But in case you want to change the speed of the players in two separate plugins, the speed value that will be set to the player will be the one from the second plugin instead of the one set last time

If we are still on the topic, i'd like to suggest including gag function included in the amxx plugin package

Updated main post, removed couple suggestions, added one more
__________________
Depresie is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-11-2017 , 15:05   Re: [Suggestions] AMXX 1.8.3
Reply With Quote #24

Quote:
Originally Posted by Depresie View Post
The only way to set and reset the speed properly is to set it on ham deploy
What's wrong with Ham_CS_Player_ResetMaxSpeed and Ham_CS_Item_GetMaxSpeed?
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Depresie
Veteran Member
Join Date: Nov 2013
Old 01-11-2017 , 15:25   Re: [Suggestions] AMXX 1.8.3
Reply With Quote #25

The problem is when they are used in more than two plugins..

Let's say i set to the player a custom speed now from the last loaded plugin
After 1 minute i set the player another custom speed from the first loaded plugin
The player's speed will be the one that have been set first, instead of the speed set last time
__________________

Last edited by Depresie; 01-11-2017 at 15:27.
Depresie is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-11-2017 , 15:35   Re: [Suggestions] AMXX 1.8.3
Reply With Quote #26

Quote:
Originally Posted by Depresie View Post
The problem is when they are used in more than two plugins..
But why Ham_Item_Deploy is better (or why you suggest it instead of them)?
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Depresie
Veteran Member
Join Date: Nov 2013
Old 01-12-2017 , 06:34   Re: [Suggestions] AMXX 1.8.3
Reply With Quote #27

Confusion probably.. my bad..
__________________
Depresie is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 01-12-2017 , 07:42   Re: [Suggestions] AMXX 1.8.3
Reply With Quote #28

Quote:
Originally Posted by Depresie View Post
Let's say i set to the player a custom speed now from the last loaded plugin
After 1 minute i set the player another custom speed from the first loaded plugin
The player's speed will be the one that have been set first, instead of the speed set last time
The player's speed is not something you set "once" and then abandon.
You need to be constantly updating the value as the engine attempts to set the default speed in different scenarios (such as changing weapon).

The behavior you're describing there is fine, nothing wrong with it. I'm assuming you think it's wrong because usually plugins loaded earlier have authority but in this case it's about who sets the speed the last, therefore it's the other way around.(last loaded will always set the speed assuming multiple plugins use Ham_Player_ResetMaxSpeed and none of them SUPERCEDE it).

There should never be a scenario where two plugins are attempting to maintain different speeds in the first place. It's about as stupid as two plugins trying to set weapon models at the same time. Same thing, last loaded plugin will overwrite the model set by the first just as speed is overwritten here.
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-12-2017 , 07:45   Re: [Suggestions] AMXX 1.8.3
Reply With Quote #29

It looks like you could simply use xvars to solve the "big issue", if you don't want to create an API for checking what plugin should apply the speed.
__________________
HamletEagle is offline
metal_upa
Senior Member
Join Date: Jun 2016
Old 01-12-2017 , 12:38   Re: [Suggestions] AMXX 1.8.3
Reply With Quote #30

Quote:
Originally Posted by Depresie View Post
Confusion probably.. my bad..
The problem is your code itself.
Thats why cs_set_player_speed API existed. You just need to set it properly and change the plugin order correctly in plugins.ini

From my experience, Ham_Item_Preframe post is smoothly compare to Ham_CS_Player_ResetMaxSpeed post. I dont know why but the cs_player_resetmaxspeed makes my movement a bit laggy, the same code applied.

For the best result i think amxmodx1.8.3 dev should support regamedll,rehlds,reapi completely.

Last edited by metal_upa; 01-12-2017 at 12:48.
metal_upa is offline
Reply


Thread Tools
Display Modes

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 17:12.


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