help please!
#1

hi, i dont know where to Post but im looking for something with what i can make a thing and i will try to explain:

well im looking for something with what i can make a few cars only enterable for some id`s
i can`t find it and im a little kind of noob in scripting.
please help.

Reply
#2

you mean something like AddStaticVehicle ?? I don't understand what you need

btw wrong forum
Reply
#3

Quote:
Originally Posted by laser50
hi, i dont know where to Post but im looking for something with what i can make a thing and i will try to explain:

well im looking for something with what i can make a few cars only enterable for some id`s
i can`t find it and im a little kind of noob in scripting.
please help.

You can make it with player name,admin level,but IDs,better not...
Reply
#4

well i man that the car is locked for everyone but then only one skin can enter a vehicle and for the other people its locked.
Reply
#5

help plz
Reply
#6

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new veh1 = GetPlayerVehicleID(playerid) , veh2 = GetVehicleModel(veh1);
    new plskin = GetPlayerSkin(playerid);
 
    if(plskin != ALLOWED_SKIN && veh2 == VEHICLE_ID)
    {
        SendClientMessage(playerid,0x33FFFFFF,"You are not allowed to drive this vehicle!");
        RemovePlayerFromVehicle(playerid);
    }
  return 1;
}
Reply
#7

so, how to use? im a beginner in scripting
Reply
#8

copy that code in your gamemode and change ALLOWED_SKIN to allowed skin id ad VEHICLE_ID to vehicle id you want to drive (for 'lock')
Reply
#9

Quote:
Originally Posted by LittleDog
copy that code in your gamemode and change ALLOWED_SKIN to allowed skin id ad VEHICLE_ID to vehicle id you want to drive (for 'lock')
RemovePlayerFromVehicle(playerid); doesnt work on OnPlayerEnterVehicle, because this function called when player press Enter(F) ant just sitting in car, so RemovePlayerFromVehicle called when player still outside car... So you need to use OnPlayerStateChange and use state PLAYER_STATE_DRIVER
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)