SA-MP Forums Archive
Siren thingy - 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)
+--- Thread: Siren thingy (/showthread.php?tid=597759)



Siren thingy - yvoms - 04.01.2016

Would this work?

Код:
public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
{
	new siren = GetVehicleParamsSirenState(vehicleid);
	if(PLAYER_STATE_DRIVER && ServerVehicle[vehicleid][Type] == VEHICLE_TYPE_GLOBAL)
	{
	    if(siren == 1)
		{
			siren = 0;
			return 1;
		}
		else
	    {
			siren = 1;
			return 1;
	    }
	}
	return 1;
}



Re: Siren thingy - Vince - 04.01.2016

A local variable is set, but it isn't used afterwards so this code does absolutely nothing at all. GetVehicleParamsSirenState is also completely redundant because you already have the newstate parameter which contains that value.