[Pedido] Log de muerte para la administraciуn
#5

Para Administradores RCON, ocupas ZCMD y SA-MP 0.3.7:
pawn Код:
// ** INCLUDES

#include <a_samp>
#include <zcmd>

// ** VARIABLES

// *** GLOBAL VARIABLES

// **** GENERAL

new bool:pAdminDeathList[MAX_PLAYERS] = false;

// ** MAIN

main()
{
    print("Loaded \"admin_death_list.amx\".");
}

// ** CALLBACKS

public OnGameModeInit()
{
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    pAdminDeathList[playerid] = false;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        for(new i = 0, j = GetPlayerPoolSize(); i <= j; i ++)
        {
            if(!IsPlayerConnected(i) || !pAdminDeathList[i]) continue;

            SendDeathMessageToPlayer(i, killerid, playerid, reason);
        }
    }
    else
    {
        for(new i = 0, j = GetPlayerPoolSize(); i <= j; i ++)
        {
            if(!IsPlayerConnected(i) || !pAdminDeathList[i]) continue;

            SendDeathMessageToPlayer(i, INVALID_PLAYER_ID, playerid, 255);
        }
    }
    return 1;
}

// ** COMMANDS

CMD:deathlist(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return 0;

    if(!pAdminDeathList[playerid])
    {
        pAdminDeathList[playerid] = true;
    }
    else
    {
        pAdminDeathList[playerid] = false;
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)