Raised This Month: $ Target: $400
 0% 

[HELP] Switching only CT?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
malec321
Senior Member
Join Date: May 2009
Location: Los Angeles
Old 09-27-2009 , 15:46   [HELP] Switching only CT?
Reply With Quote #1

HTML Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <fakemeta>

#define VERSION "0.01"

public plugin_init( )
{
register_plugin( "Vampire Mod", VERSION, "ALeX" );

register_event( "HLTV", "NewRound", "a", "1=0", "2=0" );

}

public NewRound( )
{
new gPlayers[ 32 ], pNum;
get_players( gPlayers, pNum, "c" );

new pCount = floatround( float ( pNum ) * 1, floatround_ceil );
new i;

new pChosen[ 8 ], pTotal;

while( pTotal < pCount )
{
i = random( pNum );
pChosen[ pTotal++ ] = gPlayers[ i ];

}

new id;

for( new i = 0; i < pTotal; i++ )
{
id = pChosen[ i ];

cs_set_user_team( id, CS_TEAM_T );
give_item ( id, "weapon_knife")
set_user_health(id, 3500);
set_user_maxspeed(id, 0.0);
set_task(15.0, "givespeed", id);
}

for( new i = 0; i < pNum; i++ )
{
id = gPlayers[ i ];

cs_set_user_team( id, CS_TEAM_CT );
}

return;
}
public givespeed(id)
{
set_user_maxspeed(id, 310.0)
set_cvar_float("sv_maxspeed", 310.0)
}
Hey guys in this code above how come when people join it just transfers everyone to CT and not how it shud work? I want it so that when people join ct, it randomly takes 1 ct to t and starts them with knife, 0 speed, and 3.5k hp i have it set that in 15 seconds, the t has 310 speed again. can anyone see the problem?
malec321 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