AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [CZ] Bot Skin Militia/Spetsnaz on Expert difficulty (https://forums.alliedmods.net/showthread.php?t=339256)

SoulWeaver16 08-28-2022 12:54

[CZ] Bot Skin Militia/Spetsnaz on Expert difficulty
 
1 Attachment(s)
I have this sma, whose function is to quickly correct, that in high difficulty the BOTs also choose the Militia/Spetsnaz class, but the problem is that it usually creates model errors, having like 2 VIPs (although one is the real one), and a Terrorist with an anti-terrorist skin.
Code:

#include amxmodx
#include cstrike
#include hamsandwich
#include engine
 
new const szRandomSkinT[5][] =
{
    "arctic",
    "guerilla",
    "leet",
    "militia",
    "terror"
}
 
new const szRandomSkinCT[5][] =
{
    "gign",
    "gsg9",
    "sas",
    "urban",
    "spetsnaz"
}

new bool:g_bRegisterBots = true
new bool:bWasVIP[MAX_PLAYERS+1]
new const g_szVIPModelName[] = "vip"
 
public plugin_init()
{
        register_plugin("CZ Bot Skin", "1.1", "KayDee")
        register_logevent("LogEvent_JoinTeam", 3, "1=joined team")
       
        if(find_ent_by_class(-1, "func_vip_safetyzone") != 0)
                g_bRegisterBots = false
}

public client_putinserver(id) bWasVIP[id] = false
 
public LogEvent_JoinTeam()
{
    new id = GetLogUserIndex()
 
    if(!is_user_connected(id) || !is_user_bot(id)) return PLUGIN_CONTINUE
   
    if(!g_bRegisterBots)
    {
        g_bRegisterBots = true
        RegisterHamFromEntity(Ham_Spawn, id, "Ham_Spawn_player_Post", 1)
        Ham_Spawn_player_Post(id)
    }
 
    static szTeam[2]
    read_logargv(2, szTeam, 1)
    switch(szTeam[0])
    {
        case 'T': cs_set_user_model(id, szRandomSkinT[random_num(0, 5)])
        case 'C': cs_set_user_model(id, szRandomSkinCT[random_num(0, 5)])
    }
    return PLUGIN_CONTINUE
}

public Ham_Spawn_player_Post(id)
{
        if(!is_user_alive(id)) return HAM_IGNORED
       
        if(!cs_get_user_vip(id) && bWasVIP[id])
        {
                bWasVIP[id] = false
                new CsTeams:Team = cs_get_user_team(id)
                switch(Team)
                {
                        case CS_TEAM_T: cs_set_user_model(id, szRandomSkinT[random_num(0, 5)])
                        case CS_TEAM_CT: cs_set_user_model(id, szRandomSkinCT[random_num(0, 5)])
                }
        }
        else if(cs_get_user_vip(id))
        {
                bWasVIP[id] = true
                cs_set_user_model(id, g_szVIPModelName)
        }
        return HAM_IGNORED
}

GetLogUserIndex()
{
    static szLogUser[80], szName[32]
    read_logargv( 0, szLogUser, charsmax( szLogUser ) )
    parse_loguser( szLogUser, szName, charsmax( szName ) )
    return get_user_index( szName )
}

What could be corrected or is there a better way to do it without having to apply a correct skin each round?
https://i.imgur.com/fW9gDFL.pnghttps://i.imgur.com/yoX4Qjx.png

counterstrike1.6 08-28-2022 14:31

Re: [CZ] Bot Skin Militia/Spetsnaz on Expert difficulty
 
1 Attachment(s)
What this plugin called [In Green]?

SoulWeaver16 08-28-2022 14:57

Re: [CZ] Bot Skin Militia/Spetsnaz on Expert difficulty
 
Quote:

Originally Posted by counterstrike1.6 (Post 2787606)
What this plugin called [In Green]?

It comes by default in CZ, I don't know if there is a plugin that emulates the same in CS


All times are GMT -4. The time now is 00:20.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.