SA-MP Forums Archive
OnPlayerEnterVehicle help - 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)
+--- Thread: OnPlayerEnterVehicle help (/showthread.php?tid=416406)



OnPlayerEnterVehicle help - cluckintucker - 17.02.2013

can someone help me. im trying to make this script so when you enter vehicle id 408 and your in
Код:
 new gJob[MAX_PLAYERS]; // aka if(gJob[playerid] > 1)
that job you can enter that vehicle or if your not in that job you get rejected from that vehicle help please thanks.


Re: OnPlayerEnterVehicle help - ]Rafaellos[ - 17.02.2013

Something like this?

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == 408)
    {
        if(gJob[playerid] > 1)
        {
            //successfully start the job?
        }
        else
        {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, -1, "Your not in job to use that car");
        }
    }
    return 1;
}
And you have to add "gJob[playerid] = 0;" on "OnPlayerConnect" and "gJob[playerid] = 1;" in your job command.

I dont test it but i think will work.