Vlock.
#4

The issue here is that you're using GetPlayerVehicleID instead of the vehicleid parameter provided in the callback header.

It helps to clear the player's animations as they attempt entry. With the code you provided it's still possible for anyone to enter the vehicle. If you're looking to lock the vehicle when a player in the wrong team approaches it, use OnVehicleStreamIn:

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    if(vehicleid == Car[TEAM_COP] && gTeam[playerid] != TEAM_COP)
    {
        SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
    }
}
Also what is Car[TEAM_COP] being assigned to? You may be attempting to assign multiple vehicle IDs to it, e.g:

pawn Код:
Car[TEAM_COP] = CreateVehicle(...);
Car[TEAM_COP] = CreateVehicle(...);
Car[TEAM_COP] = CreateVehicle(...);
In this instance only the last created vehicle ID is assigned to that variable. Therefore this means only one vehicle is designated for TEAM_COP. Two dimensional arrays exist for this purpose:

pawn Код:
Car[TEAM_COP][0] = CreateVehicle(...);
Car[TEAM_COP][1] = CreateVehicle(...);
Car[TEAM_COP][2] = CreateVehicle(...);
Reply


Messages In This Thread
Vlock. - by CannonBolt - 01.10.2016, 20:59
Re: Vlock. - by Konstantinos - 01.10.2016, 21:01
Re: Vlock. - by CannonBolt - 01.10.2016, 21:09
Re: Vlock. - by Chump - 02.10.2016, 11:21
Re: Vlock. - by CannonBolt - 09.10.2016, 16:54
Re: Vlock. - by azzerking - 09.10.2016, 17:10

Forum Jump:


Users browsing this thread: 1 Guest(s)