SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 01/02/2016, 08:52 PM   #1
izeatfishz
Huge Clucker
 
izeatfishz's Avatar
 
Join Date: Jun 2012
Posts: 231
Reputation: 43
Default Engine

Got a problem where when lspd vehicles respawn they respawn with a broken engine state, so if i try /engine nothing happens:

Onvehspawn:

Code:
/*if(IsLSPDCar(vehicleid))
    {
	    new engine, lights, alarm, doors, bonnet, boot, objective;
		GetVehicleParamsEx(LSPDCar[(vehicleid)], engine, lights, alarm, doors, bonnet, boot, objective);
		SetVehicleParamsEx(LSPDCar[(vehicleid)], 0, lights, alarm, doors, bonnet, boot, objective);
		SetVehicleNumberPlate(LSPDCar[(vehicleid)], "LSPD");
		SetVehicleHealth(LSPDCar[vehicleid], 1250);
	}*/

Code:
if(vehicleid == Vehicle[playerid] || IsLSPDCar(vehicleid) && PlayerInfo[playerid][Faction] == 1 || IsLSFDCar(vehicleid) && PlayerInfo[playerid][Faction] == 2 || IsTrashVan(vehicleid) && PlayerInfo[playerid][Job] == 3 || IsPizzaBike(vehicleid) && PlayerInfo[playerid][Job] == 4)
    {
        if(vehicleid == Vehicle[playerid] && VehicleInfo[playerid][Fuel] <= 0) return SCM(playerid, COLOR_GENERIC_WARNING, "Your vehicle has no fuel in it, refuel it with a gas can or at a fuel station.");
		if(engine == VEHICLE_PARAMS_OFF)
		{
			SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
			format(string, sizeof(string), "* %s turns the %s's engine on.", PlayerName(playerid),GetVehicleName(vehicleid));
			SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
			PlayerPlaySound(playerid, 21002, 0.0, 0.0, 0.0);
		}
		else if(engine == VEHICLE_PARAMS_ON)
		{
			SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
			GameTextForPlayer(playerid, "~r~Engine off!", 2000, 4);
			format(string, sizeof(string), "* %s turns the %s's engine off.", PlayerName(playerid),GetVehicleName(vehicleid));
			SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
	 	}
 	}
so stuck on a solution here, help!
izeatfishz is offline   Reply With Quote
Old 01/02/2016, 10:04 PM   #2
Hellman92
Big Clucker
 
Hellman92's Avatar
 
Join Date: Nov 2011
Posts: 188
Reputation: 31
Default Re: Engine

try this

PHP Code:
if(IsLSPDCar(vehicleid))
    {
        new 
enginelightsalarmdoorsbonnetbootobjective;
        
GetVehicleParamsEx(LSPDCar[(vehicleid)], enginelightsalarmdoorsbonnetbootobjective);
        
SetVehicleParamsEx(LSPDCar[(vehicleid)], enginelightsalarmdoorsbonnetbootobjective);
        
SetVehicleNumberPlate(LSPDCar[(vehicleid)], "LSPD");
    } 
Hellman92 is offline   Reply With Quote
Old 01/02/2016, 10:24 PM   #3
IzadorO
Huge Clucker
 
IzadorO's Avatar
 
Join Date: Feb 2015
Location: Scotland, Glasgow
Posts: 204
Reputation: 17
Default Re: Engine

if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)
IzadorO is offline   Reply With Quote
Old 02/02/2016, 04:20 PM   #4
izeatfishz
Huge Clucker
 
izeatfishz's Avatar
 
Join Date: Jun 2012
Posts: 231
Reputation: 43
Default Re: Engine

dont seem to be working
izeatfishz is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WOW! Engine problem - Engine starts with Forward(W) KEY! SkiT'aZ Scripting Help 3 22/02/2015 06:28 PM
change /engine to "ctrl" to start the engine flox12 Scripting Help 7 13/08/2013 04:39 PM
[HELP]I just edited my /engine system and when i do /engine it says "unknown Lilcuete Help Archive 2 25/04/2010 02:31 PM
The Best Game Engine [Esenthel Engine] roleplayman Everything and Nothing 26 07/05/2009 11:33 AM
Engine start and engine broken. speedy199 Server Support 3 31/03/2009 11:09 AM


All times are GMT. The time now is 06:02 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.