[Include] Player Area's (OnPlayerEnterArea etc)
#35

This is all in Incognito's streamer anyways you should add area naming so people can do this....

OnEnterArea:AreaName(playerid) {}
OnExitArea:AreaName(playerid) {}

That way there isn't a heap load of congestion inside OnPlayerEnterArea() and OnPlayerExitArea()

Add something like this....

Код:
public OnPlayerEnterDynamicArea(playerid, areaid)
{
	for(new i = 0; i < MAX_AREAS; i++)
	{
        if(Areas[i][AreaID] == areaid)
        {
		    new Fname[50];
		    format(Fname, sizeof(Fname), "OnAr_%s", Areas[i][AreaName]);
		    CallLocalFunction(Fname, "i", playerid);
			break;
        }
	}
}

public OnPlayerLeaveDynamicArea(playerid, areaid)
{
	for(new i = 0; i < MAX_AREAS; i++)
	{
        if(Areas[i][AreaID] == areaid)
        {
		    new Fname[50];
		    format(Fname, sizeof(Fname), "ExitAr_%s", Areas[i][AreaName]);
		    CallLocalFunction(Fname, "i", playerid);
			break;
        }
	}
}

// macro
#define OnArea:%1(%2) \
	forward OnAr_%1(%2); \
	public OnAr_%1(%2)
	
#define ExitArea:%1(%2) \
	forward ExitAr_%1(%2); \
	public ExitAr_%1(%2)
Reply


Messages In This Thread
Player Area's (OnPlayerEnterArea etc) - by Kwarde - 21.02.2011, 17:55
Re: Player Area's (OnPlayerEnterArea etc) - by wups - 21.02.2011, 18:11
Re: Player Area's (OnPlayerEnterArea etc) - by Marricio - 21.02.2011, 18:14
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 21.02.2011, 18:42
Re: Player Area's (OnPlayerEnterArea etc) - by sleepysnowflake - 21.02.2011, 18:43
Re: Player Area's (OnPlayerEnterArea etc) - by Hiddos - 21.02.2011, 18:51
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 21.02.2011, 18:55
Re: Player Area's (OnPlayerEnterArea etc) - by wups - 21.02.2011, 19:27
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 21.02.2011, 19:31
Re: Player Area's (OnPlayerEnterArea etc) - by iMonk3y - 21.02.2011, 19:38
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 21.02.2011, 19:39
Re: Player Area's (OnPlayerEnterArea etc) - by justsomeguy - 21.02.2011, 19:41
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 21.02.2011, 19:42
Re: Player Area's (OnPlayerEnterArea etc) - by justsomeguy - 21.02.2011, 20:23
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 22.02.2011, 05:23
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 21.04.2011, 14:22
Re: Player Area's (OnPlayerEnterArea etc) - by justsomeguy - 24.04.2011, 15:16
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 27.04.2011, 08:28
Re: Player Area's (OnPlayerEnterArea etc) - by Markx - 27.04.2011, 08:35
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 27.04.2011, 08:57
Re: Player Area's (OnPlayerEnterArea etc) - by GangsTa_ - 25.07.2011, 07:01
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 25.07.2011, 08:40
Re: Player Area's (OnPlayerEnterArea etc) - by wups - 25.07.2011, 08:52
Re: Player Area's (OnPlayerEnterArea etc) - by GangsTa_ - 25.07.2011, 08:55
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 25.07.2011, 09:25
Re: Player Area's (OnPlayerEnterArea etc) - by GangsTa_ - 25.07.2011, 09:30
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 25.07.2011, 09:32
Re: Player Area's (OnPlayerEnterArea etc) - by GangsTa_ - 25.07.2011, 09:34
Re: Player Area's (OnPlayerEnterArea etc) - by CoaPsyFactor - 25.07.2011, 09:35
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 25.07.2011, 09:38
Re: Player Area's (OnPlayerEnterArea etc) - by Kaperstone - 10.08.2011, 04:14
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 10.08.2011, 05:44
Re: Player Area's (OnPlayerEnterArea etc) - by CoDeZ - 27.08.2012, 13:53
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 20.02.2013, 00:47
Re: Player Area's (OnPlayerEnterArea etc) - by Pottus - 20.02.2013, 04:00

Forum Jump:


Users browsing this thread: 4 Guest(s)