Entering Vehicle Will not work
#1

Fix this please, i will +Rep
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new string[128];
    if(vehicleid == 520 || vehicleid == 425 || vehicleid == 447 || vehicleid == 432)
    {
    new Float:slx, Float:sly, Float:slz;
    GetPlayerPos(playerid, slx, sly, slz);
    RemovePlayerFromVehicle(playerid);
    SetPlayerPos(playerid, slx, sly, slz+1.5);
    PlayerPlaySound(playerid, 1130, slx, sly, slz+1.3);
    format(string,sizeof(string),"You are not allowed inside this vehicle!");
    SendClientMessage(playerid,green,string);
    }
    return 1;
}
I'm trying to kick them out the vehicle when the player goes in any of the vehicle Id's listed above and nothing happens, can someone fix it for me please.
Reply
#2

Use on OnPlayerStateChange
Reply
#3

I was going to try that but my code should work right?
Reply
#4

use OnPlayerStateChange then check if player's newstate is PLAYER_STATE_DRIVER
hmm... not sure maybe it work
Reply
#5

https://sampwiki.blast.hk/wiki/GetVehicleModel
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)