Raised This Month: $ Target: $400
 0% 

[CZ] Bot Skin Militia/Spetsnaz on Expert difficulty


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SoulWeaver16
Senior Member
Join Date: May 2021
Location: Uruguay
Old 08-28-2022 , 12:54   [CZ] Bot Skin Militia/Spetsnaz on Expert difficulty
Reply With Quote #1

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?
Attached Files
File Type: sma Get Plugin or Get Source (CZ_Bot_Skin_on_Expert.sma - 27 views - 2.0 KB)
__________________
Extended Arm Weapon Skin v2.1 {16/Apr/23}
(Detect which class is and associate it with the corresponding arms)
SideWeapons v0.2 {01/Sep/22}
(New version of Back Weapons v1.87)

SoulWeaver16 is offline
counterstrike1.6
Member
Join Date: Oct 2020
Old 08-28-2022 , 14:31   Re: [CZ] Bot Skin Militia/Spetsnaz on Expert difficulty
Reply With Quote #2

What this plugin called [In Green]?
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2022-08-28 232937.png
Views:	19
Size:	15.5 KB
ID:	196531  
counterstrike1.6 is offline
SoulWeaver16
Senior Member
Join Date: May 2021
Location: Uruguay
Old 08-28-2022 , 14:57   Re: [CZ] Bot Skin Militia/Spetsnaz on Expert difficulty
Reply With Quote #3

Quote:
Originally Posted by counterstrike1.6 View Post
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
__________________
Extended Arm Weapon Skin v2.1 {16/Apr/23}
(Detect which class is and associate it with the corresponding arms)
SideWeapons v0.2 {01/Sep/22}
(New version of Back Weapons v1.87)

SoulWeaver16 is offline
Reply



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 01:23.


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