Raised This Month: $ Target: $400
 0% 

else if problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 05-19-2014 , 07:31   Re: else if problem
Reply With Quote #2

Quote:
Originally Posted by proffs View Post
PHP Code:
public Fwd_PlayerKilled()
{
    if(
getPlayers(CS_TEAM_T) == 1// we have a winner
    
{
        
StopGame()
        
ColorChat(0GREY"Death Match")
    }
    
//but you have the game to NOT stop in the following cases. But instead of elses, we use switch between games
    
else
    {
        switch(
g_iCurrentGame)
        {
            case 
GAME_NO: return
            case 
GAME_SPARTA: return
            case 
GAME_SHARK: return
        }
        
    }


This doesn't work .

As you see when there is 1 T left Stopgame should run.
But if it's GAME_... those you can see, it shouldn't run Stopgame..
It doesn't work for me
You are right now checking if its 1 player left. If its 0 players or more than 1 player left it will return and not stop the game.
You need to first check this
Code:
		switch(g_iCurrentGame)
		{
			case GAME_NO: return
			case GAME_SPARTA: return
			case GAME_SHARK: return
		}
Then else if its 1 player left
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
 



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 09:41.


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