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?