20.02.2013, 04:00
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....
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)