Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- if(PRESSED(KEY_SUBMISSION))//If the player pressed KEY_SUBMISSION (2)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)//Checks if the player is the driver
- {
- new engine,lights,alarm,doors,bonnet,boot,objective;//The vehicle params
- GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);//Getting the vehicle params
- {
- if(engine == 0)//If the engine is off
- {
- SetVehicleParamsEx(vehicle,1,1,alarm,doors,bonnet,boot,objective);//We turn on the engine and lights
- }
- else//Else is the engine is on
- {
- SetVehicleParamsEx(vehicle,0,0,alarm,doors,bonnet,boot,objective);//We turn off the engine and lights
- }
- }
- }
- new string[25];
- format(string,sizeof(string),"~g~ %s",GetVehicleName(vehicleid));
- GameTextForPlayer(playerid,string,3000,1);
- if(IsPlayerInMission[playerid] == 1 && vehicleid == workingvehicle[playerid])
- {
- KillTimer(Checkveh[playerid]);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement