When the player leave from area (+Rep)
#9

There is no need for a timer because in samp exists areas where you can use a callback "OnPlayerLeaveDynamicArea" (streamer is required)

Example:

Code:
new areaID, zona;

public OnGameModeInit()
{
	areaID = CreateDynamicRectangle(0.0, 0.0, 50.0, 50.0);
	zona = GangZoneCreate(0.0, 0.0, 50.0, 50.0);
	GangZoneShowForAll(zona, G_RED);
	return 1;
}

public OnPlayerLeaveDynamicArea(playerid, areaid) {
	if(areaid == areaID) {
		SendClientMessage(playerid, -1, "You have leaved that area!");
	}
	return 1;
}

public OnPlayerEnterDynamicArea(playerid, areaid) {
	if(areaid == areaID) {
		SendClientMessage(playerid, -1, "You have entered that area!");
	}
	return 1;
}


EDIT: to pick the cordinates you save the cordinates of the diagonal of your rectangle or you use

Code:
CreateDynamicCircle(x, y, size)

In my case the saved cordinates are
first point - x = 0, y = 0 (start of the diagonal)
second point - x = 50, y = 50 (end of the diagonal)

SRY for bad english
Reply


Messages In This Thread
When the player leave from area (+Rep) - by Trynda - 22.05.2014, 12:21
Re: When the player leave from area (+Rep) - by ball - 22.05.2014, 12:24
Re: When the player leave from area (+Rep) - by Lordzy - 22.05.2014, 12:27
Re: When the player leave from area (+Rep) - by Trynda - 22.05.2014, 13:20
Re: When the player leave from area (+Rep) - by NoSoap - 22.05.2014, 13:24
Re: When the player leave from area (+Rep) - by Trynda - 22.05.2014, 13:28
Re: When the player leave from area (+Rep) - by Mark_Weston - 22.05.2014, 13:30
Re: When the player leave from area (+Rep) - by Trynda - 22.05.2014, 13:38
Re: When the player leave from area (+Rep) - by Pasa - 22.05.2014, 14:06
Re: When the player leave from area (+Rep) - by Vince - 23.05.2014, 07:35

Forum Jump:


Users browsing this thread: 1 Guest(s)