how to lock this vehicle
#1

Quote:

if(GetVehicleModel(vehicleid) == 425 && GetPlayerScore(playerid) <150)
{
SendClientMessage(playerid, COLOR_RED, "You need to be a Colonel to ride a Hunter! [/Rankstats & /Myrank]");
//what think should i put
}

pls tell me how to make player cant enter those vehicle
Reply
#2

You should do this under the callback OnPlayerStateChange, then have it check if the newstate is PLAYER_STATE_DRIVER, then use your code + RemovePlayerFromVehicle
Reply
#3

if you want to lock do this:

PHP код:
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,lights,alarm,0,bonnet,boot,objective); 
But if you don't want to let player enter the vehicle...

PHP код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(
newstate == 2)
    {
        if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 425 && GetPlayerScore(playerid) < 150)
        {
            
SendClientMessage(playeridCOLOR_RED"You need to be a Colonel to ride a Hunter! [/Rankstats & /Myrank]");
            
RemovePlayerFromVehicle(playerid);
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)