Raised This Month: $ Target: $400
 0% 

[CSTRIKE] Invalid player 3/2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 04-21-2017 , 14:00   [CSTRIKE] Invalid player 3/2
Reply With Quote #1

Code:
public rotar()
{
	for ( i = 1 ; i <= get_maxplayers (); i ++)
	{
		switch( cs_get_user_team ( i ))
		{
			case CS_TEAM_T : cs_set_user_team ( i , CS_TEAM_CT )
			case CS_TEAM_CT : cs_set_user_team ( i , CS_TEAM_T )
		}
	}
	return PLUGIN_HANDLED ;
}
Code:
public logevent_round_end ()
{

	for ( i = 1 ; i <= get_maxplayers (); i ++) 
	{
		switch( cs_get_user_team ( i )) 
	{

	case CS_TEAM_T : 
	{
		set_user_frags ( i , get_user_frags ( i ) + get_pcvar_num ( cvar_frag ))
		ColorChat(0, NORMAL, "Terrorists Win 1 Frag for winning the round." )
	}
		case CS_TEAM_CT : ColorChat(0, NORMAL, "Counter-Terrorists Win the round, Change Teams!" ), rotar ()
	}
}
}
PHP Code:
register_logevent "logevent_round_end" "1=Round_End" 
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-21-2017 , 14:31   Re: [CSTRIKE] Invalid player 3/2
Reply With Quote #2

Ever heard of get_players? Also the case should be after the switch. Does this even compile?
__________________

Last edited by HamletEagle; 04-21-2017 at 14:32.
HamletEagle is offline
Reply



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 17:54.


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