Raised This Month: $ Target: $400
 0% 

set_user_maxspeed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pontu$
Junior Member
Join Date: Nov 2009
Location: Sweden
Old 08-20-2010 , 08:09   set_user_maxspeed
Reply With Quote #1

how to set_user_maxspeed ?

set_user_maxspeed(index, Float:speed) i CurWeapon, get_pcvar_num(pcvarSpeed))


Thanks!
Pontu$ is offline
Send a message via MSN to Pontu$
Ryokin
Senior Member
Join Date: Jan 2010
Old 08-20-2010 , 08:25   Re: set_user_maxspeed
Reply With Quote #2

this was asked many time, you should learn to search more
__________________
NH4CL + NaOH -> NH3 + H2O + NaCL
Ryokin is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-20-2010 , 09:15   Re: set_user_maxspeed
Reply With Quote #3

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

#define MAX_SPEED 300.0

public plugin_init()
    
register_event("CurWeapon""Event_CurWeapon""be");
    
public 
Event_CurWeapon(id)
{
    if(
is_user_alive(id))
        
set_user_maxspeed(idMAX_SPEED);

__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 08-20-2010 , 09:32   Re: set_user_maxspeed
Reply With Quote #4

Quote:
Originally Posted by drekes View Post
PHP Code:
#include <amxmodx>
#include <fun>

#define MAX_SPEED 300.0

public plugin_init()
    
register_event("CurWeapon""Event_CurWeapon""be");
    
public 
Event_CurWeapon(id)
{
    if(
is_user_alive(id))
        
set_user_maxspeed(idMAX_SPEED);

It is good but not the best!
Here it is:
PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>

#define Ham_Player_ResetMaxSpeed    Ham_Item_PreFrame

#define MAX_SPEED 300.0

public plugin_init()
    
RegisterHam(Ham_Player_ResetMaxSpeed,"player","pfw_resetmaxspeed",1)

public 
pfw_resetmaxspeed(id)
{
    
//set_user_maxspeed(id, MAX_SPEED)
    
set_user_maxspeed(idget_user_maxspeed(id) * 2// Make user run 2 times faster!

__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-20-2010 , 10:33   Re: set_user_maxspeed
Reply With Quote #5

Can you give a little more info about Ham_Item_PreFrame and why you use the Ham_Player_ResetMaxSpeed define?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-20-2010 , 10:36   Re: set_user_maxspeed
Reply With Quote #6

http://forums.alliedmods.net/showpos...2&postcount=11
__________________
Arkshine is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 08-20-2010 , 10:37   Re: set_user_maxspeed
Reply With Quote #7

Quote:
Originally Posted by drekes View Post
Can you give a little more info about Ham_Item_PreFrame and why you use the Ham_Player_ResetMaxSpeed define?
It is a method found by Quim. Item_PreFrame is a forward made specially for items, I haven't tested on them so I don't know what purpose they have.
But when ran on players it takes place exactly when speed is updated on player.
So basically registering this as a forward on a player entity and as post. You have exactly the moment when the player speed changes and also you obtain the speed of the player. That is why I made the second name RESETMAXSPEED.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 08-20-2010 , 10:46   Re: set_user_maxspeed
Reply With Quote #8

Would we still need to check if players are alive or not?
__________________
It's a mystery.
Mini_Midget is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-20-2010 , 10:46   Re: set_user_maxspeed
Reply With Quote #9

Awesome, thanks guys
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 08-20-2010 , 10:48   Re: set_user_maxspeed
Reply With Quote #10

From what I know. And seeing the Quim's code it isn't needed.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 08-20-2010 at 10:54.
ot_207 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 21:56.


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