Offline Prison help
#2

Hopefully this code below will give you a little insight into what you will be required to complete in order for your code to check if a player has been prisoned or not

Please place the first peice of coding where you check where the player spawns.

Код:
if(PlayerInfo[playerid][pPrison] != 0)
{
	new player = [MAX_PLAYERS]
	if(PlayerInfo[playerid][pPrisonTime] > 0)
	{
		SetPlayerPos(playerid, x, y, z);
		SetPlayerVirtualWorld(playerid, player++);
		SetPlayerInterior(playerid, InteriorID);
		SendClientMessage(playerid, -1, "ADMIN NOTICE: You have not completed your admin jail sentence - You have been returned to complete it");
		SetTimerEx("CheckPrison", 1000, true, "i", playerid);
	}
	return 1;
}

forward CheckPrison(playerid);
public CheckPrison(playerid)
{
	if(IsPlayerConnected(playerid))
	{
		if(PlayerInfo[playerid][pPrisonTime] > 0)
		{
			PlayerInfo[playerid][pPrisonTime] --;
			return 1;
		}
		else if(PlayerInfo[playerid][pPrisonTime] == 0)
		{
			PlayerInfo[playerid][pPrison] == 0;
			PlayerInfo[playerid][pPrisonReason] == 0;
			PlayerInfo[playerid][pPrisonedBy] == 0;
			SetPlayerPos(playerid, x, y, z);
			SetPlayerVirtualWorld(playerid, 0);
			SetPlayerInterior(playerid, 0);
			SendClientMessage(playerid, -1, "ADMIN NOTICE: You have been released from jail - Please try not to break the rules again");
			KillTimerEx("CheckPrison");
			return 1;
		}
	}
	return 1;
}
Reply


Messages In This Thread
Offline Prison help - by lulo356 - 17.05.2014, 23:38
Re: Offline Prison help - by Ciandlah - 18.05.2014, 02:12
Re: Offline Prison help - by lulo356 - 18.05.2014, 12:07
AW: Offline Prison help - by rospar - 18.05.2014, 12:43
Re: Offline Prison help - by lulo356 - 18.05.2014, 12:55
Re: Offline Prison help - by lulo356 - 20.05.2014, 15:56
Re: Offline Prison help - by Rittik - 20.05.2014, 16:25

Forum Jump:


Users browsing this thread: 2 Guest(s)