06.07.2010, 22:04
Quote:
By telling him to change it to stock, you aren't teaching him WHAT that error means..
|
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]);
}