Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PLAYER STATE CHANGE:
- new vehicle, string[128];
- vehicle = GetPlayerVehicleID(playerid);
- if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver
- {
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
- if(IsARentVehicle(vehicle)) // Faggio Rent Vehicles (San Fierro Airport)
- {
- if(VehicleRentID[playerid] > 0)
- {
- ErrorMessage(playerid, "You are already renting a vehicle.");
- RemovePlayerFromVehicle(playerid);
- return 1;
- }
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(VehicleRentID[i] == vehicle)
- {
- format(string, sizeof(string), "%s is currently renting this Faggio.", GetName(i));
- InformationMessage(playerid, string);
- IsEngineRunning(playerid); // Performs a check to determine whether engine is running, followed by a message sent to the player.
- break;
- }
- else
- {
- format(string, sizeof(string), ""WHITE"You can rent this Faggio for "GREEN"$%d"WHITE".\nWould you like to rent it?", RentalPrice);
- ShowPlayerDialog(playerid, RentalDialog, DIALOG_STYLE_MSGBOX, ""YELLOW"Barrona Rental", string, "Rent", "Exit");
- break;
- }
- }
- }
- }
- DIALOG RESPONSE:
- case RentalDialog:
- {
- if(!response)
- {
- RemovePlayerFromVehicle(playerid);
- }
- else
- {
- if(Player[playerid][Cash] < RentalPrice)
- {
- ErrorMessage(playerid, "You don't have enough cash to rent this vehicle.");
- RemovePlayerFromVehicle(playerid);
- }
- else
- {
- GiveCash(playerid, -RentalPrice);
- VehicleRentID[playerid] = vehicle;
- InformationMessage(playerid, "You are now renting this Faggio.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment