jailing command
#6

first of all dont define one things 2x time

PHP код:
if(sscanf(params"uis[64]"playerbtimeparams))
//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"5000false"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(Playerplayerid
    { 
        if(
pInfo[playerid][Jailed] == 2
        { 
            
pInfo[playerid][Jailed] = 0
            
pInfo[playerid][JailedTime] = 0
            
SetPlayerInterior(playerid0); 
            
SetPlayerVirtualWorld(playerid0); 
            
SetPlayerFacingAngle(playerid88.5042); 
            
SetPlayerColor(playeriderror); 
            
SetPlayerPos(playerid1548.8394,-1669.6111,13.5656); 
            
SetCameraBehindPlayer(playerid); 
            
SendClientMessage(playeridjblue" 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(playeridstring15003); 
        } 
    } 
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(i0);
                
SetPlayerVirtualWorld(i0);
                
SetPlayerFacingAngle(i88.5042);
                
SetPlayerColor(ierror);
                    
SetPlayerPos(i1548.8394,-1669.6111,13.5656);
                
SetCameraBehindPlayer(i);
                    
SendClientMessage(ijblue" 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(istring15003);
            }
        }
    }
    return 
1;

Reply


Messages In This Thread
jailing command - by 1fret - 17.04.2017, 03:32
Re: jailing command - by sams90 - 17.04.2017, 03:48
Re: jailing command - by 1fret - 17.04.2017, 03:56
Re: jailing command - by sams90 - 17.04.2017, 03:56
Re: jailing command - by 1fret - 17.04.2017, 04:25
Re: jailing command - by khRamin78 - 17.04.2017, 05:48
Re: jailing command - by 1fret - 17.04.2017, 19:39
Re: jailing command - by khRamin78 - 17.04.2017, 19:42
Re: jailing command - by 1fret - 17.04.2017, 19:45

Forum Jump:


Users browsing this thread: 2 Guest(s)