06.06.2013, 21:20
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;
}