29.10.2010, 17:13
Car Licensing System
This is basically just a small Car Licensing system for noobs who are new to PAWN. You have to go to City Hall to buy a driver's license using /buylicense and it will cost you $50. Once you have done that, you are free to drive any car you like!
If you don't want this to apply to a motorbike, get the vehicle ID of the motorbike using OnPlayerEnterVehicle and then define the car IDs that don't need the car license.
Download
Download with Pastebin!
This is basically just a small Car Licensing system for noobs who are new to PAWN. You have to go to City Hall to buy a driver's license using /buylicense and it will cost you $50. Once you have done that, you are free to drive any car you like!
If you don't want this to apply to a motorbike, get the vehicle ID of the motorbike using OnPlayerEnterVehicle and then define the car IDs that don't need the car license.
pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new newcar = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER) {
if(newcar == 1){return 1;} // If the first vehicle in your script is a bike, then we don't need to worry about a thing because we're not going to do anything if the player enters a bike.
if(newcar >= 2) // If the car is greater then 2, then...
{
if(LicenseInfo[playerid][Car] < 1) {
SendClientMessage(playerid, 0xFF6347AA, "You can't drive this car, you don't have a license!");
RemovePlayerFromVehicle(playerid);
return 1;}}}
return 1;
}
Download with Pastebin!