Raised This Month: $19 Target: $400
 4% 

[req] HLTV in TTT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sigerman
Senior Member
Join Date: Aug 2013
Location: Argentina, Bs.As.
Old 04-13-2021 , 21:12   [req] HLTV in TTT
Reply With Quote #1

The HLTV has a problem with TTT mod ( https://forums.alliedmods.net/showthread.php?t=238780 )

The HLTV is selected as a player, and It should not, It should stay on spectators, let me show you with a picture:



The problem was reported in 2015 ( https://forums.alliedmods.net/showthread.php?p=2332947 ), nothing was done

Could someone please help me?
sigerman is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-14-2021 , 00:45   Re: [req] HLTV in TTT
Reply With Quote #2

I think you might be able to get away with updating all uses of get_players() in ttt_core.sma and ttt_team_management.sma to use the "h" flag (the third parameter).

If the third argument already exists, make sure that it includes an "h" in the string. If the flag is "e" or "f" then it probably doesn't need the "h" because those search by team and name, respectively. The variable names "players" and "num" seem to be consistent but you should double check when you are replacing them, in fact, I would suggest just adding the third parameter manually so you don't have to worry about messing up the variables.

Examples:
Code:
get_players(players, num, "h")

Code:
get_players(players, num, "bh")

I'd also recommend changing the version number on both of these plugins too.

Make a backup of the original .amxx files first so that you can quickly restore them if something goes wrong.
__________________

Last edited by fysiks; 04-14-2021 at 01:00.
fysiks is offline
sigerman
Senior Member
Join Date: Aug 2013
Location: Argentina, Bs.As.
Old 04-14-2021 , 15:33   Re: [req] HLTV in TTT
Reply With Quote #3

Thanks fysiks I think It is done the get_players thing

ttt_core.sma
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#include <cs_teams_api>
#include <timer_controller>
#include <ttt>

#define TASK_SURVIVAL            1111
#define TASK_ORPHEU                2222
#define m_bitsDamageType        76
#define m_flPainShock            108
#define OFFSET_LINUX_WEAPONS    4
#define OFFSET_LINUX_PLAYERS    5

enum
{
    
KARMA_KILL,
    
KARMA_DMG
}

new const 
g_szGameModes[GAME_MODE][] =
{
    
"unset",
    
"off",
    
"preparing",
    
"restarting",
    
"started",
    
"ended"
};

const 
DMG_SOMETHING DMG_GENERIC DMG_SLASH DMG_BURN 
    
DMG_FREEZE DMG_FALL DMG_BLAST DMG_SHOCK DMG_DROWN 
    
DMG_NERVEGAS DMG_POISON DMG_RADIATION DMG_ACID;
    
// RESETABLE
new g_iGlobalInfo[GLOBAL_INFO], g_iSpecialCount[PLAYER_CLASS], g_iRoundSpecial[PLAYER_CLASS];
new 
g_iPlayerData[33][PLAYER_DATA];
new 
g_iMultiCount 1g_iMultiSeconds 1;
new 
Trie:g_tCvarsToFileg_iTrieSize;
//
// NON RESETABLE
new cvar_traitorscvar_detectivescvar_karma_damage,
    
cvar_preparation_timecvar_karma_multicvar_karma_start,
    
cvar_credits_tra_startcvar_credits_tra_countcvar_credits_tra_detkillcvar_credits_tra_countkill,
    
cvar_credits_det_startcvar_credits_tra_repeatcvar_damage_modifier,
    
cvar_credits_det_bonussurvcvar_credits_det_survtimecvar_show_deathmessagecvar_detective_glow;
new 
g_pMsgTeamInfog_pMsgScreenFadeg_iGameModeForwardg_iPluginCfgForward;
new 
Float:g_fFreezeTimeFloat:g_fRoundTimeFloat:g_fRoundStart;
new 
g_iMaxDetectivesg_iMaxTraitorsg_iMaxPlayers;
new 
g_iExceptionItems[10] = {-2, -2, ...};
//

public plugin_init()
{
    
register_plugin("[TTT] Core"TTT_VERSIONTTT_AUTHOR);
    
register_cvar("ttt_server_version"TTT_VERSIONFCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY);

    
cvar_traitors                mynew_register_cvar("ttt_traitors",                "4",    "One Traitor on X players. (Default: 4)");
    
cvar_detectives                mynew_register_cvar("ttt_detectives",                "6",    "One Detective on X players. (Default: 6)");
    
cvar_preparation_time        mynew_register_cvar("ttt_preparation_time",        "10",    "Preparation time before game start. (Default: 10)");
    
cvar_credits_tra_start        mynew_register_cvar("ttt_credits_tra_start",        "2",    "Number of credits Traitor has when starting game. (Default: 2)");
    
cvar_credits_tra_count        mynew_register_cvar("ttt_credits_tra_count",        "0.25",    "Percentage of players to kill to get extra credits. (Default: 0.25)");
    
cvar_credits_tra_repeat        mynew_register_cvar("ttt_credits_tra_repeat",        "1",    "Repeat percentage kills till all are killed. (Default: 1)");
    
cvar_credits_tra_detkill    mynew_register_cvar("ttt_credits_tra_detkill",    "1",    "Number of credits for killing a Detective. (Default: 1)");
    
cvar_credits_tra_countkill    mynew_register_cvar("ttt_credits_tra_countkill",    "1",    "Number of credits to give for percentage kills. (Default: 1)");
    
cvar_credits_det_start        mynew_register_cvar("ttt_credits_det_start",        "1",    "Number of credits Detective has when starting game. (Default: 1)");
    
cvar_credits_det_bonussurv    mynew_register_cvar("ttt_credits_det_bonussurv",    "1",    "Number of credits to give for surviving time. (Default: 1)");
    
cvar_credits_det_survtime    mynew_register_cvar("ttt_credits_det_survtime",    "45.0",    "Every X seconds give credits. (Default: 45.0)");
    
cvar_karma_damage            mynew_register_cvar("ttt_karma_damage",            "0.25",    "Karma modifier dealing damage. (Default: 0.25)");
    
cvar_karma_multi            mynew_register_cvar("ttt_karma_multi",            "50",    "Karma modifier for killing. (Default: 50)");
    
cvar_karma_start            mynew_register_cvar("ttt_karma_start",            "500",    "Starting karma. (Default: 500)");
    
cvar_show_deathmessage        mynew_register_cvar("ttt_show_deathmessage",        "abeg",    "Show deathmessages to: a=NONE, b=TRAITOR, c=DETECTIVE, d=INNOCENT, e=DEAD, f=SPECIAL, g=victim, h=killer. (Default: abeg)");
    
cvar_damage_modifier        mynew_register_cvar("ttt_damage_modifier",        "1.0",    "Modifies karma based damage. (Default: 1.0)");
    
cvar_detective_glow            mynew_register_cvar("ttt_detective_glow",            "1",    "Should detective also be glowing? (Default: 1)");

    
g_pMsgScreenFade    get_user_msgid("ScreenFade");
    
g_pMsgTeamInfo        get_user_msgid("TeamInfo");

    
register_event("TextMsg""Event_RoundRestart""a""2&#Game_C""2&#Game_w");
    
register_event("HLTV""Event_HLTV""a""1=0""2=0");
    
register_event("DeathMsg""Event_DeathMsg""a");
    
register_logevent("Event_EndPreptime"2"1=Round_Start");
    
register_logevent("Event_EndRound"2"1=Round_End");

    
register_forward(FM_AddToFullPack"Forward_AddToFullPack_post"1);

    
RegisterHamPlayer(Ham_Killed"Ham_Killed_pre"0);
    
RegisterHamPlayer(Ham_Killed"Ham_Killed_post"1);
    
RegisterHamPlayer(Ham_TakeDamage"Ham_TakeDamage_pre"0);
    
RegisterHamPlayer(Ham_TakeDamage"Ham_TakeDamage_post"1);
    
RegisterHamPlayer(Ham_TraceAttack"Ham_TraceAttack_pre"0);

    
g_iGameModeForward CreateMultiForward("ttt_gamemode"ET_IGNOREFP_CELL);
    
g_iPluginCfgForward CreateMultiForward("ttt_plugin_cfg"ET_IGNORE);

    
g_iMaxPlayers get_maxplayers();
    
#if AMXX_VERSION_NUM < 183
    
register_dictionary("ttt_c.txt");
    
register_dictionary("ttt_addons_c.txt");
    
#else
    
register_dictionary("ttt.txt");
    
register_dictionary("ttt_addons.txt");
    
#endif
}

public 
plugin_end()
    
set_game_state(GAME_PREPARING);

public 
plugin_natives()
{
    
register_library("ttt");
    
register_native("ttt_get_roundtime",    "_get_roundtime");
    
register_native("ttt_get_playerdata",    "_get_playerdata");
    
register_native("ttt_set_playerdata",    "_set_playerdata");
    
register_native("ttt_get_globalinfo",    "_get_globalinfo");
    
register_native("ttt_set_globalinfo",    "_set_globalinfo");
    
register_native("ttt_set_playerstate",    "_set_playerstate");
    
register_native("ttt_set_gamemode",        "_set_gamemode");
    
register_native("ttt_get_specialcount",    "_get_specialcount");
    
register_native("ttt_register_cvar",    "_register_cvar");
    
register_native("ttt_add_exception",    "_add_exception");
    
register_native("ttt_find_exception",    "_find_exception");
}

public 
plugin_cfg()
{
    
auto_exec_config(TTT_CONFIGFILE);
    
g_fRoundTime get_pcvar_float(get_cvar_pointer("mp_roundtime"));
    
TrieDestroy(g_tCvarsToFile);

    new 
ret;
    
ExecuteForward(g_iPluginCfgForwardret);
}

public 
client_disconnected(id)
{
    
set_task(0.5"reset_client"id);
    
set_special_state(idPC_NONE);
}

public 
client_putinserver(id)
{
    
// if(is_user_bot(id))
    //     server_cmd("kick #%i %s", get_user_userid(id), "Bot player!");

    
reset_client(id);
    
g_iPlayerData[id][PD_KILLEDBY] = -1;
    
set_task(11.0"startup_info"id);

    new 
karma get_pcvar_num(cvar_karma_start);
    
g_iPlayerData[id][PD_KARMATEMP] = karma;
    
g_iPlayerData[id][PD_KARMA] = karma;
}

public 
startup_info(id)
{
    if(
get_game_state() == GAME_STARTED && !is_user_alive(id))
    {
        
set_special_state(idPC_DEAD);
        
Show_All();
    }

    
// Please don't remove this :)
    
client_print_color(idprint_team_default"%s Mod created by ^3%s^1, ^4skype:guskis1^1, version: ^3%s^1!"TTT_TAGTTT_AUTHORTTT_VERSION);
}

public 
Event_RoundRestart()
{
    if(
get_game_state() != GAME_RESTARTING)
    {
        
reset_all();
        
set_game_state(GAME_RESTARTING);
    }
}

public 
Event_HLTV()
{
    if(
get_game_state() != GAME_PREPARING)
    {
        new 
cvar get_pcvar_num(cvar_preparation_time);
        if(!
cvar)
            
set_pcvar_num(cvar_preparation_timecvar 1);
        
g_fFreezeTime float(cvar);
        
set_task(0.1"set_timer");

        
g_fRoundTime get_pcvar_float(get_cvar_pointer("mp_roundtime"));
        
g_fRoundStart get_gametime();
        
reset_all();

        
set_game_state(GAME_PREPARING);
    }
}

public 
set_timer()
    
RoundTimerSet(0get_pcvar_num(cvar_preparation_time));

public 
Event_EndRound()
{
    if(
get_game_state() != GAME_ENDED)
    {
        
reset_all();
        
set_game_state(GAME_ENDED);
    }
}

public 
Event_EndPreptime()
{
    if(
task_exists(TASK_ORPHEU))
        
remove_task(TASK_ORPHEU);
    
set_task(float(get_pcvar_num(cvar_preparation_time)), "do_the_magic"TASK_ORPHEU);
}

public 
do_the_magic()
{
    
RoundTimerSet(floatround(g_fRoundTime));

    new 
num;
    static 
players[32];
    
get_players(playersnum"h");
    
ttt_log_to_file(LOG_DEFAULT"Current player count %d"num);

    if(
num 3)
    {
        
set_game_state(GAME_OFF);
        
client_print_color(0print_team_default"%s %L"TTT_TAGLANG_PLAYER"TTT_MODOFF1");
        return;
    }

    new 
trai get_pcvar_num(cvar_traitors), dete get_pcvar_num(cvar_detectives);
    
g_iMaxTraitors = (num/trai);
    if(!
g_iMaxTraitors)
        
g_iMaxTraitors 1;

    
g_iMaxDetectives = (num/dete);
    if(
g_iMaxTraitors+g_iMaxDetectives>num)
    {
        
set_pcvar_num(cvar_detectives8);
        
set_pcvar_num(cvar_traitors4);
        
g_iMaxTraitors = (num/trai);

        if(!
g_iMaxTraitors)
            
g_iMaxTraitors 1;
    
        
g_iMaxDetectives = (num/dete);
        
client_print_color(0print_team_default"%s %L"TTT_TAGLANG_PLAYER"TTT_MODOFF2");
    }
    while(
specials_needed() != 0)
        
pick_specials();

    new 
id;
    for(--
numnum >= 0num--)
    {
        
id players[num];
        if(!
is_user_alive(id)) continue;
        
g_iPlayerData[id][PD_KARMA] = g_iPlayerData[id][PD_KARMATEMP];

        if(
get_special_state(id) != PC_DETECTIVE && get_special_state(id) != PC_TRAITOR)
        {
            
screen_fade(idPC_INNOCENT);
            
set_special_state(idPC_INNOCENT);
            
cs_set_player_team(idCS_TEAM_CTfalse);
        }

        
entity_set_float(idEV_FL_fragsfloat(g_iPlayerData[id][PD_KARMA]));
        
cs_set_user_deaths(idg_iPlayerData[id][PD_KILLEDDEATHS]);
    }

    new 
i;
    for(
0PLAYER_CLASSi++)
        
g_iRoundSpecial[i] = get_special_count(i);

    
set_task(get_pcvar_float(cvar_credits_det_survtime), "give_survival_credits"TASK_SURVIVAL__"b");
    
    
get_players(playersnum"h");
    for(--
numnum >= 0num--)
    {
        
id players[num];
        
set_fake_team(idget_special_state(id));
    }

    
set_game_state(GAME_STARTED);
}

public 
Event_DeathMsg()
{
    new 
killer read_data(1); 
    new 
victim read_data(2);
    static 
weapon[16];
    
read_data(4weaponcharsmax(weapon));

    if(
is_user_connected(killer))
    {
        static 
newweap[32];
        
g_iPlayerData[victim][PD_KILLEDBY] = killer;
        
g_iPlayerData[killer][PD_KILLCOUNT]++;
        
formatex(newweapcharsmax(newweap), "weapon_%s"weapon);
        
g_iPlayerData[victim][PD_KILLEDWEAP] = get_weaponid(newweap);
    }

    static 
cvar[10];
    
get_pcvar_string(cvar_show_deathmessagecvarcharsmax(cvar));
    if(
cvar[0])
        
ttt_make_deathmsg(killervictimread_data(3), weaponread_flags(cvar));

    if(
equali(weapon"worldspawn"))
        
g_iPlayerData[victim][PD_KILLEDWEAP] = DEATHS_SUICIDE;
}

public 
Ham_Killed_pre(victimkillershouldgib)
{
    if(
my_return_check(victim))
        return 
HAM_IGNORED;

    if(
get_pdata_int(victimm_bitsDamageType) & DMG_SOMETHING)
        
add_death_info(victimkillerget_pdata_int(victimm_bitsDamageType5));

    
g_iPlayerData[victim][PD_KILLEDSTATE] = get_special_state(victim);
    
g_iPlayerData[victim][PD_KILLEDTIME] = floatround(floatmul(g_fRoundTime60.0) - get_round_time());
    
g_iPlayerData[victim][PD_KILLEDDEATHS]++;

    
set_special_state(victimPC_DEAD);
    return 
HAM_HANDLED;
}

public 
add_death_info(victimkillerdmg)
{
    new 
msg get_deathmessage(0dmg);
    if(
is_user_connected(killer))
    {
        
g_iPlayerData[victim][PD_KILLEDBY] = killer;
        
g_iPlayerData[killer][PD_KILLCOUNT]++;
    }
    else 
g_iPlayerData[victim][PD_KILLEDBY] = msg;

    
g_iPlayerData[victim][PD_KILLEDWEAP] = msg;
}

public 
get_deathmessage(iddmg)
{
    if(!
id)
    {
        if(
dmg DMG_GENERIC)
            
dmg DEATHS_GENERIC;
        else if(
dmg DMG_SLASH)
            
dmg DEATHS_SLASH;
        else if(
dmg DMG_BURN)
            
dmg DEATHS_BURN;
        else if(
dmg DMG_FREEZE)
            
dmg DEATHS_FREEZE;
        else if(
dmg DMG_FALL)
            
dmg DEATHS_FALL;
        else if(
dmg DMG_BLAST)
            
dmg DEATHS_BLAST;
        else if(
dmg DMG_SHOCK)
            
dmg DEATHS_SHOCK;
        else if(
dmg DMG_DROWN)
            
dmg DEATHS_DROWN;
        else if(
dmg DMG_NERVEGAS)
            
dmg DEATHS_NERVEGAS;
        else if(
dmg DMG_POISON)
            
dmg DEATHS_POISON;
        else if(
dmg DMG_RADIATION)
            
dmg DEATHS_RADIATION;
        else if(
dmg DMG_ACID)
            
dmg DEATHS_ACID;
        else 
dmg DEATHS_SUICIDE;
    }
    else 
dmg g_iPlayerData[id][PD_KILLEDWEAP];

    return 
dmg;
}

public 
Ham_Killed_post(victimkillershouldgib)
{
    if(
my_return_check(victim))
        return;

    if(!
is_user_connected(killer))
    {
        
killer find_valid_killer(victimkiller);
    }

    new 
bonus;
    static 
players[32], name[32];
    if(
float(get_special_count(PC_DEAD)+get_special_count(PC_TRAITOR)-g_iRoundSpecial[PC_TRAITOR])/float(g_iRoundSpecial[PC_INNOCENT]+g_iRoundSpecial[PC_DETECTIVE])
    > 
get_pcvar_float(cvar_credits_tra_count) * g_iMultiCount)
    {
        new 
numi;
        
bonus get_pcvar_num(cvar_credits_tra_countkill);
        
get_players(playersnum"ah");
        for(--
numnum >= 0num--)
        {
            
players[num];

            if(
get_special_state(i) == PC_TRAITOR)
            {
                
g_iPlayerData[i][PD_CREDITS] += bonus;
                
client_print_color(iprint_team_default"%s %L"TTT_TAGi"TTT_AWARD1"bonusfloatround(get_pcvar_float(cvar_credits_tra_count)* g_iMultiCount*100), ispecial_names[PC_INNOCENT]);
            }
        }

        if(
get_pcvar_num(cvar_credits_tra_repeat))
            
g_iMultiCount++;
        else 
g_iMultiCount 100;
    }

    if(
is_user_connected(killer))
    {
        new 
killer_state get_special_alive(killer), victim_state get_special_alive(victim);
        if(
killer_state == PC_TRAITOR && victim_state == PC_DETECTIVE)
        {
            
bonus get_pcvar_num(cvar_credits_tra_detkill);
            
g_iPlayerData[killer][PD_CREDITS] += bonus;
            
get_user_name(victimnamecharsmax(name));
            
client_print_color(killerprint_team_default"%s %L"TTT_TAGkiller"TTT_AWARD2"bonuskillerspecial_names[PC_DETECTIVE], name);
        }

        if(
killer != victim)
        {
            
get_user_name(victimnamecharsmax(name));
            if(
killer_state == PC_INNOCENT || killer_state == PC_DETECTIVE)
                
client_print_color(killerprint_team_default"%s %L"TTT_TAGkiller"TTT_KILLED2"name);
            else if(
killer_state == PC_TRAITOR || victim_state == PC_TRAITOR)
                
client_print_color(killerprint_team_default"%s %L"TTT_TAGkiller"TTT_KILLED3"namekillerspecial_names[victim_state]);

            
get_user_name(killernamecharsmax(name));
            
client_print_color(victimprint_team_default"%s %L"TTT_TAGvictim"TTT_KILLED1"namevictimspecial_names[killer_state]);
        }
    }

    new 
killed_item killed_with_item(victim);
    if(
killed_item)
    {
        if(
is_user_connected(killer))
        {
            if(
victim != killer && get_special_alive(killer) != get_special_alive(victim))
                
karma_modifier(killervictimKARMA_KILL);
        }
    }
    else 
karma_modifier(killervictimKARMA_KILL);

    if(!
killed_item && (!is_user_connected(killer) || killer == victim))
        
client_print_color(victimprint_team_default"%s %L"TTT_TAGvictim"TTT_SUICIDE");

    
set_task(0.1"Show_All");
}

public 
find_valid_killer(victimkiller)
{
    new 
new_killer get_player_data(victimPD_KILLEDBY);
    return 
new_killer new_killer killer;
}

public 
killed_with_item(victim)
{
    new 
item get_player_data(victimPD_KILLEDBYITEM);
    static const 
size sizeof(g_iExceptionItems);
    for(new 
0sizei++)
    {
        if(
g_iExceptionItems[i] == item)
            return 
1;
    }

    return 
0;
}

public 
Show_All()
{
    if(
get_game_state() == GAME_STARTED)
    {
        new 
numispecstate;
        static 
players[32];
        
get_players(playersnum"h");
        for(--
numnum >= 0num--)
        {
            
players[num];

            
specstate get_special_state(i);
            if(
specstate == PC_DEAD || specstate == PC_NONE)
            {
                
set_attrib_special(i1PC_TRAITORPC_NONEPC_DEAD);
                if(!
g_iPlayerData[i][PD_SCOREBOARD])
                    
set_attrib_special(i0PC_INNOCENTPC_DETECTIVE);
            }
        }
    }
}

public 
Ham_TakeDamage_pre(victiminflictorattackerFloat:damagebits)
{
    if(!
my_return_check(attacker))
    {
        new 
Float:modifier g_iPlayerData[attacker][PD_KARMA]/1000.0;
        if(
modifier 0.05 && damage 0.1)
        {
            
damage *= (modifier*get_pcvar_float(cvar_damage_modifier));
            if(
cs_get_user_team(attacker) != cs_get_user_team(victim))
                
damage *= 0.35;

            if(
damage 1.0)
                
damage 1.0;
        }
        else 
damage 0.0;

        
SetHamParamFloat(4damage);
        return 
HAM_HANDLED;
    }

    return 
HAM_IGNORED;
}

public 
Ham_TakeDamage_post(victiminflictorattackerFloat:damagebits)
{
    if(!
my_return_check(attacker))
    {
        if(
damage 0.1)
        {
            if(
victim != attacker)
                
karma_modifier(attackervictimKARMA_DMG);
        }
        else 
set_pdata_float(victimm_flPainShock1.0OFFSET_LINUX_PLAYERS);
    }
}

public 
Ham_TraceAttack_pre()
{
    if(
get_game_state() != GAME_STARTED && get_game_state() != GAME_OFF)
        return 
HAM_SUPERCEDE;

    return 
HAM_IGNORED;
}

public 
Forward_AddToFullPack_post(es_handleeenthosthostflagsidpSet)
{
    if(
id && host != ent && is_user_connected(host) && is_user_connected(ent) && get_orig_retval())
    {
        static 
cvar;
        if(!
cvar)
            
cvar get_pcvar_num(cvar_detective_glow);

        new 
entTeam get_special_alive(ent);
        if(
entTeam != PC_INNOCENT)
        {
            new 
hostTeam get_special_alive(host);
            new 
fakeTeam get_player_data(entPD_FAKESTATE);
            if(
fakeTeam && hostTeam != entTeam)
                
entTeam fakeTeam;
            if(
hostTeam == PC_TRAITOR || ((hostTeam == PC_DETECTIVE || hostTeam == PC_INNOCENT) && entTeam != PC_TRAITOR && cvar))
            {
                
set_es(es_handleES_RenderFxkRenderFxGlowShell);
                
set_es(es_handleES_RenderColorg_iTeamColors[entTeam]);
                
set_es(es_handleES_RenderAmt35);
            }
        }
    }
}

public 
pick_specials()
{
    new 
idnum;
    static 
players[32];
    static 
name[32];

    
get_players(playersnum"h");

    while(
id == 0)
    {
        
id players[random(num)];
        if(
get_special_state(id) == PC_TRAITOR || get_special_state(id) == PC_DETECTIVE)
            
id 0;
    }

    new 
randomNum specials_needed();
    
get_user_name(idnamecharsmax(name));
    switch(
randomNum)
    {
        case 
PC_TRAITOR:
        {
            
g_iPlayerData[id][PD_CREDITS] = get_pcvar_num(cvar_credits_tra_start);
            
set_special_state(idrandomNum);

            
screen_fade(idrandomNum);
            
ttt_log_to_file(LOG_DEFAULT"[%L] %s choosen (ID:%d)"idspecial_names[randomNum], nameid);
            
cs_set_player_team(idCS_TEAM_Tfalse);
        }
        case 
PC_DETECTIVE:
        {
            if(
num >= get_pcvar_num(cvar_detectives))
            {
                
g_iPlayerData[id][PD_CREDITS] = get_pcvar_num(cvar_credits_det_start);
                
set_special_state(idrandomNum);

                
screen_fade(idrandomNum);
                
ttt_log_to_file(LOG_DEFAULT"[%L] %s choosen (ID:%d)"idspecial_names[randomNum], nameid);
                
cs_set_player_team(idCS_TEAM_CTfalse);
            }
        }
        case 
PC_NONE: return;
    }
}

stock screen_fade(idplayer_state)
{
    
message_begin(MSG_ONE_UNRELIABLEg_pMsgScreenFade_id);
    
write_short(FixedUnsigned16(1.01<<12));
    
write_short(0);
    
write_short((SF_FADE_MODULATE)); //flags (SF_FADE_IN + SF_FADE_ONLYONE) (SF_FADEOUT)
    
write_byte(g_iTeamColors[player_state][0]);
    
write_byte(g_iTeamColors[player_state][1]);
    
write_byte(g_iTeamColors[player_state][2]);
    
write_byte(180);
    
message_end();
}

stock my_return_check(id)
{
    new 
game get_game_state();
    if(!
is_user_connected(id) || game == GAME_OFF || game == GAME_ENDED)
        return 
1;

    return 
0;
}

public 
specials_needed()
{
    if(
g_iMaxTraitors get_special_count(PC_TRAITOR))
        return 
PC_TRAITOR;
    else if(
g_iMaxDetectives get_special_count(PC_DETECTIVE))
        return 
PC_DETECTIVE;

    return 
PC_NONE;
}

public 
give_survival_credits()
{
    static 
players[32];
    new 
numidbonus get_pcvar_num(cvar_credits_det_bonussurv);
    
get_players(playersnum"ah");
    for(--
numnum >= 0num--)
    {
        
id players[num];
        if(
get_special_state(id) == PC_DETECTIVE)
        {
            
g_iPlayerData[id][PD_CREDITS] += bonus;
            
client_print_color(idprint_team_default"%s %L"TTT_TAGid"TTT_AWARD4"bonusfloatround(get_pcvar_float(cvar_credits_det_survtime))*g_iMultiSeconds);
            
g_iMultiSeconds++;
        }
    }
}

public 
reset_all()
{
    static 
players[32];
    new 
numidi;
    
get_players(playersnum"h");
    for(--
numnum >= 0num--)
    {
        
id players[num];

        
set_special_state(idPC_NONE);
        for(
0PLAYER_DATAi++)
        {
            if(
== PD_KARMA || == PD_KARMATEMP || == PD_KILLEDDEATHS) continue;
            if(
== PD_KILLEDBY || == PD_KILLEDBYITEM)
                
g_iPlayerData[id][i] = -1;
            else 
g_iPlayerData[id][i] = 0;
        }
        if(
task_exists(id))
            
remove_task(id);
        
set_attrib_all(id0);
    }

    for(
0PLAYER_CLASSi++)
        
g_iSpecialCount[i] = 0;
    
//if(get_game_state() == GAME_ENDED || get_game_state() == GAME_RESTARTING)
    //    set_game_state(GAME_OFF);

    
g_iMultiSeconds 1;
    
g_iMultiCount 1;

    if(
task_exists(TASK_SURVIVAL))
        
remove_task(TASK_SURVIVAL);
}

public 
reset_client(id)
{
    for(new 
0PLAYER_DATAi++)
    {
        if(
== PD_KILLEDBY || == PD_KILLEDBYITEM)
            
g_iPlayerData[id][i] = -1;
        else 
g_iPlayerData[id][i] = 0;
    }

    
set_special_state(idPC_NONE);
    
set_attrib_all(id0);
}

public 
karma_modifier(attackervictimtype)
{
    if(
attacker == 0)
        
attacker victim;

    if(!
is_user_connected(attacker) || !is_user_connected(victim) || get_game_state() == GAME_OFF)
        return;

    static 
players[32];
    new 
numkarmamultimodifier;
    
get_players(playersnum"h");
    if(
type == KARMA_KILL)
    {
        
karmamulti floatround(get_pcvar_num(cvar_karma_multi)*(g_iPlayerData[victim][PD_KARMATEMP]/1000.0));
        
modifier = (3*(g_iMaxPlayers-1)-(num-1))/(g_iMaxPlayers-1);
    }
    else if(
type == KARMA_DMG)
    {
        new 
Float:temp entity_get_float(victimEV_FL_dmg_take);
        
karmamulti floatround(temp*0.25) < floatround(temp*get_pcvar_float(cvar_karma_damage));
        
modifier 1;
    }

    new 
ivictim get_special_alive(victim);
    new 
iattacker get_special_alive(attacker);

    switch(
iattacker)
    {
        case 
PC_TRAITOR//attacker is traitor
        
{
            switch(
ivictim)
            {
                case 
PC_TRAITOR:                    g_iPlayerData[attacker][PD_KARMATEMP] -= karmamulti*modifier;
                case 
PC_DETECTIVEPC_INNOCENT:        g_iPlayerData[attacker][PD_KARMATEMP] += karmamulti/modifier;
            }
        }
        case 
PC_DETECTIVEPC_INNOCENT//attacker is detective or innocent
        
{
            switch(
ivictim)
            {
                case 
PC_TRAITOR:                    g_iPlayerData[attacker][PD_KARMATEMP] += karmamulti/modifier;
                case 
PC_DETECTIVEPC_INNOCENT:        g_iPlayerData[attacker][PD_KARMATEMP] -= karmamulti*modifier;
            }
        }
    }

    
karma_reset(attacker);
}

stock karma_reset(id)
{
    if(
g_iPlayerData[id][PD_KARMATEMP] > 1000)
        
g_iPlayerData[id][PD_KARMATEMP] = 1000;
    else if(
g_iPlayerData[id][PD_KARMATEMP] < 1)
        
g_iPlayerData[id][PD_KARMATEMP] = 0;
}

stock set_game_state(new_state)
{
    
ttt_log_to_file(LOG_GAMETYPE"[PRE ] Gamemode: %s"g_szGameModes[g_iGlobalInfo[GI_GAMEMODE]]);
    if(
get_game_state() && get_game_state() < GAME_ENDED && new_state == GAME_RESTARTING)
        
log_amx("[TTT] Game has restarted :( (game: %d)"get_game_state());

    
g_iGlobalInfo[GI_GAMEMODE] = new_state;

    new 
ret;
    
ExecuteForward(g_iGameModeForwardretnew_state);
    
ttt_log_to_file(LOG_GAMETYPE"[POST] Gamemode: %s"g_szGameModes[g_iGlobalInfo[GI_GAMEMODE]]);
}

stock get_game_state()
    return 
g_iGlobalInfo[GI_GAMEMODE];

stock get_special_state(id)
    return 
g_iPlayerData[id][PD_PLAYERSTATE];

stock get_special_alive(id)
{
    if(!
is_user_alive(id))
        return 
g_iPlayerData[id][PD_KILLEDSTATE];

    return 
get_special_state(id);
}

stock set_special_state(idnew_state)
{
    if(!
is_user_connected(id))
        return;

    new 
player_state get_special_state(id);
    if(
player_state == new_state)
        return;

    
set_special_count(player_stateget_special_count(player_state)-1);

    
set_player_data(idPD_PLAYERSTATEnew_state);
    
set_special_count(new_stateget_special_count(new_state)+1);
}

stock set_player_data(idpdvalue)
    
g_iPlayerData[id][pd] = value;

stock get_player_data(idpd)
    return 
g_iPlayerData[id][pd];

stock set_special_count(special_statecount)
    
g_iSpecialCount[special_state] = count;

stock get_special_count(special_state)
    return 
g_iSpecialCount[special_state];

stock set_fake_team(idgetstate)
{
    new 
numispecstate;
    static 
players[32];
    
get_players(playersnum"h");

    for(--
numnum >= 0num--)
    {
        
players[num];
        
specstate get_special_state(i);
        switch(
getstate)
        {
            case 
PC_INNOCENTPC_DETECTIVE:
            {
                if(
specstate == PC_DETECTIVE)
                    
set_fake_message(idi"CT");
                else 
set_fake_message(idi"TERRORIST");
            }
            case 
PC_TRAITOR:
            {
                if(
specstate == PC_TRAITOR || specstate == PC_DETECTIVE)
                {
                    
set_fake_message(idi"CT");
                    if(
specstate == PC_DETECTIVE)
                        
set_attrib_special(i4PC_TRAITORPC_NONEPC_DEAD);
                }
                else 
set_fake_message(idi"TERRORIST");
            }
        }
    }
}

stock set_fake_message(idimsg[])
{
    
message_begin(MSG_ONE_UNRELIABLEg_pMsgTeamInfo_id);
    
write_byte(i);
    
write_string(msg);
    
message_end();
}

stock Float:get_round_time()
    return 
get_gametime() - g_fRoundStart g_fFreezeTime;

stock mynew_register_cvar(name[], string[], description[], flags 0Float:fvalue 0.0)
{
    
new_register_cvar(namestringdescription);
    return 
register_cvar(namestringflagsfvalue);
}

stock new_register_cvar(name[], string[], description[], plug[] = "ttt_core.amxx")
{
    static 
path[96];
    if(!
path[0])
    {
        
get_localinfo("amxx_configsdir"pathcharsmax(path));
        
format(pathcharsmax(path), "%s/%s"pathTTT_CONFIGFILE);
    }

    new 
file;
    if(!
g_tCvarsToFile)
        
g_tCvarsToFile TrieCreate();

    if(!
file_exists(path))
    {
        
file fopen(path"wt");
        if(!
file)
            return 
0;

        
fprintf(file"// Server specific.^n");
        
fprintf(file"%-32s %-8s // %-32s // %s^n""mp_tkpunish""0",                plug"Disables TeamKill punishments");
        
fprintf(file"%-32s %-8s // %-32s // %s^n""mp_friendlyfire""1",            plug"Enables friendly fire to attack teamnates");
        
fprintf(file"%-32s %-8s // %-32s // %s^n""mp_limitteams""0",                plug"Disables team limits");
        
fprintf(file"%-32s %-8s // %-32s // %s^n""mp_autoteambalance""0",            plug"Disables team limits");
        
fprintf(file"%-32s %-8s // %-32s // %s^n""mp_freezetime""0",                plug"Disables freeze time on round start");
        
fprintf(file"%-32s %-8s // %-32s // %s^n""mp_playerid""2",                plug"Disables team info when aiming on player");
        
fprintf(file"%-32s %-8s // %-32s // %s^n""sv_allktalk""1",                plug"Enables alltalk");
        
fprintf(file"%-26s %-14s // %-32s // %s^n""amx_statscfg""off PlayerName",    plug"Disables player name when aiming on player");
        
fprintf(file"^n");
        
fprintf(file"// Mod specific.^n");
    }
    else
    {
        
file fopen(path"rt");
        if(!
file)
            return 
0;

        
//if(!TrieGetSize(g_tCvarsToFile))
        
if(!g_iTrieSize)
        {
            new 
newline[48];
            static 
line[128];
            while(!
feof(file))
            {
                
fgets(filelinecharsmax(line));
                if(
line[0] == ';' || !line[0])
                    continue;

                
parse(linenewlinecharsmax(newline));
                
remove_quotes(newline);
                
#if AMXX_VERSION_NUM >= 183
                    
TrieSetCell(g_tCvarsToFilenewline1false);
                
#else
                    
TrieSetCell(g_tCvarsToFilenewline1);
                
#endif
                
g_iTrieSize++;
            }
        }
        
fclose(file);
        
file fopen(path"at");
    }

    if(!
TrieKeyExists(g_tCvarsToFilename))
    {
        
fprintf(file"%-32s %-8s // %-32s // %s^n"namestringplugdescription);
        
#if AMXX_VERSION_NUM >= 183
            
TrieSetCell(g_tCvarsToFilename1false);
        
#else
            
TrieSetCell(g_tCvarsToFilename1);
        
#endif
        
g_iTrieSize++;
    }

    
fclose(file);
    return 
1;
}

// API
public _set_playerstate(pluginparams)
{
    if(
params != 2)
        return 
ttt_log_api_error("ttt_set_playerstate needs 2 params(p1: %d, p2: %d)"pluginparamsget_param(1), get_param(2));

    
set_special_state(get_param(1), get_param(2));
    return 
1;
}

public 
_set_gamemode(pluginparams)
{
    if(
params != 1)
        return 
ttt_log_api_error("ttt_set_gamemode needs 1 param(p1: %d)"pluginparamsget_param(1));

    
set_game_state(get_param(1));
    return 
1;
}

public 
_get_specialcount(pluginparams)
{
    if(
params != 1)
        return 
ttt_log_api_error("ttt_get_specialcount needs 1 param(p1: %d)"pluginparamsget_param(1));

    return 
get_special_count(get_param(1));
}

public 
Float:_get_roundtime()
    return 
get_round_time();

public 
_get_playerdata(pluginparams)
{
    if(
params != 2)
        return 
ttt_log_api_error("ttt_get_playerdata needs 2 params(p1: %d, p2: %d)"pluginparamsget_param(1), get_param(2));

    return 
get_player_data(get_param(1), get_param(2));
}

public 
_set_playerdata(pluginparams)
{
    if(
params != 3)
        return 
ttt_log_api_error("ttt_set_playerdata needs 3 params(p1: %d, p2: %d, p3: %d)"pluginparamsget_param(1), get_param(2), get_param(3));

    new 
id get_param(1);
    new 
datatype get_param(2);
    
set_player_data(iddatatypeget_param(3));
    if(
datatype == PD_KARMATEMP)
        
karma_reset(id);

    return 
1;
}

public 
_get_globalinfo(pluginparams)
{
    if(
params != 1)
        return 
ttt_log_api_error("ttt_get_globalinfo needs 1 param(p1: %d)"pluginparamsget_param(1));

    return 
g_iGlobalInfo[get_param(1)];
}

public 
_set_globalinfo(pluginparams)
{
    if(
params != 2)
        return 
ttt_log_api_error("ttt_set_globalinfo needs 2 params(p1: %d, p2: %d)"pluginparamsget_param(1), get_param(2));

    
g_iGlobalInfo[get_param(1)] = get_param(2);
    return 
1;
}

public 
_register_cvar(pluginparams)
{
    if(
params != 3)
        return 
ttt_log_api_error("ttt_register_cvar needs 3 params"pluginparams);

    static 
name[48], string[16], pluginname[48], description[128];
    
get_string(1namecharsmax(name));
    
get_string(2stringcharsmax(string));
    
get_string(3descriptioncharsmax(description));
    
get_plugin(pluginpluginnamecharsmax(pluginname));

    return 
new_register_cvar(namestringdescriptionpluginname);
}

public 
_add_exception(pluginparams)
{
    if(
params != 1)
        return 
ttt_log_api_error("ttt_add_exception needs 1 param(p1: %d)"pluginparamsget_param(1));

    static const 
size sizeof(g_iExceptionItems);
    for(new 
0sizei++)
    {
        if(
g_iExceptionItems[i] == -2)
        {
            
g_iExceptionItems[i] = get_param(1);
            return 
1;
        }
    }

    return 
0;
}

public 
_find_exception(pluginparams)
{
    if(
params != 1)
        return 
ttt_log_api_error("ttt_find_exception needs 1 param(p1: %d)"pluginparamsget_param(1));

    new 
item get_param(1);
    static const 
size sizeof(g_iExceptionItems);
    for(new 
0sizei++)
    {
        if(
g_iExceptionItems[i] == item)
            return 
1;
    }

    return 
0;

ttt_team_management.sma
PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <cs_teams_api>
#include <fun>
#include <ttt>

#define m_iNumSpawns 365

public plugin_init()
{
    
register_plugin("[TTT] Join team management"TTT_VERSIONTTT_AUTHOR);

    
register_message(get_user_msgid("ShowMenu"), "Message_ShowMenu");
    
register_message(get_user_msgid("VGUIMenu"), "Message_VGUIMenu");

    
register_clcmd("chooseteam""cmd_chooseteam");
    
register_clcmd("jointeam""cmd_chooseteam");
}

public 
ttt_gamemode(gamemode)
{
    if(
gamemode == GAME_STARTED)
    {
        new 
numid;
        static 
players[32];
        
get_players(playersnum"bh");
        for(--
numnum >= 0num--)
        {
            
id players[num];
            
set_pdata_int(idm_iNumSpawns1);
        }
    }

    if(
gamemode == GAME_ENDED)
        
set_task(0.1"randomize_teams");
}

public 
client_putinserver(id)
{
    if(
ttt_get_gamemode() == GAME_STARTED && !is_user_bot(id))
        
set_pdata_int(idm_iNumSpawns1);
}

public 
Message_ShowMenu(msgiddestid)
{
    static 
MenuCode[22];
    
get_msg_arg_string(4MenuCodecharsmax(MenuCode));
    if(
equal(MenuCode"#Team_Select") || equal(MenuCode"#Team_Select_Spect") || equal(MenuCode"#IG_Team_Select") || equal(MenuCode"#IG_Team_Select_Spect"))
    {
        
join_team(idmsgid);
        return 
PLUGIN_HANDLED;
    }

    return 
PLUGIN_CONTINUE;
}

public 
Message_VGUIMenu(msgiddestid)
{
    if(
get_msg_arg_int(1) != 2)
        return 
PLUGIN_CONTINUE;

    
join_team(idmsgid);
    return 
PLUGIN_HANDLED;
}

public 
join_team(idmsg)
{
    new 
param[2];
    
param[0] = msg;
    
set_task(0.1"handle_join"idparamsizeof(param));
}

public 
handle_join(param[], id)
{
    if(!
is_user_connected(id))
        return;

    new 
block get_msg_block(param[0]);
    
set_msg_block(param[0], BLOCK_SET);

    new 
numnumCT;
    static 
players[32];
    
get_players(playersnum"e""TERRORIST");
    
get_players(playersnumCT"e""CT");

    if(
numCT num)
        
engclient_cmd(id"jointeam""1");
    else 
engclient_cmd(id"jointeam""2");
    
    
engclient_cmd(id"joinclass""1");
    
set_msg_block(param[0], block);
}

public 
cmd_chooseteam(id)
    return 
PLUGIN_HANDLED;

public 
randomize_teams()
{
    if(
ttt_get_gamemode() != GAME_ENDED)
        return;

    static 
players[32];
    new 
numrannumcount[2], idcounterjailmap ttt_is_jailmap();
    
get_players(playersnum"h");

    for(--
numnum >= 0num--)
    {
        
id players[num];
        if(
jailmap)
        {
            if(
counter >= 3)
            {
                
counter++;
                
cs_set_player_team(idCS_TEAM_CTtrue);
            }
            else 
cs_set_player_team(idCS_TEAM_Ttrue);
            continue;
        }

        
rannum random_num(12);
        
cs_set_player_team(idCsTeams:rannumtrue);
        
count[rannum-1]++;
    }

    if(
jailmap)
        return;

    
get_players(playersnum"h");
    new 
diffcount abs(count[1]-count[0]);
    while(
diffcount 1)
    {
        
id players[random(num)];
        if(
is_user_connected(id))
        {
            if(
count[1] > count[0])
            {
                if(
cs_get_user_team(id) != CS_TEAM_T)
                {
                    
cs_set_player_team(idCS_TEAM_Ttrue);
                    
count[0]++;
                    
count[1]--;
                    
diffcount--;
                }
            }
            else
            {
                if(
cs_get_user_team(id) != CS_TEAM_CT)
                {
                    
cs_set_player_team(idCS_TEAM_CTtrue);
                    
count[0]--;
                    
count[1]++;
                    
diffcount--;
                }
            }
        }
    }

Quote:
I'd also recommend changing the version number on both of these plugins too.
I don't know how to do this
sigerman is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-15-2021 , 00:17   Re: [req] HLTV in TTT
Reply With Quote #4

The version is the second argument of the register_plugin() function but it seems that this set of plugins uses a preprocessor definition so that they all have the same version. So, it looks like you would need to change lines 25 and 26 to "2.5.3" and 253, respectively, in ttt_const.inc and then recompile both plugins.
__________________

Last edited by fysiks; 04-15-2021 at 00:18.
fysiks is offline
sigerman
Senior Member
Join Date: Aug 2013
Location: Argentina, Bs.As.
Old 04-16-2021 , 10:52   Re: [req] HLTV in TTT
Reply With Quote #5

Thanks!

ttt_const.inc
PHP Code:
#if defined _ttt_const_included
  #endinput
#endif
#define _ttt_const_included

#if AMXX_VERSION_NUM < 183
    #include "ttt_colorchat"
    #define client_print_color ttt_client_print
    #define print_team_default NORMAL
    #define print_team_grey GREY
    #define print_team_red RED
    #define print_team_blue BLUE
    #define print_team_green GREEN

    
stock HamHook:RegisterHamPlayer(Ham:function, const Callback[], Post=0)
        return 
RegisterHam(function, "player"CallbackPost);

    
#if defined _fakemeta_included
        #define write_coord_f(%0) engfunc(EngFunc_WriteCoord, %0)
        
stock message_begin_f(destmsg_type, const Float:origin[3] = {0.0,0.0,0.0}, player=0)
            
engfunc(EngFunc_MessageBegindestmsg_typeoriginplayer);
    
#endif
#endif

#define TTT_VERSION            "2.5.3"
#define TTT_VERSION_INT        253
#define TTT_AUTHOR            "GuskiS"
#define TTT_TAG                "^3[^4TTT^3]^1"

#define TTT_DEADBODY        "ttt_dead_body"
#define TTT_HPSTATION        "ttt_hp_station"
#define TTT_DEATHSTATION    "ttt_death_station"
#define TTT_C4_SUB            "ttt_c4_subent"

#define TTT_ITEMLENGHT        64 // Max length of items name.
#define TTT_FILELENGHT        64 // Max length of files name.
#define TTT_MAXSHOP            25 // Max items in shop.
#define TTT_MAXBACKPACK        20 // Max items in backpack.
#define TTT_SETTINGSFILE    "ttt_mod.ini"
#define TTT_CONFIGFILE        "ttt_mod.cfg"
#define TTT_ADMINACCESS        ADMIN_BAN

#pragma semicolon 1

stock const g_iTeamColors[][] =
{
    {
02550},
    {
255500},
    {
050255},
    {
02550},
    {
02550},
    {
000}
};

enum _:PLAYER_STATS
{
    
STATS_GWK,            // Game winning kills
    
STATS_KILLS_I,        // Kills as Innocent // Right ones
    
STATS_KILLS_D,        // Kills as Detective
    
STATS_KILLS_T,        // Kills as Traitor
    
STATS_RDM,            // Team kills
    
STATS_INN,            // Times innocent
    
STATS_DET,            // Times detective
    
STATS_TRA,            // Times traitor
    
STATS_BOMBP,        // Bomb planted
    
STATS_BOMBE,        // Bomb exploded
    
STATS_BOMBD,        // Bomb defused
    
STATS_POINTS        // Total points
}

enum _:LOG_MESSAGES(<<= 1)
{
    
LOG_DEFAULT 1,
    
LOG_ERROR,
    
LOG_GAMETYPE,
    
LOG_ITEM,
    
LOG_KILL,
    
LOG_DAMAGE,
    
LOG_MISC
}

enum _:BODY_DATA
{
    
BODY_TIME,        // DNA active time
    
BODY_KILLER,    // ID who killed
    
BODY_TRACER,    // ID who is tracing killer
    
BODY_ACTIVE,    // Is actually tracing happening
    
BODY_ENTID,        // Bodies entid
    
BODY_CALLD,        // Does this body calls Detective to inspect it?
    
BODY_EXPLODED    // It exploded :(
}

enum _:SETUP_DATA
{
    
SETUP_ITEMID,        // Item ID obviously
    
SETUP_ITEMENT,        // Set up items entid
    
SETUP_ITEMTIME,        // Time for DNA, I think
    
SETUP_ITEMOWNER,    // Items owner ID
    
SETUP_ITEMTRACER,    // Tracers ID
    
SETUP_ITEMACTIVE,    // Is tracing active
    
SETUP_ITEMNAME[TTT_ITEMLENGHT]    // Items name
}

enum _:PLAYER_DATA
{
    
PD_KILLEDBY,        // Killers ID
    
PD_KILLEDWEAP,        // Weapons ID
    
PD_KILLEDTIME,        // Some time, get_roundtime I guess
    
PD_KILLEDSTATE,        // Killed state
    
PD_KILLEDDEATHS,    // Players death count
    
PD_KILLCOUNT,        // Players kill count
    
PD_IDENTIFIED,        // Is he identified?
    
PD_KARMA,            // Players karma, the one used in damge calculations
    
PD_KARMATEMP,        // Temporary karma, the one actually being changed all the time
    
PD_CREDITS,            // Players credits
    
PD_C4EXPLODED,        // Did he explode C4 :O
    
PD_SCOREBOARD,        // Holds info about scoreboard (1 means cant change)
    
PD_PLAYERSTATE,        // Why the fuck is this last one? ;o
    
PD_KILLEDBYITEM,    // If killed by item, stores that item ID
    
PD_HOLDINGITEM,        // Is holding any item?
    
PD_ITEMSTATE,        // If is holding item, what state this item has?
    
PD_HIDENAME,        // Should his name be hidden?
    
PD_OTHERNAME,        // Player ID to steal name from.
    
PD_FAKESTATE,        // Fakes player state.
    
PD_LOYALTY,            // Player loyalty.
    
PD_ITEM_SHARING        // Share item with PLAYERID.
}

enum _:PLAYER_CLASS
{
    
PC_NONE,
    
PC_TRAITOR,
    
PC_DETECTIVE,
    
PC_INNOCENT,
    
PC_DEAD,
    
PC_SPECIAL
}

enum _:GAME_MODE
{
    
GAME_UNSET,
    
GAME_OFF,
    
GAME_PREPARING,
    
GAME_RESTARTING,
    
GAME_STARTED,
    
GAME_ENDED
}

enum _:GLOBAL_INFO
{
    
GI_GAMEMODE
}

enum _:PLAYER_DEATHS(+= 1)
{
    
DEATHS_SUICIDE 3000,
    
DEATHS_GENERIC,
    
DEATHS_SLASH,
    
DEATHS_BURN,
    
DEATHS_FREEZE,
    
DEATHS_FALL,
    
DEATHS_BLAST,
    
DEATHS_SHOCK,
    
DEATHS_DROWN,
    
DEATHS_NERVEGAS,
    
DEATHS_POISON,
    
DEATHS_RADIATION,
    
DEATHS_ACID
}

enum _:TTT_WARNINGS
{
    
WARN_SPECIAL,
    
WARN_INNOCENT,
    
WARN_CONTINUED,
    
WARN_BANNED,
    
WARN_PUNISH,
    
WARN_BADAIM
}

enum _:BOMB_STATUS
{
    
BS_PLANTED,
    
BS_DEFUSED,
    
BS_FAILED,
    
BS_BOMBED
}

enum _:PLAYER_LOYALTY
{
    
PL_NONE,
    
PL_PROVABLE,
    
PL_SUSPICIOUS,
    
PL_AVOIDABLE,
    
PL_TRAITOROUS

sigerman is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:31.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode