24.08.2012, 20:52
Im not sure if I did what you wanted to do but I tried implementing it in my script. What happend though was that once I was in the range, no matter if I had weapon or not, the sirens spawned and when I left the area, they wouldnt despawn.
Code:
Code:
Код:
new bool:SirenCreated; new obj1; new obj2; public OnPlayerUpdate(playerid) { if(IsPlayerInRangeOfPoint(playerid, 0.3, 1207.0170, -1333.9816, 13.3984) && SirenCreated == false) { for (new i = 0; i < 13; i++) { new checkdata[2]; GetPlayerWeaponData(playerid, i, checkdata[0], checkdata[1]); if(checkdata[0] !=255) { SirenCreated = true; obj1 = CreateObject(18646, 1207.5631, -1334.1051, 13.5816, 0.0, 0.0, 0.0); obj2 = CreateObject(18646, 1206.5031, -1334.1051, 13.5816, 0.0, 0.0, 0.0); } if(!IsPlayerInRangeOfPoint(playerid, 0.3, 1207.0170, -1333.9816, 13.3984) && SirenCreated == true) { SirenCreated = false; DestroyObject(obj1); DestroyObject(obj2); } } } return 1; }