Despawning object.
#7

Quote:
Originally Posted by Shetch
Посмотреть сообщение
Try this.

Код:
new bool:SirenCreated;
new obj1;
new obj2;

public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 0.1, 1207.0170, -1333.9816, 13.3984) && SirenCreated == false)
    {
		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.1, 1207.0170, -1333.9816, 13.3984) && SirenCreated == true)
	{
            SirenCreated = false;
	    DestroyObject(obj1);
	    DestroyObject(obj2);
	}
    return 1;
}
Works perfectly! Thank you very much!
I have one more question though. Do you think you would know a way to make it shine with all those colors like some unmarked cruisers have on rp servers? It would be great.


EDIT: I found out I only have to set the weather to 2 for the siren flashing to work. Thanks anyways for all who helped and all who were trying to help! Appreciate it.
Reply


Messages In This Thread
Checking if player is armed. - by Sam5513 - 24.08.2012, 16:42
Re: Despawning object. - by RedJohn - 24.08.2012, 17:10
Re: Despawning object. - by Sam5513 - 24.08.2012, 17:23
Re: Despawning object. - by HuSs3n - 24.08.2012, 17:28
Re: Despawning object. - by Shetch - 24.08.2012, 17:31
Re: Despawning object. - by Sam5513 - 24.08.2012, 17:40
Re: Despawning object. - by Sam5513 - 24.08.2012, 17:42
Re: Despawning object. - by Sam5513 - 24.08.2012, 19:17

Forum Jump:


Users browsing this thread: 1 Guest(s)