Raised This Month: $ Target: $400
 0% 

Spawn with speed change


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 12-27-2006 , 03:50   Spawn with speed change
Reply With Quote #1

I'm having problems making zombies(terrorists) spawn with a speed increase.
PHP Code:
new zomb_speed
public plugin_init() {
    
register_plugin(PLUGIN"2.0a"AUTHOR)
    
    
register_event("CurWeapon","event_cur_weapon","be")
    
    
zomb_speed register_cvar("zs_speed","500")
}

public 
event_cur_weapon(id) {
    if(!
is_user_alive(id) || !is_user_connected(id))
        return 
PLUGIN_CONTINUE
    
    
if(cs_get_user_team(id) == CS_TEAM_T) {
        
set_user_maxspeed(id,float(get_pcvar_num(zomb_speed)))
    }
    return 
PLUGIN_CONTINUE

__________________
It's a mystery.
Mini_Midget is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 12-27-2006 , 03:55   Re: Spawn with speed change
Reply With Quote #2

you dont need to make a float out of the pcvar use .
Code:
  get_pcvar_float()

Also , your using a weapon event to start a max speed . Bad way. The player might not change weapons or shoot etc etc for awhile . Using curweapon event should only be a back up to giving the speed on spawn. Which will make the speed flawless. Go to the tutorials section and use VEN's Spawn code to give speed. Also you could use fakemeta to give speed
Code:
pev(id,pev_maxspeed , get_pcvar_float(zomb_speed))
The Specialist is offline
Send a message via AIM to The Specialist
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 12-27-2006 , 14:52   Re: Spawn with speed change
Reply With Quote #3

ahh...
Yep cheers all good now
__________________
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:11.


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