Siren attach but not deleting? - 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 attach but not deleting? (
/showthread.php?tid=366262)
Siren attach but not deleting? -
DeeCaay - 05.08.2012
Quote:
new objectid = CreateObject(18646, 0, 0, 0, 0, 0, 0);
AttachObjectToVehicle(objectid, GetPlayerVehicleID(playerid), 0.009999, -0.019999, 0.944999, 0.000000, 0.000000, 0.000000); //Object Model: 19419 |
SendClientMessage(playerid, COLOR_RED, "You've Added a siren to your vehicle");
|
i tried /sirenoff code: DestroyObject(18646); Not worked.
Re: Siren attach but not deleting? -
SnG.Scot_MisCuDI - 05.08.2012
Re : Re: Siren attach but not deleting? -
DeeCaay - 05.08.2012
Quote:
Originally Posted by SnG.Scot_MisCuDI
|
Not working.
Re: Siren attach but not deleting? -
Ranama - 05.08.2012
You'll have to define it within the global scope, and you'll need to make one slot for every car you want to be able to set it on.
This forum requires that you wait 120 seconds between posts. Please try again in 44 seconds. ;(
Re: Siren attach but not deleting? -
Jstylezzz - 05.08.2012
Use this "system":
This above OnGameModeInit, OUTSIDE any callback:
pawn Код:
new sirenon[MAX_VEHICLES];
This under OnGameModeInit, AFTER you created all the vehicles:
pawn Код:
for(new vehicleid=0;vehicleid<=MAX_VEHICLES;vehicleid++)
{
sirenon[vehicleid] = CreateDynamicObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
}
This at the bottom of your script:
pawn Код:
CMD:siren(playerid,params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"You are not in any vehicle");
AttachObjectToVehicle(siren[vehicleid],(GetPlayerVehicleID(playerid)), 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);
return 1;
}
CMD:nosiren(playerid,params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"You are not in any vehicle");
DestroyObject(siren[vehicleid]);
return 1;
}
Hope this helps you