SA-MP Forums Archive
Error on vehicle ejecting - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Error on vehicle ejecting (/showthread.php?tid=189001)



Error on vehicle ejecting - barneystinson - 09.11.2010

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?


Re: Error on vehicle ejecting - The_Moddler - 09.11.2010

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?


Re: Error on vehicle ejecting - barneystinson - 09.11.2010

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


Re: Error on vehicle ejecting - Jefff - 09.11.2010

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;
}



Re: Error on vehicle ejecting - The_Moddler - 09.11.2010

But the message displays?


Re: Error on vehicle ejecting - barneystinson - 09.11.2010

Nope it doesnt do anything not even the message


Re: Error on vehicle ejecting - lavamike - 09.11.2010

Jefff's should work did you try his?


Re: Error on vehicle ejecting - barneystinson - 09.11.2010

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


Re: Error on vehicle ejecting - lavamike - 09.11.2010

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.


Re: Error on vehicle ejecting - lavamike - 09.11.2010

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;
}