AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   increased speed decreasing when picking weapons (https://forums.alliedmods.net/showthread.php?t=187459)

CarbonDioxide 06-13-2012 12:06

increased speed decreasing when picking weapons
 
Hi all.
I have this with which sets a players maxspeed with success:
PHP Code:

set_user_maxspeed(id450.0

My problem is that when I pick a weapon up the player's speed resets back to 250.
I have tried making a code to prevent that from happening, but I don't know how to trigger that so it executes whne the player picks a weapon up.

The code:
PHP Code:

public asp_bug_fix(id)
{
    if(
SpeedEnabled[id])
    {
        
set_user_maxspeed(id450.0)
    }


Does anyone know how to trigger it with hamsandwich ?? Thank you in advance :)

Alekkkk 06-13-2012 12:10

Re: increased speed decreasing when picking weapons
 
Do it in event current weapon..

<VeCo> 06-13-2012 12:11

Re: increased speed decreasing when picking weapons
 
It's better to use Ham_Item_PreFrame.

CarbonDioxide 06-13-2012 12:21

Re: increased speed decreasing when picking weapons
 
Ham_Item_PreFrame worked ! Ty alot :)

Liverwiz 06-13-2012 12:24

Re: increased speed decreasing when picking weapons
 
a client's maxspeed changes for every weapon. Because every weapon has a different weight, and thus the engine wants to reflect that in the entity's motion. Do as stated above and set it at every CurWeapon, or Ham_Item_PreFrame. Whichever's clever.
This was stated in the set_user_maxspeed's documentation on the wiki, if you read it.


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

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