16.01.2019, 12:23
(
Последний раз редактировалось Pedro1812; 16.01.2019 в 13:04.
)
Adicionei um comando de "agendar cadeia e de prisгo" porem quando eu prendo,e o jogador sai e depois volta para o servidor,ele nгo da spawn no interior da cadeia,alguйm pode me ajudar? ele fica caindo do cйu.
Agendamento de prisгo:
Comando /cadeia:
PHP код:
if(PlayerInfo[playerid][Abuser] == 1 ){
LiberarPrisao(playerid);
SetPlayerPos(playerid, 223.5335,110.3779,999.0156);
SetPlayerInterior( playerid,10);
new CadeiaMotivo[128];
new msg[128];
format(CadeiaMotivo, sizeof(CadeiaMotivo), "%s", dini_Get(file, "MotivoPrisao"));
SendClientMessage(playerid, 0x1875CCAA,"=================================== Preso ===================================");
SendClientMessage(playerid, 0xFFFFFFAA,"» Vocк recebeu uma puniзгo de cadeia estando online / offline por um admin!");
format(msg, 128, "» Prisгo ( Motivo: %s )", CadeiaMotivo);
SendClientMessage(playerid, 0xFFFFFFAA, msg);
SendClientMessage(playerid, 0x1875CCAA,"=================================== Preso ===================================");
}
PHP код:
if( !strcmp( cmd, "/cadeiaoff", true ))
{
if(pAdmin[playerid] == 1 || pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5 || guardiao[playerid]){
{
tmp2 = strtok( cmdtext, idx );
if( !strlen( tmp2 ))
{
SendClientMessage( playerid, Vermelho, "| ERRO | Digite: /CadeiaOff [Nick] [Tempo] [Motivo]" );
return 1;
}
format(file, sizeof(file ), "Contas/%s.ini", tmp2 );
if( !fexist( file ))
{
SendClientMessage( playerid, Vermelho, "| ERRO | Nгo existe nenhuma conta com esse nick !" );
return 1;
}
tmp = strtok( cmdtext, idx );
if( ! strlen( tmp ))
{
SendClientMessage( playerid, Vermelho, "| ERRO | Digite: /CadeiaOff [Nick] [Tempo] [Motivo]" );
return 1;
}
new
iTempo = strval( tmp )
;
if( iTempo < 0 || iTempo > 600 )
{
SendClientMessage( playerid, Vermelho, "| ERRO | Tempo somente de 1 а 600 minutos ! " );
return 1;
}
new length = strlen( cmdtext );
while (( idx < length ) && ( cmdtext[ idx ] <= ' ' ))
{
idx++;
}
new offset = idx;
new result[ 64 ];
while (( idx < length ) && (( idx - offset ) < ( sizeof( result ) - 1 )) )
{
result[ idx - offset ] = cmdtext[ idx ];
idx++;
}
result[ idx - offset ] = EOS;
if( !strlen( result ))
{
SendClientMessage( playerid, Vermelho, "| ERRO | Digite: /CadeiaOff [Nick] [Tempo] [Motivo]" );
return 1;
}
new sistemacadeia[200];
format(sistemacadeia, sizeof(sistemacadeia), "| ZS-Admin | O(A) %s %s agendou a prisгo do(a) jogador(a) %s por %d minutos ( Motivo: %s )", CargoAdmin(playerid), PlayerName(playerid), tmp2, iTempo, result);
SendClientMessageToAll(0xB0FF30AA, sistemacadeia);
dini_Set(file, "MotivoPrisao", result);
dini_IntSet( file, "Abuser", 1 );
dini_IntSet( file, "pPreso", iTempo*60 );
}
}
return 1;
}
PHP код:
if( !strcmp( cmd, "/cadeia", true ))
{
if(pAdmin[playerid] == 1 || pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5 || guardiao[playerid]){
{
tmp = strtok( cmdtext, idx );
if( !strlen( tmp ))
{
SendClientMessage( playerid, Vermelho, "| ERRO | Digite: /Cadeia [ID] [Tempo] [Motivo]" );
return 1;
}
new
id = strval( tmp )
;
tmp = strtok( cmdtext, idx );
if( !strlen( tmp ))
{
SendClientMessage( playerid, Vermelho, "| ERRO | Digite: /Cadeia [ID] [Tempo] [Motivo]" );
return 1;
}
new
iTempo = strval( tmp )
;
if(pAdmin[playerid] == 5)
{
if( iTempo < 0 || iTempo > 3000 )
{
SendClientMessage( playerid, Vermelho, "| ERRO | Tempo somente de 1 а 3000 minutos !" );
return 1;
}
}
else if(pAdmin[playerid] == 4)
{
if( iTempo < 0 || iTempo > 400 )
{
SendClientMessage( playerid, Vermelho, "| ERRO | Tempo somente de 1 а 400 minutos !" );
return 1;
}
}
else if(pAdmin[playerid] == 3)
{
if( iTempo < 0 || iTempo > 200 )
{
SendClientMessage( playerid, Vermelho, "| ERRO | Tempo somente de 1 а 200 minutos !" );
return 1;
}
}
else if(pAdmin[playerid] == 1 || pAdmin[playerid] == 2)
{
if( iTempo < 0 || iTempo > 80 )
{
SendClientMessage( playerid, Vermelho, "| ERRO | Tempo somente de 1 а 80 minutos !" );
return 1;
}
}
new length = strlen( cmdtext );
while (( idx < length ) && ( cmdtext[ idx ] <= ' ' ))
{
idx++;
}
new offset = idx;
new result[ 64 ];
while (( idx < length ) && (( idx - offset ) < ( sizeof( result ) - 1 )) )
{
result[ idx - offset ] = cmdtext[ idx ];
idx++;
}
result[ idx - offset ] = EOS;
if( !strlen( result ))
{
SendClientMessage( playerid, Vermelho, "| ERRO | Digite: /Cadeia [ID] [Tempo] [Motivo]" );
return 1;
}
if( !IsPlayerConnected( id ))
{
SendClientMessage( playerid, Vermelho, "| ERRO | Ninguйm online com esse ID !" );
return 1;
}
GameTextForPlayer( id, "~w~~h~PRESO!", 3000, 0);
MensagemFormatadaAll( 0xB0FF30AA, "| ZS-Admin | O(A) %s %s prendeu o(a) jogador(a) %s por %d minutos ( Motivo: %s )", CargoAdmin(playerid), PlayerName( playerid ), PlayerName( id ), iTempo, result);
MensagemFormatada(id, 0xB0FF30AA, "| CADEIA | Vocк ficarб preso por %d minutos!", iTempo );
format(file, sizeof(file ), "Contas/%s.ini", PlayerName( id ));
dini_IntSet(file, "Abuser", 1 );
dini_Set(file, "MotivoPrisao", result);
SetPlayerWantedLevel( id, 0 );
PlayerInfo[ id ][ pPreso ] = iTempo*60;
ResetPlayerWeapons( id );
SetPlayerInterior( id, 10 );
SetPlayerPos(id, 223.5335,110.3779,999.0156);
KillTimer(T_Preso[id]);
T_Preso[ id ] = SetTimerEx( "LiberarPrisao", 1000, false, "d", id );
PlayerInfo[playerid][Abuser] = 1;
}
}
return 1;
}


