When player leave LS
#1

Hey all,

can someone code me script so when player leav borders of LS then he got wanted level


Sry for my bad English
Reply
#2

No.. Go to Script Request Thread.
Reply
#3

first use this include
http://forum.sa-mp.com/index.php?topic=44902.0
then detecte if the player in the zone
set a timer in "OnGameModeInit" wuch have the interval 100 and it repeats itself
then check the zone by using "IsPlayerInZone"
this is an example
pawn Код:
//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
}
}
}
}
Reply
#4

OK, I added forward CheckZone(); at the top of script under all defines, then I added
Код:
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);
			}
		}
	}
}
above OnGameModeInit() and I added SetTimer("CheckZone", 100, true); in OnGameModeInit() and I got when I enter server immediately it start to write You left Los Santos! The Police is looking for you!!! every second :S
Reply
#5

so try to change "if(!InPlayer..." by "if(IsPlayer..."
Reply
#6

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.
Reply
#7

Quote:
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.
True...

Nothing changed
Reply
#8

Код:
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);
  				}
				}
			}
		}
	}
}
And I think this works...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)