Raised This Month: $ Target: $400
 0% 

set user maxspeed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tonda
Senior Member
Join Date: Aug 2009
Old 10-23-2010 , 03:50   set user maxspeed
Reply With Quote #1

Hi, i have menu. In the menu is TAKE SPEED. After this you have speed better (500.0) But ... if you switch weapon, your speed is normal .. Why? I want speed everytime if you have menu and if your choice SPEED
Tonda is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-23-2010 , 03:52   Re: set user maxspeed
Reply With Quote #2

Quote:
Originally Posted by Tonda View Post
Why?
Reasons are already explained on the forum, search.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-23-2010 , 04:23   Re: set user maxspeed
Reply With Quote #3

yeah ... its already been explained , u have to do it using cur weapon ... use search as connor said
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
Schwabba
Senior Member
Join Date: Apr 2008
Old 10-23-2010 , 11:13   Re: set user maxspeed
Reply With Quote #4

PHP Code:
register_event("CurWeapon""HookCurWeapon""be""1=1" ); 
PHP Code:
public HookCurWeaponid )
{
    if(
iSpeed[id])
    {
        
set_user_maxspeed(id1000.0);
    }

Schwabba is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-23-2010 , 12:04   Re: set user maxspeed
Reply With Quote #5

Quote:
Originally Posted by Schwabba View Post
PHP Code:
register_event("CurWeapon""HookCurWeapon""be""1=1" ); 
PHP Code:
public HookCurWeaponid )
{
    if(
iSpeed[id])
    {
        
set_user_maxspeed(id1000.0);
    }

Gonna work but is not the best method, to keep the same maxspeed whatever the weapon, better to hook ResetMaxSpeed.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 10-23-2010 , 12:44   Re: set user maxspeed
Reply With Quote #6

Yes, hook ResetMaxSpeed and then set maxspeed with set_pev not set_user_maxspeed
reinert is offline
gladius
Veteran Member
Join Date: Jul 2008
Location: Santiago, Chile
Old 10-23-2010 , 12:55   Re: set user maxspeed
Reply With Quote #7

you can see this

http://forums.alliedmods.net/showpos...2&postcount=11
__________________
Proyects
Kreedz Chile Mod [100%] (Fixing some details).

gladius is offline
Send a message via MSN to gladius Send a message via Skype™ to gladius
issen1
Member
Join Date: Jan 2010
Old 10-23-2010 , 13:22   Re: set user maxspeed
Reply With Quote #8

Quote:
Originally Posted by reinert View Post
Yes, hook ResetMaxSpeed and then set maxspeed with set_pev not set_user_maxspeed
Can you explain why?
__________________
greets (:
issen1 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-23-2010 , 15:33   Re: set user maxspeed
Reply With Quote #9

It's quite the same to use set_user_maxspeed.

Here's the snippet.

Check if user is alive so you don't alter spectator speed, and check if maxspeed is not 1.0 so you don't allow players to move during freezetime :

PHP Code:
#include <amxmodx>
#include <engine>
#include <hamsandwich>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

#define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

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

public 
playerResetMaxSpeed(id)
{
    if( 
is_user_alive(id) && entity_get_float(idEV_FL_maxspeed) != 1.0 )
    {
        
entity_set_float(idEV_FL_maxspeed1000.0)
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Tonda
Senior Member
Join Date: Aug 2009
Old 10-28-2010 , 04:25   Re: set user maxspeed
Reply With Quote #10

OK Connor, your method is fine and worked, but if i set maxspeed 700, and player push W (forward) he have speed maybe 400-500? And if he push W+A or W+D (forward+move left(strafe) or forward+move right(strafe) after this he have speed 700, but only forward dont work 700 speed.
Tonda is offline
Reply



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 10:21.


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