Gang Zone
#7

Quote:
Originally Posted by Antonio [G-RP]
View Post
By telling him to change it to stock, you aren't teaching him WHAT that error means..
Jeez, you came back, the forum was better without your useless posts, just to increase your post count. But whatever, i'm not here posting to watch your idiotic comments.

Anyway, back to the topic. All you need to do is set a timer and check if the player is in the area, here is a snippet.

pawn Code:
new ZoneScriptData[MAX_PLAYERS][2];

public OnPlayerConnect(playerid) {
    ZoneScriptData[playerid][0] = -1;
    ZoneScriptData[playerid][1] = SetTimerEx(playerid, "CheckZone", 1000, 1, "i", playerid);
    return 1;
}

forward CheckZone(playerid);
public CheckZone(playerid) {
    if(IsPlayerInArea(MyGangZoneCoordinates)) // Red zone.
    {
         GameTextForPlayer(playerid, "You're in the red zone", 3000, 5);
         ZoneScriptData[playerid][0] = 1; // Redzone.
    }
    else if(IsPlayerInArea(MyGangZoneCoordinates)) // Red zone.
    {
         GameTextForPlayer(playerid, "You're in the green zone", 3000, 5);
         ZoneScriptData[playerid][0] = 2; // Greenzone.
    }
}

public OnPlayerDisconnect(playerid) {
    KillTimer(ZoneScriptData[playerid][1]);
}
Reply


Messages In This Thread
Gang Zone - by shoru93 - 06.07.2010, 21:37
Re: Gang Zone - by Carlton - 06.07.2010, 21:46
Re: Gang Zone - by shoru93 - 06.07.2010, 21:52
Re: Gang Zone - by Carlton - 06.07.2010, 21:53
Re: Gang Zone - by shoru93 - 06.07.2010, 21:56
Re: Gang Zone - by Antonio [G-RP] - 06.07.2010, 21:57
Re: Gang Zone - by Carlton - 06.07.2010, 22:04
Re: Gang Zone - by shoru93 - 06.07.2010, 22:17
Re: Gang Zone - by shoru93 - 06.07.2010, 22:25
Re: Gang Zone - by Carlton - 06.07.2010, 22:28

Forum Jump:


Users browsing this thread: 2 Guest(s)