AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How do I reset a users speed? (https://forums.alliedmods.net/showthread.php?t=28106)

Geesu 05-07-2006 10:56

How do I reset a users speed?
 
I tried using set_user_maxspeed( id );

So the second value would just default to -1.0, but the player cant move... its like i start to move but then move back to my position its weird, is anyone else having this problem?

wouter 05-07-2006 11:01

isn't the normal speed 320?

cant you do:
Code:
 new Speed[]  get_user_maxspeed(id, Speed)  set_user_maxspeed(id, Speed)

Hawk552 05-07-2006 11:59

Quote:

Originally Posted by wouter
isn't the normal speed 320?

cant you do:
Code:
 new Speed[]  get_user_maxspeed(id, Speed)  set_user_maxspeed(id, Speed)

What?

My guess is that you're setting the speed in an event like CurWeapon or something like that.

Sneakpeek 05-07-2006 12:08

I think what wouter ment, which I also do in my plugin:
Before you actually change the persons speed somewhere in your plugin, save their normal speed to a variable.
Code:
//on top of the plugin because it gotta be global new NormalSpeed[33]   //somewhere else NormalSpeed[id] = get_user_maxspeed(id) set_user_maxspeed(id, what ever you want) //and when you want to reset it you just do this set_user_maxspeed(id, NormalSpeed[id])

Geesu 05-07-2006 12:13

Quote:

Originally Posted by Hawk552
Quote:

Originally Posted by wouter
isn't the normal speed 320?

cant you do:
Code:
 new Speed[]  get_user_maxspeed(id, Speed)  set_user_maxspeed(id, Speed)

What?

My guess is that you're setting the speed in an event like CurWeapon or something like that.

this is correct :P But at times I need to "reset" the maxspeed to not listen to my value...

i.e.

I set their speed to 320 while they're holding shield
I now want to reset it...
They make shield "hidden", but they have movespeed of 320 b/c this didn't fire CurWeapon..

See what i mean? I need to be able to like set it to what it should be :/

Ramono 05-07-2006 14:10

set_user_maxspeed(index,0.0)

0.0 = default
1.0 = stop user

VEN 05-07-2006 14:17

AFAIK, 250.0 is the default value.

Peli 05-07-2006 15:56

Make sure you have the real default:
Code:
set_user_maxspeed(id, 320.0)

wouter 05-07-2006 15:59

i dont think there is a real default, it depends from the server max speed and the client max speed, and some plugins change both of them...

Peli 05-07-2006 16:03

Quote:

Originally Posted by wouter
i dont think there is a real default, it depends from the server max speed and the client max speed, and some plugins change both of them...

Yes but, this is the default as in if you don't modify anything, this is the default. Don't really get what he's trying to do... Do you mean CurWeapon event doesn't work when you try it to set the speed when they switch from weapon to shield?


All times are GMT -4. The time now is 05:08.

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