Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:car(playerid, params[])
- {
- new Usage[128], string[128], vehicle, engine, lights, alarm, doors, bonnent, boot, objective;
- vehicle = GetPlayerVehicleID(playerid);
- GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnent, boot, objective);
- if(sscanf(params, "z", Usage))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /car [usage]");
- SendClientMessage(playerid, GREY, "Usage: Hood, Trunk, Lights, Boot");
- }
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED, "You must be in a vehicle to use this command!");
- {
- if(strcmp(Usage, "Hood", true) == 0)
- {
- if(IsHoodUp[vehicle] == 0)
- {
- SetVehicleParamsEx(vehicle, engine, lights, alarm, doors, 1, boot, objective);
- IsHoodUp[vehicle] = 1;
- format(string, sizeof(string), "%s opens the hood of the car.", GetName(playerid));
- }
- else if(IsHoodUp[vehicle] == 1)
- {
- SetVehicleParamsEx(vehicle, engine, lights, alarm, doors, 0, boot, objective);
- IsHoodUp[vehicle] = 0;
- format(string, sizeof(string), "%s closes the hood of the car.", GetName(playerid));
- }
- }
- else if(strcmp(Usage, "Trunk", true) == 0)
- {
- if(IsTrunkUp[vehicle] == 0)
- {
- SetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnent, 1, objective);
- IsTrunkUp[vehicle] = 1;
- format(string, sizeof(string), "%s opens the trunk of the car.", GetName(playerid));
- }
- else if(IsTrunkUp[vehicle] == 1)
- {
- SetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnent, 0, objective);
- IsTrunkUp[vehicle] = 0;
- format(string, sizeof(string), "%s closes the trunk of the car.", GetName(playerid));
- }
- }
- else if(strcmp(Usage, "Boot", true) == 0)
- {
- if(IsTrunkUp[vehicle] == 0)
- {
- SetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnent, 1, objective);
- IsTrunkUp[vehicle] = 1;
- format(string, sizeof(string), "%s opens the boot of the car.", GetName(playerid));
- }
- else if(IsTrunkUp[vehicle] == 1)
- {
- SetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnent, 0, objective);
- IsTrunkUp[vehicle] = 0;
- format(string, sizeof(string), "%s closes the boot of the car.", GetName(playerid));
- }
- }
- else if(strcmp(Usage, "Lights", true) == 0)
- {
- if(AreLightsOn[vehicle] == 0)
- {
- SetVehicleParamsEx(vehicle, engine, 1, alarm, doors, bonnent, boot, objective);
- AreLightsOn[vehicle] = 1;
- format(string, sizeof(string), "%s turns the headlights of the car on.", GetName(playerid));
- }
- else if(AreLightsOn[vehicle] == 1)
- {
- SetVehicleParamsEx(vehicle, engine, 0, alarm, doors, bonnent, boot, objective);
- AreLightsOn[vehicle] = 0;
- format(string, sizeof(string), "%s turns the headlights of the car off.", GetName(playerid));
- }
- }
- NearByMessage(playerid, AUTO_PURP, string);
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment