Hazard Warning via SetVehicleParamsEx
#1

Hello. I wanted to make a script which will turn off and on light automatically. I writed it but it doesn't works

Код:
#include <a_samp>

new timer1;
new timer2;
new engine,lights,alarm,doors,bonnet,boot,objective;

forward SwiatlaOn(playerid,vehicleid);
forward SwiatlaOFF(playerid,vehicleid);

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/awaryjne", cmdtext, true, 10) == 0)
	{
		timer1 = SetTimerEx("SwiatlaOn", 1000, 1, "i", playerid);
		timer2 = SetTimerEx("SwiatlaOFF", 2000, 1, "i", playerid);
		return 1;
	}
	if (strcmp("/awaryjne-off", cmdtext, true, 10) == 0)
	{
		KillTimer(timer1);
		KillTimer(timer2);
		return 1;
	}
	return 0;
}

public SwiatlaOn(playerid,vehicleid)
{
   new veh = GetPlayerVehicleID(playerid);
   GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
   SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
   GivePlayerMoney(playerid,4000);
   return 1;
}

public SwiatlaOFF(playerid,vehicleid)
{
   new veh = GetPlayerVehicleID(playerid);
   GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
   SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
   GivePlayerMoney(playerid,5000);
   return 1;
}
Reply


Messages In This Thread
Hazard Warning via SetVehicleParamsEx - by Gama101 - 23.02.2011, 08:41
Re: Hazard Warning via SetVehicleParamsEx - by (SF)Noobanatior - 23.02.2011, 09:33
Re: Hazard Warning via SetVehicleParamsEx - by Gama101 - 23.02.2011, 09:51
Re: Hazard Warning via SetVehicleParamsEx - by (SF)Noobanatior - 24.02.2011, 02:50
Re: Hazard Warning via SetVehicleParamsEx - by Gama101 - 24.02.2011, 13:09

Forum Jump:


Users browsing this thread: 1 Guest(s)