AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] Really best way to set max speed? (https://forums.alliedmods.net/showthread.php?t=262912)

xEhsaan 05-15-2015 10:48

[SOLVED] Really best way to set max speed?
 
Hi there all,

I'm so confused about all methods those are available for setting a player max speed.
Well, the usual way is this:
PHP Code:

//required fun module
set_user_maxspeedid, ... ); 

But it does require to reset the speed again when weapon changes.

I heart some experts advising use Ham_Reset_Maxspeed. I searched but didn't find anything directly about this.

Now my question is: What's the best way to set max speed and how to it?

Thanks.
P.S.: Searched a lot
P.P.S: Searched a lot again

Neeeeeeeeeel.- 05-15-2015 11:00

Re: Really best way to set max speed?
 
You didn't search a lot

PHP Code:

new Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame;

public 
plugin_init(){
    
RegisterHam(Ham_Player_ResetMaxSpeed,"player","playerResetMaxSpeed"1)
}

public 
playerResetMaxSpeed(id){
    
set_user_maxspeed(id300.0);



xEhsaan 05-15-2015 11:06

Re: Really best way to set max speed?
 
Umm, I saw that code, but how can I make the speed default?

Neeeeeeeeeel.- 05-15-2015 14:26

Re: Really best way to set max speed?
 
http://www.amxmodx.org/doc/index.htm...r_maxspeed.htm

wickedd 05-15-2015 16:59

Re: Really best way to set max speed?
 
For future reference use this site.

xEhsaan 05-15-2015 23:44

Re: Really best way to set max speed?
 
I tried this:
PHP Code:

set_user_maxspeedid ); // to return to default 

But it just freezes the player.

indraraj striker 05-16-2015 14:29

Re: Really best way to set max speed?
 
i think so normal speed is 240
just remove the task and set max speed to 240

Nextra 05-16-2015 15:12

Re: Really best way to set max speed?
 
Quote:

Originally Posted by xEhsaan (Post 2297203)
I tried this:
PHP Code:

set_user_maxspeedid ); // to return to default 

But it just freezes the player.

That does not reset to default and is expected behavior. You can simply tell the game to reset the max speed by calling ExecuteHamB(Ham_CS_Player_ResetMaxSpeed, client). Obviously you need to make sure your own Ham_CS_Player_ResetMaxSpeed hook does not overwrite the value again.

xEhsaan 05-16-2015 15:23

Re: Really best way to set max speed?
 
Ohhh, finally a working way, Thanks a lot.

Neeeeeeeeeel.- 05-18-2015 10:59

Re: Really best way to set max speed?
 
Quote:

Originally Posted by indraraj striker (Post 2297490)
i think so normal speed is 240
just remove the task and set max speed to 240

The default speed depends on the weapon you are carring... so a hardcoded value won't work.


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

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