Siren - 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 (
/showthread.php?tid=343746)
Siren -
Alphonse - 18.05.2012
how can i put a siren on burrito(id 482) or (sultan 560) like this.
http://www.youtube.com/watch?feature...&v=y5_xbQ_ObbE
Re: Siren -
ProjectGANTON - 18.05.2012
Using zCmd:
PHP код:
COMMAND:siren(playerid,params[])
{
new 1siren = CreateObject(18646,0,0,0,0,0,0);
new 2siren = CreateObject(18646,0,0,0,0,0,0);
AttachObjectToVehicle(1siren, GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
AttachObjectToVehicle(2siren, GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
return 1;
}
You have to create a enum for vehicles, where there's a variable called vehiclesiren,
So, /siren = > Add Objects and set variable to 1, again /siren = > Remove Objects and set variable to 0. (Without variable you can't do Delete Siren)
Header:
PHP код:
#define MAX_VEHICLES selectmaxvehicles
enum VehiclesProperties {
UsingSiren,
Siren1,
Siren2
}
new VehicleInfo[MAX_VEHICLES][VehicleProperties];
Command:
PHP код:
COMMAND:siren(playerid,params[])
{
new vehicle = GetPlayerVehicleID(playerid);
VehicleInfo[vehicleid][Siren1] = CreateObject(18646,0,0,0,0,0,0);
VehicleInfo[vehicleid][Siren2] = CreateObject(18646,0,0,0,0,0,0);
if(VehicleInfo[vehicle][UsingSiren] == 0)
{
AttachObjectToVehicle(VehicleInfo[vehicleid][Siren1], GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
AttachObjectToVehicle(VehicleInfo[vehicleid][Siren2], GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
VehicleInfo[vehicle][UsingSiren] = 1;
}
else
{
DestroyObject(VehicleInfo[vehicleid][Siren1]);
DestroyObject(VehicleInfo[vehicleid][Siren2]);
VehicleInfo[vehicle][UsingSiren] = 0;
}
}
This should work.