SA-MP Forums Archive
[Pedido] anti combat log - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] anti combat log (/showthread.php?tid=619176)



anti combat log - BHTMestre - 14.10.2016

galera, tipo alguйm poderia me dar um sistema que ser o jogador entra em combate mostra pra os administradores logado na rcon, daн se ele estiver em combate e deslogar em combate o adm logado na rcon recebe uma mensagem dizendo que tal player deslogou por combat log


Re: anti combat log - Whoo - 14.10.2016

PHP Code:
new 
       
tempoDano[MAX_PLAYERS] ;
public 
OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID)
    {
        
tempoDano[playerid] = gettime();
    }
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    if((
gettime() - tempoDano[playerid]) < 5// se faz menos de 5 segundos que recebeu o dano...
    
{
        static 
cmdString[128], playerName[MAX_PLAYER_NAME];
        
GetPlayerName(playeridplayerNameMAX_PLAYER_NAME);
        
format(cmdString128"O Jogador(a) %s saiu enquanto estava em combate.");
        for(new 
aGetPlayerPoolSize() + 1; ++a)
        {
            if(
IsPlayerConnected(a) && IsPlayerAdmin(a))
            {
                
SendClientMessage(a, -1cmdString);
            }
        }
    }
    return 
1;