Error on vehicle ejecting
#1

Hey guys just a quick question ive checked around looking for this but so far havent tried anything that is working
maybe im doing something wrong but heres what i done.

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && IsPlayerInAnyVehicle(playerid))
{
new vid = GetPlayerVehicleID(playerid);
if(vid == 597 || vid == 599 && gTeam[playerid] == CIVILIAN)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_YELLOW, "You can NOT Enter a Police Vehicle");
}
}
return 1;

}



I followed another guys post like this and i couldnt get it working anyone wanna help?
Reply
#2

Try this..

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid == 597 || vid == 599 && gTeam[playerid] == CIVILIAN)
        {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_YELLOW, "You can NOT Enter a Police Vehicle");
        }
    }
    return 1;
}
But, what's the problem?
Reply
#3

Problem is it just doesnt work either class can enter the police vehicles that i have set which i dont know why
Reply
#4

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid);
        new model = GetVehicleModel(vid);
        if((model == 597 || model == 599) && gTeam[playerid] == CIVILIAN)
        {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_YELLOW, "You can NOT Enter a Police Vehicle");
        }
    }
    return 1;
}
Reply
#5

But the message displays?
Reply
#6

Nope it doesnt do anything not even the message
Reply
#7

Jefff's should work did you try his?
Reply
#8

I dont think so no ill have a quick search for it now
Reply
#9

Did you try it? lol.

Before you were comparing the vehicle ID to the vehicle's model.

Vehicle ID is not the same as the vehicle model.

Jeff instead compares the model to the model of the police cruisers. Give his a try and tell if it works.
Reply
#10

It's right here in your topic hahahha



Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid);
        new model = GetVehicleModel(vid);
        if((model == 597 || model == 599) && gTeam[playerid] == CIVILIAN)
        {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_YELLOW, "You can NOT Enter a Police Vehicle");
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)