Is it possible?
#1

So basically I want to know is this possible?

SO I want to know how is possible to count how much people is in the car?

I need to count how much people is in one bus or train..

And I want to know how it's possible?
Reply
#2

pawn Код:
CountPlayersInVehicle(countVehicle)
{
    new playerCount;

    for(new playerIndex; playerIndex < MAX_PLAYERS; playerIndex++)
    {
        if(IsPlayerInVehicle(playerIndex, countVehicle))
        {
            playerCount++;
        }
    }

    return playerCount;
}
Usage:

pawn Код:
new clientMessage[128];
format(clientMessage, sizeof(clientMessage), "There are %d players in your vehicle.", CountPlayersInVehicle(GetPlayerVehicleID(playerid)));
SendClientMessage(playerid, -1, clientMessage);
Reply
#3

Nevermind this
Reply
#4

Trains are an exception. They consist of 4 vehicle IDs. The vehicle ID that is returned by AddStaticVehicle(Ex) [you can't use CreateVehicle for trains] is the engine. The next 3 IDs are the 3 trailers/carriages/whatever. Keep that in mind.
Reply
#5

So basically that possible to do.. And I need the first one as not CreateVehicle and all the rest as created vehicle to count. thanks guys for help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)