
//put this in "OnGameModeInit()"
SetTimer("CheckZone", 100, true);
forward CheckZone();
public CheckZone()
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(!IsPlayerInZone(i, "Los Santos"))
{
SetPlayerWantedLevel(i, 1), // change the 1 with the desired wanted level
}
}
}
}
public CheckZone()
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(!IsPlayerInZone(i, "Los Santos"))
{
new string[256];
WantedPoints[i]+=2;
format(string, sizeof(string), "You left Los Santos! The Police is looking for you!!!");
SendClientMessage(i, COLOR_RED, string);
}
}
}
}
|
Originally Posted by Don Correlli
This will just give player wanted level 1 and spam him with message "You left Los Santos! The Police is looking for you!!!" every 100 miliseconds.
|
new broj[MAX_PLAYERS];
public CheckZone()
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInArea(i, 2721.616210, -513.000244, 2326.376708, -364.872253) || IsPlayerInArea(i, 2971.905273, -115.112945, -671.811584, -2803.755126))
{
}else {
if(broj[i] > 0)
{
new string[256];
format(string, sizeof(string), "~b~~n~~n~~n~~n~~n~~n~~n~~n~~n~You Left ~w~Los Santos~b~ ! Police is looking for you !!!");
GameTextForPlayer(i,string,600,3);
}else {
if(IsACop(i))
{
new string[256];
format(string, sizeof(string), "~b~~n~~n~~n~~n~~n~~n~~n~~n~~n~You Left ~w~Los Santos~b~ !");
GameTextForPlayer(i,string,600,3);
}else {
WantedPoints[i]+=3; SetPlayerCriminal(i,255, "Left Los Santos");
broj[i]++;
new string[256];
format(string, sizeof(string), "~b~~n~~n~~n~~n~~n~~n~~n~~n~~n~You Left ~w~Los Santos~b~ ! Police is looking for you !!!");
GameTextForPlayer(i,string,600,3);
}
}
}
}
}
}