Checking if player is armed
#5

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:

Код:
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;
}
Reply


Messages In This Thread
Checking if player is armed - by Sam5513 - 24.08.2012, 19:56
Re: Checking if player is armed - by Memoryz - 24.08.2012, 20:03
Re: Checking if player is armed - by Roko_foko - 24.08.2012, 20:05
Re: Checking if player is armed - by Sam5513 - 24.08.2012, 20:30
Re: Checking if player is armed - by Sam5513 - 24.08.2012, 20:52
Re: Checking if player is armed - by clarencecuzz - 24.08.2012, 21:29
Re: Checking if player is armed - by Sam5513 - 24.08.2012, 21:51
Re: Checking if player is armed - by Sam5513 - 25.08.2012, 08:24
Re: Checking if player is armed - by Roko_foko - 25.08.2012, 10:44
Re: Checking if player is armed - by Sam5513 - 25.08.2012, 10:48

Forum Jump:


Users browsing this thread: 4 Guest(s)