17.04.2017, 05:48
first of all dont define one things 2x time
then why are you using this at if (time == 0) ?
and why are you setting timers 2x time ?
and can you explain me how it works ?
im sure this will work for you
PHP код:
if(sscanf(params, "uis[64]", playerb, time, params))
//you are defining params 2x times upthere try new reason[]; instead of params
PHP код:
RandomCell = random(sizeof(RandomJails));
PHP код:
SetTimerEx("EnterExitTimer", 5000, false, "i", playerb);
PHP код:
// in top you are setting pInfo[playerid][Jailed] == 2 when a player gets jailed by admin
// and in down you are checking if pInfo[playerid][Jailed] == 2 so :S when the else part is called ?
foreach(Player, playerid)
{
if(pInfo[playerid][Jailed] == 2)
{
pInfo[playerid][Jailed] = 0;
pInfo[playerid][JailedTime] = 0;
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerFacingAngle(playerid, 88.5042);
SetPlayerColor(playerid, error);
SetPlayerPos(playerid, 1548.8394,-1669.6111,13.5656);
SetCameraBehindPlayer(playerid);
SendClientMessage(playerid, jblue, " Time Served. Be on your best behaviour now :) .");
}
else
{
new string[128];
pInfo[playerid][JailedTime] --;
format(string,sizeof(string),"~r~Jailed Time Left: ~w~%d ~r~seconds", pInfo[playerid][JailedTime]);
GameTextForPlayer(playerid, string, 1500, 3);
}
}
PHP код:
public PrisonTimer()
{
for(new i;i<MAX_PLAYERS;i++)
{
if(pInfo[i][Jailed] > 0)
{
if(pInfo[i][JailedTime] == 0)
{
pInfo[i][Jailed] = 0;
SetPlayerInterior(i, 0);
SetPlayerVirtualWorld(i, 0);
SetPlayerFacingAngle(i, 88.5042);
SetPlayerColor(i, error);
SetPlayerPos(i, 1548.8394,-1669.6111,13.5656);
SetCameraBehindPlayer(i);
SendClientMessage(i, jblue, " Time Served. Be on your best behaviour now :) .");
}
else
{
new string[128];
pInfo[i][JailedTime] --;
format(string,sizeof(string),"~r~Jailed Time Left: ~w~%d ~r~seconds", pInfo[i][JailedTime]);
GameTextForPlayer(i, string, 1500, 3);
}
}
}
return 1;
}