Raised This Month: $ Target: $400
 0% 

[HELP] Speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 08-29-2012 , 17:45   [HELP] Speed
Reply With Quote #1

Hi, i need some help...
It works fine, but when change weapon or new round, speed stop works...
It have health and speed. Health works good.

Code:
#include < amxmodx >
#include < hamsandwich >
#include < cstrike >
#include < fun >
 
enum _: Health
{
 Terro ,
 Anti
};
enum _: Maxspeed
{
 Terro ,
 Anti
};
new g_pCvarHealthTeam[ Health ];
new g_pCvarMaxspeedTeam[ Maxspeed ];
public plugin_init( )
{
 register_plugin( "PLUGIN" , "VERSION" , "AUTHOR" );
 
 RegisterHam( Ham_Spawn , "player" , "Fw_HamSpawn" , true );
 
 g_pCvarHealthTeam[ Terro ] = register_cvar( "health_terro" , "99" );
 g_pCvarHealthTeam[ Anti ] =  register_cvar( "health_anti" , "99" );
 g_pCvarMaxspeedTeam[ Terro ] = register_cvar( "maxspeed_terro" , "500" );
 g_pCvarMaxspeedTeam[ Anti ] =  register_cvar( "maxspeed_anti" , "500" );
}
public Fw_HamSpawn( id )
{
 if( is_user_alive( id ) )
 {
  switch( cs_get_user_team( id ) )
  {
   case CS_TEAM_CT:
   {
    set_user_health( id , get_pcvar_num( g_pCvarHealthTeam[ Anti ] ) );
    set_user_maxspeed( id , get_pcvar_float( g_pCvarMaxspeedTeam[ Anti ] ) );
   }
   case CS_TEAM_T:
   {
    set_user_health( id , get_pcvar_num( g_pCvarHealthTeam[ Terro ] ) );
    set_user_maxspeed( id , get_pcvar_float( g_pCvarMaxspeedTeam[ Terro ] ) );
   }
  }
 }
 return 0;
}

EDIT:
Speed isnt working as i want, i changed cvar to 900 but didnt worked as 900 speed
HELP NEEDING

Last edited by Jhob94; 08-29-2012 at 17:50.
Jhob94 is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 08-29-2012 , 18:24   Re: [HELP] Speed
Reply With Quote #2

speed resets with each weapon. Hook CurWeapon and set it there.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 08-29-2012 , 18:35   Re: [HELP] Speed
Reply With Quote #3

I tried this on other version i did of this code and it didnt worked too :S

Last edited by Jhob94; 08-29-2012 at 18:35.
Jhob94 is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 08-29-2012 , 22:12   Re: [HELP] Speed
Reply With Quote #4

Quote:
Originally Posted by Liverwiz View Post
speed resets with each weapon. Hook CurWeapon and set it there.
NO

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

#define PLUGIN "Reset MaxSpeed"
#define VERSION "1.0"
#define AUTHOR "[R]ak"

new Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

new g_FreezeTime

public plugin_init() {
    
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_new_round""a""1=0""2=0")
    
    
register_logevent("logevent_round_start"2"1=Round_Start")
    
    
RegisterHam(Ham_Player_ResetMaxSpeed"player""fw_Player_ResetMaxSpeed"1)
}

public 
event_new_round()
    
g_FreezeTime true
    
public logevent_round_start()
    
g_FreezeTime false
    
public fw_Player_ResetMaxSpeed(id)
    if(!
g_FreezeTime)
        
set_user_maxspeed(id500.0
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 08-30-2012 , 05:09   Re: [HELP] Speed
Reply With Quote #5

Thanks
Jhob94 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 05:44.


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