Raised This Month: $ Target: $400
 0% 

[HELP] Switching only CT?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 09-27-2009 , 18:04   Re: [HELP] Switching only CT?
Reply With Quote #4

It's not working because it's completely wrong...

try this:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>

#define TID_SETSPEED 6326
#define TID_RESSPEED 4515

new Float:g_Ts_maxspeed;
new 
g_max_players;
new 
bool:g_freezetime;

public 
plugin_init()
{
    
register_plugin("whatever mod""1.0""Sylwester");
    
register_event("HLTV""NewRound""a""1=0""2=0");
    
register_logevent("RoundStart"2"1=Round_Start");
    
RegisterHam(Ham_Spawn"player""PlayerSpawn"1);
    
register_event("CurWeapon""ResetMaxSpeed""be""1=1");
    
g_max_players get_maxplayers();
}

public 
NewRound()
{
    new 
players[32], pNum;
    
get_players(playerspNum);

    new 
chosen playersrandom(pNum) ];
    
cs_set_user_team(chosenCS_TEAM_T );

    for( new 
0pNumi++ )
    {
        if( 
players[i] != chosen )
            
cs_set_user_teamplayers[i], CS_TEAM_CT );
    }

    
g_Ts_maxspeed 0.1;
    if(
task_exists(TID_SETSPEED))
        
remove_task(TID_SETSPEED);
    
g_freezetime true;
}

public 
RoundStart()
{
    
set_task(15.0"SetSpeed"TID_SETSPEED);
    
g_freezetime false;
    if(
task_exists(TID_RESSPEED))
        
remove_task(TID_RESSPEED);
    
set_task(0.2"ResetAllMaxSpeed"TID_RESSPEED);
}

public 
SetSpeed()
{
    
g_Ts_maxspeed 310.0;
    
ResetAllMaxSpeed()
}

public 
ResetAllMaxSpeed()
{
    for( new 
1<= g_max_playersi++ )
            
ResetMaxSpeed(i);
}

public 
ResetMaxSpeed(id)
{
    if(
g_freezetime)
        return;
    if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
        
set_user_maxspeed(idg_Ts_maxspeed);
}

public 
PlayerSpawn(id)
{
    if(!
is_user_alive(id))
        return;
    if(
cs_get_user_team(id) == CS_TEAM_T)
    {
        
set_user_health(id3500);
        
ResetMaxSpeed(id);
        if(
task_exists(id))
            
remove_task(id);
        
set_task(0.2"RemoveWeapons"id);
    }
}

public 
RemoveWeapons(id)
{
    if(!
is_user_alive(id))
        return;
    
strip_user_weapons(id);
    
set_task(0.1"GiveWeapons"id);
}

public 
GiveWeapons(id)
{
    if(!
is_user_alive(id))
        return;
    
give_item(id"weapon_knife");

__________________
Impossible is Nothing
Sylwester is offline
 



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 22:31.


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