SA-MP Forums Archive
help please! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help please! (/showthread.php?tid=77145)



help please! - laser50 - 08.05.2009

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.




Re: help please! - *ToM* - 08.05.2009

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

btw wrong forum


Re: help please! - Luka P. - 08.05.2009

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...


Re: help please! - laser50 - 10.05.2009

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.


Re: help please! - laser50 - 10.05.2009

help plz


Re: help please! - Luka P. - 11.05.2009

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;
}



Re: help please! - laser50 - 11.05.2009

so, how to use? im a beginner in scripting


Re: help please! - Luka P. - 11.05.2009

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')



Re: help please! - Dreftas - 11.05.2009

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