[Ajuda] Agendar Prisгo
#1

Olб! adaptei um sistema de prisгo em minha gm,coloquei o comando e no OnPlayerConnect,porem quando eu agendo a prisгo de um determinado jogador,na hora do mesmo logar,aparece isso:

https://imgur.com/b1nDwa3

Comando:

PHP код:
 if( !strcmpcmd"/cadeiaoff"true ))
    {
    if(
pAdmin[playerid] == || pAdmin[playerid] == || pAdmin[playerid] == || pAdmin[playerid] == || pAdmin[playerid] == || guardiao[playerid]){
    {
    
tmp2 strtokcmdtextidx );
    if( !
strlentmp2 ))
    {
    
SendClientMessageplayeridVermelho"| ERRO | Digite: /CadeiaOff [Nick] [Tempo] [Motivo]" );
    return 
1;
    }
    
format(filesizeof(file ), "Contas/%s.ini"tmp2 );
    if( !
fexistfile ))
    {
    
SendClientMessageplayeridVermelho"| ERRO | Nгo existe nenhuma conta com esse nick !" );
    return 
1;
    }
    
tmp strtokcmdtextidx );
    if( ! 
strlentmp ))
    {
    
SendClientMessageplayeridVermelho"| ERRO | Digite: /CadeiaOff [Nick] [Tempo] [Motivo]" );
    return 
1;
    }
    new
    
iTempo strvaltmp )
    ;
    if( 
iTempo || iTempo 600 )
    {
    
SendClientMessageplayeridVermelho"| ERRO | Tempo somente de 1 а 600 minutos ! " );
    return 
1;
    }
    new 
length strlencmdtext );
    while (( 
idx length ) && ( cmdtextidx ] <= ' ' ))
    {
    
idx++;
    }
    new 
offset idx;
    new 
result64 ];
    while (( 
idx length ) && (( idx offset ) < ( sizeofresult ) - )) )
    {
    
resultidx offset ] = cmdtextidx ];
    
idx++;
    }
    
resultidx offset ] = EOS;
    if( !
strlenresult ))
    {
    
SendClientMessageplayeridVermelho"| ERRO | Digite: /CadeiaOff [Nick] [Tempo] [Motivo]" );
    return 
1;
    }
    new 
sistemacadeia[200];
    
format(sistemacadeiasizeof(sistemacadeia), "| BFC-Admin | O(A) %s %s agendou a prisгo do(a) jogador(a) %s por %d minutos ( Motivo: %s )"CargoAdmin(playerid), PlayerName(playerid), tmp2iTemporesult);
    
SendClientMessageToAll(0xB0FF30AAsistemacadeia);
    
dini_Set(file"MotivoPrisao"result);
    
dini_IntSetfile"Abuser");
    
dini_IntSetfile"pPreso"iTempo*60 );
    }
    }
    return 
1;
    } 
OnPlayerConnect:

PHP код:
     if(PlayerInfo[playerid][Abuser] == ){
    
LiberarPrisao(playerid);
    new 
CadeiaMotivo[128];
    new 
msg[128];
    
format(CadeiaMotivosizeof(CadeiaMotivo), "%s"dini_Get(file"MotivoPrisao"));
    
SendClientMessage(playerid0x1875CCAA,"=================================== Preso ===================================");
    
SendClientMessage(playerid0xFFFFFFAA,"» Vocк recebeu uma puniзгo de cadeia estando online / offline  por um admin!");
    
format(msg128"» Prisгo ( Motivo: %s )"CadeiaMotivo);
    
SendClientMessage(playerid0xFFFFFFAAmsg);
    
SendClientMessage(playerid0x1875CCAA,"=================================== Preso ===================================");
    
SetPlayerPos(playerid223.0951,109.5349,999.0156);
    
SetPlayerInteriorplayerid,9);
    } 
Forward LiberarPrisгo:
PHP код:
forward LiberarPrisaoplayerid );
public 
LiberarPrisaoplayerid )
{
if(
PlayerInfoplayerid ][pPreso ] <= )
{
KillTimerT_Presoplayerid ] );
TextDrawHideForPlayerplayeridp_TextPresoplayerid ] );
SendClientMessageplayerid0xA9C4E4AA"| INFO | Vocк cumpriu sua pena e estб livre novamente!" );
SetPlayerPosplayerid1551.6987,-1675.3806,15.9631);
SetPlayerInteriorplayerid);
SetPlayerWantedLevelplayerid);
PlayerInfoplayerid ][ pPreso ] = 0;
PlayerInfoplayerid ][ Abuser ] = 0;
SetPlayerHealthplayerid100.0 );
GameTextForPlayerplayerid"~w~SOLTO!"3000);
format(filesizeof(file ), "Contas/%s.ini"PlayerNameplayerid ));
dini_IntSet(file"Abuser");
TextDrawShowForPlayer(playerid,UPRelogio[playerid]);
return 
1;
}
if(
PlayerInfo playerid ][ pPreso ] >= )
{
TextDrawHideForPlayer(playerid,UPRelogio[playerid]);
PlayerInfoplayerid ][ pPreso ] --;
T_Presoplayerid ] = SetTimerEx"LiberarPrisao"1000false"d"playerid );
new
d_Horas1,
d_Minut1,
d_Segun1
;
formatSecondsPlayerInfoplayerid ][ pPreso ], d_Horas1d_Minut1d_Segun1 );
if( 
d_Horas1 )
{
formatgstringsizeofgstring ), "~r~~h~Tempo de Prisao~n~~g~~h~Hora(s): %d~n~~p~~h~Minutos: ~w~%d~n~~b~~h~Segundos: ~w~%d"d_Horas1d_Minut1d_Segun1 );
TextDrawSetStringp_TextPresoplayerid ], gstring );
}
else if( 
d_Horas1 <= && d_Minut1 )
{
formatgStrsizeofgStr ), "~r~~h~Tempo de Prisao~n~~n~~p~~h~Minutos: ~w~%d~n~~b~~h~Segundos: ~w~%d"d_Minut1d_Segun1 );
TextDrawSetStringp_TextPresoplayerid ], gStr );
}
else if( 
d_Horas1 <= && d_Minut1 <= && d_Segun1 )
{
formatgStrsizeofgStr ), "~r~~h~Tempo de Prisao~n~~n~~b~~h~Segundos: ~w~%d"d_Segun1 );
TextDrawSetStringp_TextPresoplayerid ], gStr );
}
TextDrawShowForPlayerplayeridp_TextPresoplayerid ] );
}
return 
1;

Ja adicionei o "Abuser" nos dados das contas etc. Grato a quem ajudar!
Reply


Messages In This Thread
Agendar Prisгo - by Pedro1812 - 26.03.2019, 11:50
Re: Agendar Prisгo - by ipsLuan - 26.03.2019, 13:03
Re: Agendar Prisгo - by Pedro1812 - 26.03.2019, 13:22
Re: Agendar Prisгo - by ipsLuan - 26.03.2019, 13:55

Forum Jump:


Users browsing this thread: 1 Guest(s)