locking vehicle
#1

How lock an vehcile
like
Код:
Getplayerscore 300
can enter this vehicle
no commands lik /lock or /unlock
just locking it please help and where to put it??
Reply
#2

Use public OnPlayerEnterVehicle

Check what the vehicle ID is and then if the player score isn't high enough, kick them out of the vehicle or don't let them enter it at all.
Reply
#3

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new score = GetPlayerScore(playerid);
    if(score < 300)
    {
         SetVehicleParamsForPlayer(vehicle,playerid,0,1);
    }
    else
    {
         //Do Nothin
    }
    return 1;
}
Try this.
Untested
Reply
#4

i think it didnt work??
Quote:

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new score = GetPlayerScore(playerid);
if(score < 250)
{
SetVehicleParamsForPlayer(432,playerid,0,1);
}
else
{
SendClientMessage(-1, COLOR_RED,"You Need 300 Score for Enter The Rhino!");
}
if(score < 980)
{
SetVehicleParamsForPlayer(520,playerid,0,1);
}
else
{
SendClientMessage(-1, COLOR_RED,"You Need 980 Score for Enter The Hydra!");
}
if(score < 7500)
{
SetVehicleParamsForPlayer(425,playerid,0,1);
}
else
{
SendClientMessage(-1, COLOR_RED,"You Need 750 Score for Enter The Hunter!");
}
if(score < 120)
{
SetVehicleParamsForPlayer(447,playerid,0,1);
}
else
{
SendClientMessage(-1, COLOR_RED,"You Need 120 Score for Enter The SeaSparrow!");
}
return 1;
}

this is what i use from you but only one thing no errors i can also enter the vehicle
Reply
#5

That won't work. You're locking it after they've entered the vehicle. Put it under OnVehicleStreamIn.
Try this.

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid) {
    new score = GetPlayerScore(forplayerid);
    if(score < 250) {
        SetVehicleParamsForPlayer(432, forplayerid, 0, 1);
    }
    if(score < 980) {
        SetVehicleParamsForPlayer(520, forplayerid, 0, 1);
    }
    if(score < 7500) {
        SetVehicleParamsForPlayer(425, forplayerid, 0, 1);
    }
    if(score < 120) {
        SetVehicleParamsForPlayer(447, forplayerid, 0, 1);
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)