Raised This Month: $ Target: $400
 0% 

Movement


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zombieplague
Veteran Member
Join Date: Apr 2009
Old 07-06-2010 , 06:22   Movement
Reply With Quote #1

What is the proper way of setting a player speed ? Currently, I'm using Prethink I wonder if it will lag using that ??
zombieplague is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 07-06-2010 , 06:34   Re: Movement
Reply With Quote #2

Quote:
Originally Posted by zombieplague View Post
What is the proper way of setting a player speed ? Currently, I'm using Prethink I wonder if it will lag using that ??
use cur weapon
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
zombieplague
Veteran Member
Join Date: Apr 2009
Old 07-06-2010 , 10:31   Re: Movement
Reply With Quote #3

Quote:
Originally Posted by shuttle_wave View Post
use cur weapon
Can you show me how ?
zombieplague is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 07-06-2010 , 11:40   Re: Movement
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <fun>

#pragma semicolon 1

new cvar_speed;

public 
plugin_init()
{
    
register_plugin("Speed example""1.0""Drekes");
    
    
register_event("CurWeapon""Event_CurWeapon""be","1=1");
    
    
cvar_speed register_cvar("amx_runspeed""400.0");
}

public 
Event_CurWeapon(id)
{
    if(
is_user_alive(id))
        
set_user_maxspeed(idget_pcvar_float(cvar_speed));

Not tested, but should work
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 07-06-2010 , 12:50   Re: Movement
Reply With Quote #5

PHP Code:
public Event_CurWeapon(id)
{
    if(
is_user_alive(id))
        
set_user_maxspeed(idget_pcvar_float(cvar_speed));



PHP Code:
public Event_CurWeaponclient )
{
    if( 
get_cvar_float"sv_maxspeed" ) > get_pcvar_floatcvar_speed ) )
        
set_cvar_float"sv_maxspeed"cvar_speed );
    
    if( 
is_user_aliveclient ) )
        
set_user_maxspeedclientget_pcvar_floatcvar_speed ) );

Remember, if maxspeed is lower than the speed you set up - player will remain at speed of sv_maxspeed ;)
Lure.d is offline
Send a message via Skype™ to Lure.d
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 07-06-2010 , 12:55   Re: Movement
Reply With Quote #6

Quote:
Originally Posted by Lure.d View Post
PHP Code:
public Event_CurWeapon(id)
{
    if(
is_user_alive(id))
        
set_user_maxspeed(idget_pcvar_float(cvar_speed));



PHP Code:
public Event_CurWeaponclient )
{
    if( 
get_cvar_float"sv_maxspeed" ) > get_pcvar_floatcvar_speed ) )
        
set_cvar_float"sv_maxspeed"cvar_speed );
    
    if( 
is_user_aliveclient ) )
        
set_user_maxspeedclientget_pcvar_floatcvar_speed ) );

Remember, if maxspeed is lower than the speed you set up - player will remain at speed of sv_maxspeed ;)
I didn't know that, thanks for fixing it
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 07-06-2010 , 13:44   Re: Movement
Reply With Quote #7

If you only want it for a specific weapon, you're better of using Ham_Item_Deploy.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
zombieplague
Veteran Member
Join Date: Apr 2009
Old 07-07-2010 , 03:13   Re: Movement
Reply With Quote #8

Can't i use Prethink ?
zombieplague is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 07-07-2010 , 03:26   Re: Movement
Reply With Quote #9

No one said you can't.
It's just that PreThink is called 30 times a second or something like that.
__________________
It's a mystery.
Mini_Midget 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 07:07.


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