OnVehicle
#1

hi

how do i set this OnVehicleSpawn

Every vehicle spawn the vehicle engine is 0

and Every time when player enter a car and if the vehicle engine is 0 it will send a message like this:

"Your vehicle engine is not turned on! type /car engine if you used to turn on"

Код:
else if(strcmp(params, "engine", true) == 0 && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
	    new vehicle = GetPlayerVehicleID(playerid);
	    new string[126];
      	new engine, lights, alarm, doors, bonnet, boot, objective;
	    GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);

	    if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	    {
	        if(Engine[vehicle] == 0)
	        {
	            Engine[vehicle] = 1;
	            SetVehicleParamsEx(vehicle,1,lights,alarm,doors,bonnet,boot,objective);
	            format(string, sizeof(string), "* %s turns the engine of their vehicle engine on.", GetPlayerNameEx(playerid));
	            ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	            return 1;
	        }
	        else
	        {
	            Engine[vehicle] = 0;
	            SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bonnet,boot,objective);
	            format(string, sizeof(string), "* %s turns the vehicles engine off.", GetPlayerNameEx(playerid));
	            ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	            return 1;
	        }
	    }
	    return engine;
	}
TY
Reply


Messages In This Thread
OnVehicle - by ChristianIvann09 - 24.04.2014, 11:24
Re: OnVehicle - by arakuta - 24.04.2014, 12:31
Re: OnVehicle - by ChristianIvann09 - 24.04.2014, 13:19
Re: OnVehicle - by Konstantinos - 24.04.2014, 13:23
Re: OnVehicle - by ChristianIvann09 - 24.04.2014, 13:24
Re: OnVehicle - by Konstantinos - 24.04.2014, 13:26
Re: OnVehicle - by ChristianIvann09 - 24.04.2014, 13:29
Re: OnVehicle - by arakuta - 24.04.2014, 13:31
Re: OnVehicle - by Konstantinos - 24.04.2014, 13:34
Re: OnVehicle - by blackeagle1122 - 24.04.2014, 13:50

Forum Jump:


Users browsing this thread: 1 Guest(s)