Choosing a random player bug
#3

PHP код:
CheckPlayers(status)
{
    new 
players;
    for(new 
pGetPlayerPoolSize(); <= op++)
    {
        if(
IsPlayerConnected(p))
        {
            switch(
status)
            {
                case 
0:
                {
                    
players ++;
                }
                case 
1:
                {
                    if(
pInEvent[p])
                    {
                        
players ++;
                    }
                }
            }
        }
    }
    return 
players;
}
//
// at the top right after the includes, there where the variables belong...
new president = -1;
/* C O D E */
    
for(new iGetPlayerPoolSize(); <= li++) // loop
    
{
        if(
IsPlayerConnected(i)) // checks for connected
        
{
            if(
pInEvent[i])
            {
                if(
president == -1)
                {
                    
president CheckPlayers(1);
                }
                if(
president == playerid)
                {
                    
SetPlayerSkin(playerid228);
                    
GivePlayerWeapon(playerid2499999);
                }
                else if(
president != playerid)
                {
                    
SetPlayerSkin(playerid165);
                    
GivePlayerWeapon(playerid2399999);
                }
            }
        }
    }
/* C O D E */ 
Here you go.
Reply


Messages In This Thread
Choosing a random player bug - by TroubleFingers - 05.11.2016, 10:37
Re: Choosing a random player bug - by SyS - 05.11.2016, 11:24
Re: Choosing a random player bug - by Logic_ - 05.11.2016, 11:56

Forum Jump:


Users browsing this thread: 2 Guest(s)