05.08.2011, 13:00
Like this?
If I understand, you are asking this.
pawn Код:
new
iPlayerCounts = -1
;
public OnPlayerConnect( playerid )
{
if ( iPlayerCounts < 0 )
iPlayerCounts = 0;
else
iPlayerCounts ++; // Increase the iPlayerCounts, you could do " iPlayerCounts += 1; "
return 1;
}
public OnPlayerDisconnect( playerid, reason )
{
if ( iPlayerCounts > -1 )
iPlayerCounts --; // Take away the variable, you could use " iPlayerCounts -= 1; "
return 1;
}
stock dividePlayersByTwo( )
return iPlayerCounts / 2; // Divides iPlayerCounts by Two.
stock startHappyHour( )
{
if ( ( dividePlayersByTwo( ) ) < 5 ) // if ( ( iPlayerCounts /2 ) < 5 )
return GameTextForAll( "Not enough players", 3000, 3 );
return 1;
}