Siren
#2

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(1sirenGetPlayerVehicleID(playerid), -0.5, -0.20.82.02.03.0);
AttachObjectToVehicle(2sirenGetPlayerVehicleID(playerid), -0.5, -0.20.82.02.03.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.20.82.02.03.0);
AttachObjectToVehicle(VehicleInfo[vehicleid][Siren2], GetPlayerVehicleID(playerid), -0.5, -0.20.82.02.03.0);
VehicleInfo[vehicle][UsingSiren] = 1;
}
else
{
DestroyObject(VehicleInfo[vehicleid][Siren1]);
DestroyObject(VehicleInfo[vehicleid][Siren2]);
VehicleInfo[vehicle][UsingSiren] = 0;
}

This should work.
Reply


Messages In This Thread
Siren - by Alphonse - 18.05.2012, 19:06
Re: Siren - by ProjectGANTON - 18.05.2012, 19:51

Forum Jump:


Users browsing this thread: 1 Guest(s)