Please help me with this
#1

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2)
    {
        new CarCheck = GetPlayerVehicleID(playerid);
        if(CarCheck == Cars[TEAM_BALLAS])
        {
            if(GetPlayerTeam(playerid) != TEAM_BALLAS) return SendClientMessage(playerid,COLOR_RED,"This is only for Ballas members!");
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
                return 1;
            }
        }
So if player is not in TEAM_BALLAS it removes it from vehicle. Fix this or something my mind is going
Reply
#2

pawn Код:
//OnPlayerStateChange(playerid, newstate, oldstate)
    if(newstate == PLAYER_STATE_DRIVER) // use definitions, its easier
    {
        new CarCheck = GetPlayerVehicleID(playerid);
        if(CarCheck == Cars[TEAM_BALLAS])
        {
            if(GetPlayerTeam(playerid) != TEAM_BALLAS) // removed the return
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
            }
        }
That will only work with one vehicleid but I think you want to disable more vehicles
Show us the code where you store the vehicleids in Cars
Reply
#3

didn't work.
pawn Код:
enum cInfo
{
    cTEAM_BALLAS,
    cTEAM_POLICE
}
new Cars[MAX_PLAYERS];
Cars like this...
pawn Код:
Cars[TEAM_BALLAS] = AddStaticVehicle(580,1807.2400,-1694.3062,13.2531,148.9250,0,0);
I have many teams police etc. Only ballas can enter ballas car. So like if team ballas = dont remove from car or something like that i just cant do it with pawn. Help!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)