SA-MP Forums Archive
Parts of Vehicle System Dont work? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Parts of Vehicle System Dont work? (/showthread.php?tid=254706)



Parts of Vehicle System Dont work? - Dokins - 12.05.2011

Код:
/* ||-----------------------------0.3c Vehicle System Start-----------------------------------------------------------------------||*/
	if(strcmp(cmd, "/eon",true) == 0) {
		new vehicleid = GetPlayerVehicleID(playerid);
 		if(vehicleid != INVALID_VEHICLE_ID) {
		 	GetVehicleParamsEx(vehicleid, engine1, lights1, alarm1, doors1, bonnet1, boot1, objective1);
//                                 ||||||
		 	SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights1, alarm1, doors1, bonnet1, boot1, objective1);
//VEHICLE_PARAMS_ON is used to start the engine,it purely replace the engine thing!
	 	}
	 	return 1;
 	}
	if(strcmp(cmd, "/eoff",true) == 0) {
		 new vehicleid = GetPlayerVehicleID(playerid);
	     if(vehicleid != INVALID_VEHICLE_ID) {
 		 	GetVehicleParamsEx(vehicleid, engine1, lights1, alarm1, doors1, bonnet1, boot1, objective1);
//                                 ||||||
		 	SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights1, alarm1, doors1, bonnet1, boot1, objective1);
//Here the VEHICLE_PARAMS_OFF will turn off your engine.
		}
		return 1;
	}
	if(strcmp(cmd, "/lon",true)== 0) {
	    new vehicleid = GetPlayerVehicleID(playerid);
	    if(vehicleid != INVALID_VEHICLE_ID) {
	    	GetVehicleParamsEx(vehicleid, engine1, lights1, alarm1, doors1, bonnet1, boot1, objective1);
//                                 ||||||
			SetVehicleParamsEx(vehicleid, engine1, VEHICLE_PARAMS_ON, alarm1, doors1, bonnet1, boot1, objective1);
//VEHICLE_PARAMS_ON is used to turn the lights on
		}
		return 1;
	}
	if(strcmp(cmd, "/loff",true)== 0) {
	    new vehicleid = GetPlayerVehicleID(playerid);
	    if(vehicleid != INVALID_VEHICLE_ID) {
	    	GetVehicleParamsEx(vehicleid, engine1, lights1, alarm1, doors1, bonnet1, boot1, objective1);
//                                 ||||||
			SetVehicleParamsEx(vehicleid, engine1, VEHICLE_PARAMS_OFF, alarm1, doors1, bonnet1, boot1, objective1);
//VEHICLE_PARAMS_ON is used to turn the lights off
		}
		return 1;
	}
		if(strcmp(cmd, "/bonnet open",true)== 0) {
 		new vehicleid = GetPlayerVehicleID(playerid);
  		if(vehicleid != INVALID_VEHICLE_ID) {
	    	GetVehicleParamsEx(vehicleid, engine1, lights1, alarm1, doors1, bonnet1, boot1, objective1);
//                                 ||||||
			SetVehicleParamsEx(vehicleid, engine1, lights1, alarm1, doors1, VEHICLE_PARAMS_ON, boot1, objective1);
//VEHICLE_PARAMS_ON is used to open the bonnet
		}
		return 1;
	}
		if(strcmp(cmd, "/bonnet close",true)== 0) {
 		new vehicleid = GetPlayerVehicleID(playerid);
  		if(vehicleid != INVALID_VEHICLE_ID) {
	    	GetVehicleParamsEx(vehicleid, engine1, lights1, alarm1, doors1, bonnet1, boot1, objective1);
//                                 ||||||
			SetVehicleParamsEx(vehicleid, engine1, lights1, alarm1, doors1, VEHICLE_PARAMS_OFF, boot1, objective1);
//VEHICLE_PARAMS_OFF is used to close the bonnet
		}
		return 1;
	}
The /eon (engine on) and /eoff work.

can someone tell me why the rest dont?

Edit: The reason why it says engine1, lights1 etc is because engine,lights etc is used elsewhere in the script for a trunk system which I didnt code. I defined the engine1, lights1 etc, and the engine works, but the rest dont!