Raised This Month: $ Target: $400
 0% 

set_user_maxspeed


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-02-2010 , 19:09   set_user_maxspeed
Reply With Quote #1

hi,

i tried to define 2 teams.
team catcher & team fleer.
every round willbe start a countdown and the catchers are while the countdown freeze.( should be freeze )
the problem : users can change the weapon to run.i tried to set the maxspeed @ curweapon but happend nothing.

here the full code. i hope anyone can say me why it's so

PHP Code:
public plugin_init() 
{
    
register_plugin"Hide 'n' Seek""0.0.1""One" );
    
register_logevent("startround",2,"0=World triggered","1=Round_Start")
    
g_MaxPlayers get_maxplayers()
    
register_event("CurWeapon""ev_CheckWeapon""be""1=1")
}

        for(
id 1id <= g_MaxPlayersid++)
        {
            if(
is_user_connected(id) && cs_get_user_team(id) & CS_TEAM_T)
            {
                
g_Player_is_catcher[id] = false
                set_user_rendering
(id)
            }
            if(
is_user_connected(id) && cs_get_user_team(id) & CS_TEAM_CT)
            {
                
g_Player_is_catcher[id] = true
                set_user_rendering
(id,kRenderFxGlowShell,255,0,0,kRenderNormal,40)
            }
        }
            
    }
   
}
public 
do_fade(id)
{
    
set_task(1.0,"counter",id""0"b")
}
public 
counter(id)
{
    if(
g_counter <= 30)
    {
        
g_counter++
        
client_print(0,print_chat,"%d counter",g_counter)
        for(
id 1id <= g_MaxPlayersid++)
        {
            if(
g_Player_is_catcher[id] && is_user_alive(id))
            {
                
set_user_maxspeed(id,0.1)
                
set_user_gravity(id,10.0)
            }
            else if(!
g_Player_is_catcher[id] && is_user_alive(id))
            {
                
set_user_gravity(id,0.5)
                
set_user_maxspeed(id,400.0)
            }
        }
    }
    else
    {
        
remove_task(id)
        
g_counter 0
        
for(id 1id <= g_MaxPlayersid++)
        {
            if(
g_Player_is_catcher[id] && is_user_alive(id))
            {
                
set_user_gravity(id,0.5)
                
set_user_maxspeed(id,400.0)
            }
            else if(!
g_Player_is_catcher[id] && is_user_alive(id))
            {
                
set_user_maxspeed(id,0.1)
                
set_user_gravity(id,10.0)
            }
        }
        
    }
}
public 
ev_CheckWeapon(id)
{
    if(
g_Player_is_catcher[id] && is_user_alive(id))
    {
        
set_user_maxspeed(id,400.0)
    }
    else if(!
g_Player_is_catcher[id] && is_user_alive(id))
    {
        
set_user_maxspeed(id,0.1)
    }

__________________

Last edited by One; 03-02-2010 at 19:23.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
 



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 08:40.


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