Quote:
Originally Posted by EFFx
If is for all players, add:
PHP Code:
set_task(3.0,"models")
public models()
{
new players[32],inum
get_players(players,inum,"a")
for(new i = 0;i<inum;i++)
{
if(cs_get_user_team(players[i]]) == CS_TEAM_T)
{
cs_set_user_model(players[i], "vermelho_ws")
}
else if(cs_get_user_team(players[i]) == CS_TEAM_CT)
{
cs_set_user_model(players[i],"azul_ws")
}
}
}
|
Yes, it's better , no need to make task for every player but you missed something.
At the topic of the plugin :
PHP Code:
#define TASK_SETMODEL 5632 //or any numbers you want
then :
PHP Code:
if(task_exists(TASK_SETMODEL))
remove_task(TASK_SETMODEL)
set_task(3.0,"models", TASK_SETMODEL)
And you can use :
PHP Code:
switch(cs_get_user_team(players[i]){
case CS_TEAM_T: cs_set_user_model(players[i], "vermelho_ws")
case CS_TEAM_CT: cs_set_user_model(players[i],"azul_ws")
}
It wont call function cs_get_user_team 2 times if first returns false.