18.05.2014, 02:12
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.
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; }