AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Limit player velocity (https://forums.alliedmods.net/showthread.php?t=318898)

mrshark45 09-27-2019 17:40

Limit player velocity
 
Hey, I want to limit the velocity for some players, but not all, exactly like sv_maxvelocity , but only for some players, how can I achieve that?

JocAnis 09-27-2019 21:27

Re: Limit player velocity
 
Choose your max velocity of the player...if he got more velocity than THAT, make his velocity THAT..in player think probably

mrshark45 09-28-2019 06:41

Re: Limit player velocity
 
Quote:

Originally Posted by JocAnis (Post 2668233)
Choose your max velocity of the player...if he got more velocity than THAT, make his velocity THAT..in player think probably

how?

Natsheh 09-28-2019 07:47

Re: Limit player velocity
 
You want to limit player speed or player velocity?

mrshark45 09-28-2019 08:11

Re: Limit player velocity
 
Quote:

Originally Posted by Natsheh (Post 2668257)
You want to limit player speed or player velocity?

player velocity, like sv_maxvelocity

mrshark45 12-15-2019 13:32

Re: Limit player velocity
 
If anyone still needs it, I figured it out:
PHP Code:

public limit_user_velocity(idvalue){
    new 
Float:velocity[3], Float:xFloat:y;
    
get_user_velocity(idvelocity);
    new 
Float:speed floatsqroot(floatpower(velocity[0],2.0) + floatpower(velocity[1],2.0));
    if(
speed value){
        
velocity[0]/speed;
        
velocity[1]/speed;
        
velocity[0] = value;
        
velocity[1] = value;
    }
    
set_user_velocity(idvelocity);
    return 
PLUGIN_CONTINUE;



mrshark45 12-19-2019 13:52

Re: Limit player velocity
 
Can you mark it as solved?

OciXCrom 12-19-2019 14:08

Re: Limit player velocity
 
Quote:

Originally Posted by mrshark45 (Post 2677452)
Can you mark it as solved?

You're the one who can mark it. Edit your thread -> Go advanced -> add the "Solved" prefix.

mrshark45 12-19-2019 14:15

Re: Limit player velocity
 
Quote:

Originally Posted by OciXCrom (Post 2677454)
You're the one who can mark it. Edit your thread -> Go advanced -> add the "Solved" prefix.

Thanks


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

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