Raised This Month: $ Target: $400
 0% 

Looping on all players


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Dav3
Senior Member
Join Date: Apr 2006
Location: Dust2
Old 08-01-2007 , 12:15   Looping on all players
Reply With Quote #1

hi
What is the problem?
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 command
				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.
			} 

// ...
// ...
//  ...
//  ...

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)
			}
		} // etc..
Can somebody fix it?

I want to change every admin's models to default (random from these) when this command executed.
Dav3 is offline
Send a message via MSN to Dav3 Send a message via Skype™ to Dav3
 



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 10:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode