Hotwire cars
#1

Код:
if(newstate == PLAYER_STATE_DRIVER)
    {
		if(GetPlayerVehicleID(playerid) == kradi[1] || GetPlayerVehicleID(playerid) == kradi[2] || GetPlayerVehicleID(playerid) == kradi[3] || GetPlayerVehicleID(playerid) == kradi[4] || GetPlayerVehicleID(playerid) == kradi[5] || GetPlayerVehicleID(playerid) == kradi[6] || GetPlayerVehicleID(playerid) == kradi[7] || GetPlayerVehicleID(playerid) == kradi[8] || GetPlayerVehicleID(playerid) == kradi[9] || GetPlayerVehicleID(playerid) == kradi[4])
		{

		    SendClientMessage(playerid, COLOR_RED, "To hotwire this vehicle use /hotwire");
		}
	}
	if(newstate == PLAYER_STATE_DRIVER)
    {
		if(GetPlayerVehicleID(playerid) == kradi[10])
		{
			SendClientMessage(playerid, COLOR_RED, "To hotwire this vehicle use  /hotwire");
		}
	}
These are my cars which must be hotwired when you enter.

Now... This is my code when ppl enter in vehicle. ( The engine can be start with /engine )
Код:
	if(newstate == PLAYER_STATE_DRIVER && oldstate != PLAYER_STATE_DRIVER)
	{
	    new vehicleid = GetPlayerVehicleID(playerid);
	    new engine, lights, alarm, doors, bonnet, boot, objective;
		GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
		if(!engine) SendClientMessage(playerid, COLOR_WHITE, "Можете да запалите/изгасите двигателя на колата с {FF6347}/engine{FFFFFF}.");
		if(!PlayerInfo[playerid][pCarLic]) SendClientMessage(playerid, COLOR_LIGHTRED, "Нямаш книжка . Спазвай закона и се пази от полицията !");
		if(IsATowTruck(vehicleid)) SendClientMessage(playerid, COLOR_WHITE, "За да закачите кола използвайте {FF6347}/tow{FFFFFF}.");
	}
I need to remake it , so when the player is in the "kradi" vehicle he can do /hotwire. When he write /hotwire there will be timer around 5-6 seconds.. After this timer he can drive the car.
Reply
#2

Okay, so use SetTimerEx and then inside the function that the timer calls sets the engine to be started.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)