Posts: 617
Threads: 129
Joined: Feb 2014
Quote:
Originally Posted by khRamin78
first of all dont define one things 2x time
PHP код:
if(sscanf(params, "uis[64]", playerb, time, params))
//you are defining params 2x times upthere try new reason[]; instead of params
then why are you using this at if (time == 0) ?
PHP код:
RandomCell = random(sizeof(RandomJails));
and why are you setting timers 2x time ?
PHP код:
SetTimerEx("EnterExitTimer", 5000, false, "i", playerb);
and can you explain me how it works ?
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);
}
}
im sure this will work for you
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;
}
|
You guys are not getting the issue at hand, the issue is the timer wont count down the players jailed time to release them, thats the issue...
And the enterexittimer freezes players cause i used a mapped prison so it load the objects then unfreeze the players