05.11.2016, 11:56
PHP код:
CheckPlayers(status)
{
new players;
for(new p, o = GetPlayerPoolSize(); p <= o; p++)
{
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 i, l = GetPlayerPoolSize(); i <= l; i++) // loop
{
if(IsPlayerConnected(i)) // checks for connected
{
if(pInEvent[i])
{
if(president == -1)
{
president = CheckPlayers(1);
}
if(president == playerid)
{
SetPlayerSkin(playerid, 228);
GivePlayerWeapon(playerid, 24, 99999);
}
else if(president != playerid)
{
SetPlayerSkin(playerid, 165);
GivePlayerWeapon(playerid, 23, 99999);
}
}
}
}
/* C O D E */