[FilterScript] Simple Car Licensing System
#1

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.

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
Download with Pastebin!
Reply
#2

very nice and simple!

This forum requires that you wait 120 seconds between posts. Please try again in 77 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 11 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 1 seconds.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)