21.10.2010, 12:17
I'm really not sure what you mean this time. Here's code to count the number of water vehicles with players inside.
pawn Код:
stock GetNumberOfActiveWaterVehicles( )
{
new
count = 0,
playerid,
i
;
for ( playerid = 0; playerid < MAX_PLAYERS; playerid++ )
{
if ( !IsPlayerConnected( playerid ) )
continue;
for ( i = 0; i < MAX_WATER_VEHICLES; i++ )
{
if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER && GetPlayerVehicleID( playerid ) == Water[ i ] )
++count;
}
}
return count;
}