Siren command is defective - 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 command is defective (
/showthread.php?tid=442313)
Siren command is defective -
lramos15 - 06.06.2013
I have made a siren command but when I type it , it puts the siren on my car and then when another player types it it takes the siren off the car how can I make it so it will only take it off the car if they're in my car and also so they can place more than one siren in the whole map here is the code
pawn Код:
CMD:siren(playerid, params[])
{
if(!IsValidObject(myobject))
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 560 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 415 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 541)
{
myobject = CreateObject(18646,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(myobject, GetPlayerVehicleID(playerid), 0.449999,0.000000,0.599999,0.000000,0.000000,0.000000);
}
}
else
{
DestroyObject(myobject);
}
return 1;
}
AW: Siren command is defective -
HurtLocker - 06.06.2013
new myobject[MAX_PLAYERS];
And on creation/destruction: myobject[playerid]
So each player has his own siren.
Re: Siren command is defective -
Vince - 06.06.2013
MAX_PLAYER array.
pawn Код:
new myobject[MAX_PLAYERS];
myobject[playerid] = CreateObject(...);
DestroyObject(myobject[playerid]);