Quote:
Originally Posted by drekes
PHP Code:
public Event_TeamInfo() {
client_print(0, print_chat, "Success!")
new id = read_data(1);
if (cs_get_user_team(id)==CS_TEAM_T)
cs_set_user_team(id, CS_TEAM_CT, CS_DONTCHANGE)
else
set_task(3.0,"Transfer_NoAction", 0)
}
|
Thanks, i did some minor changes myself.
And it still doesnt work.
PHP Code:
#include <amxmodx>
#include <cstrike>
new bool:bTransfer = false
public plugin_init() {
register_plugin("Assassins Creed Mod","0.0.1","Pantheon")
register_clcmd("say !team","Event_TeamCheck",0," prints how many players in each team.")
register_logevent("RoundStart",2,"1=Round_Start")
register_event("TeamInfo", "Event_TeamInfo", "a")
}
public GetTeamCounts( &TCount , &CTCount ) {
new iMaxPlayers = get_maxplayers()
TCount = 0
CTCount = 0
for ( new i = 1 ; i <= iMaxPlayers ; i++ ) {
if ( !is_user_connected( i ) )
continue
switch ( cs_get_user_team( i ) ) {
case CS_TEAM_T: TCount++
case CS_TEAM_CT: CTCount++
}
}
}
public RoundStart() {
new iTs , iCTs
GetTeamCounts( iTs , iCTs )
client_print( 0 , print_center , "Teams are being arranged. Stay Patient.")
if (iTs > 1) {
bTransfer = true
}else{
bTransfer = false
set_task(3.0,"Transfer_NoAction", 0)
}
}
public Event_TeamInfo() {
client_print(0, print_chat, "Success!")
while (bTransfer) {
new id = read_data(1);
if (cs_get_user_team(id)==CS_TEAM_T)
cs_set_user_team(id, CS_TEAM_CT, CS_DONTCHANGE)
else
set_task(3.0,"Transfer_NoAction", 0)
}
}
public Transfer_NoAction() {
client_print(0, print_center, "No Action was taken!")
}
public Event_TeamCheck() {
new iTs , iCTs
GetTeamCounts( iTs , iCTs )
client_print( 0 , print_chat , "Terrorist=%d Counter Terrorist=%d" , iTs , iCTs )
}