Auto-Jail
#1

Hi.

How can I make when you wanted and you / q when you're chased by police to jail automatically give you after you reconnect?
Reply
#2

You can't request scripts, this section is for scripting help ONLY.
Reply
#3

You need to set Jail varaible to 1 when some budy /q and when he join call the jail varaible which is 1 and
if his jail varaible is 1 set his position to jail hope you understand
Reply
#4

Try It Like This
Код:
if (IsSuspectInRangeOfPolice3(playerid) && PlayerInfo[playerid][pWantedLevel] > 5)
	{
		PlayerInfo[playerid][pJailed] =1;
	}
Код:
if (IsSuspectInRangeOfPolice3(playerid)
This Will Check If That Criminal Is In Range Of Police

Код:
PlayerInfo[playerid][pWantedLevel] > 5
If The Player Is Criminal And Is In Range Of Police

Код:
PlayerInfo[playerid][pJailed] =1;
And If He Quit He Will Be Jailed

Note:You Need To Create Like This Depending on your gamemode

Dont Forget To Place It Under OnPlayerDisconnect
Reply
#5

Such as?

Код:
 public IsSuspectInRangeOfPolice3(playerid)
          {
           return 1;
}
And the public to put something?

IsPlayerInRangeOfPoint(playerid, 15.0, x, y, z

?
Reply
#6

Код:
stock IsSuspectInRangeOfPolice3(suspectid)
{
	new Float:suspectX, Float:suspectY, Float:suspectZ;

	GetPlayerPos(suspectid, suspectX, suspectY, suspectZ);

	for (new i = 0; i < GetMaxPlayers(); i++)
	{
		if (IsPlayerConnected(i) && i != suspectid && PlayerInfo[i][pSpawn] == 1 && PlayerInfo[suspectid][pBribeExpireTime] == 0)
		{

			if (PlayerInfo[i][pSkill] == SKILL_COP || PlayerInfo[i][pVigilante] == 1)
			{

				if (GetPlayerVirtualWorld(suspectid) == 0)
				{
					if (IsPlayerInRangeOfPoint(i, 200.0, suspectX, suspectY, suspectZ))
					{

						return 1;
					}

				}else{
					if (IsPlayerInRangeOfPoint(i, 200.0, suspectX, suspectY, suspectZ) || IsPlayerInRangeOfPoint(i, 100.0, PlayerInfo[suspectid][pLastOutSideX],PlayerInfo[suspectid][pLastOutSideY],PlayerInfo[suspectid][pLastOutSideZ]))
					{

						return 1;
					}
				}
			}

		}
	}
	return 0;
}
Something Like This
Reply
#7

Okay, if I am not this:
pSkill, pVigilante , pBribeExpireTime I delete them?

And..

pLastOutSideX, pLastOutSideY, pLastOutSideZ

Thanks for help +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)