View Single Post
Minimum
Senior Member
Join Date: Jun 2006
Old 08-01-2007 , 15:55   Re: Looping on all players
Reply With Quote #2

No offense but the code you supplied is really butchered. I tried my best to fix it but it would be more helpful if you supplied the whole function.

Code:
    new iPlayers[32],iNum     for(new i=0;i<iNum;i++) // looping command     {         if (get_user_flags(iPlayers[i]) & ADMIN_KICK) { // admin flags..             new CsTeams:userTeam = cs_get_user_team(iPlayers[i])             if (userTeam == CS_TEAM_T) { // team check                 new randModel = random_num(1,4) // random number for model                 new team = 1 // team check for cases                 select_model(iPlayers[i],team,randModel)  // model change function                 if(get_cvar_num("amx_adminmodels_debug") == 1) log_amx("+1 Terror Admin Model Disabled") // debug info, so it succes - but this don't come to console (if the debug enabled) and the model doesnt change.             } // Start of new func?             public select_model(iPlayers,team, model) {     switch(team) {         case 1: {  // case 1 for terror             switch(model) {  // set the model one of these                 case 1: cs_set_user_team(iPlayers, CS_TEAM_T, CS_T_TERROR)                 case 2: cs_set_user_team(iPlayers, CS_TEAM_T, CS_T_LEET)                 case 3: cs_set_user_team(iPlayers, CS_TEAM_T, CS_T_ARCTIC)                 case 4: cs_set_user_team(iPlayers, CS_TEAM_T, CS_T_GUERILLA)             }         }     }     return PLUGIN_HANDLED }
Minimum is offline
Send a message via AIM to Minimum Send a message via MSN to Minimum