Skip to content

Commit

Permalink
Merging with my code from another code base.
Browse files Browse the repository at this point in the history
  • Loading branch information
jr551 committed Aug 17, 2021
1 parent 816b34a commit dc229d6
Show file tree
Hide file tree
Showing 43 changed files with 197 additions and 1 deletion.
29 changes: 28 additions & 1 deletion dlls/bot_combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,27 @@ typedef struct
} bot_fire_delay_t;


bot_weapon_select_t sgtc_weapon_select[] = {
{SGTC_WEAPON_LANCE, "weapon_lance", 5, 0.0, 9999.0, 0.0, 9999.0,
100, FALSE, 80, 1, 10, FALSE, FALSE, FALSE, TRUE, 0.0, 0.8},
{SGTC_WEAPON_ZAT, "weapon_zat", 5, 0.0, 1200.0, 0.0, 1200.0,
100, TRUE, 70, 1, 1, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0},
/* terminator */
{0, "", 0, 0.0, 0.0, 0.0, 0.0, 0, TRUE, 0, 1, 1, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}
};

bot_fire_delay_t sgtc_fire_delay[] = {
{SGTC_WEAPON_LANCE,
0.2, {0.0, 0.2, 0.3, 0.5, 1.0}, {0.1, 0.3, 0.5, 0.8, 1.2},
1.0, {0.2, 0.3, 0.5, 0.8, 1.2}, {0.5, 0.7, 1.0, 1.5, 2.0}},
{SGTC_WEAPON_ZAT,
0.3, {0.0, 0.1, 0.2, 0.3, 0.4}, {0.1, 0.2, 0.3, 0.4, 0.5},
0.2, {0.0, 0.0, 0.1, 0.1, 0.2}, {0.1, 0.1, 0.2, 0.2, 0.4}},
/* terminator */
{0, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0},
0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}
};

// weapons are stored in priority order, most desired weapon should be at
// the start of the array and least desired should be at the end

Expand Down Expand Up @@ -800,7 +821,13 @@ bool BotFireWeapon( Vector v_enemy, bot_t *pBot, int weapon_choice)

float distance = v_enemy.Length(); // how far away is the enemy?

if (mod_id == VALVE_DLL)
if (true)
{

pSelect = &sgtc_weapon_select[0];
pDelay = &sgtc_fire_delay[0];
}
else if (mod_id == VALVE_DLL)
{
pSelect = &valve_weapon_select[0];
pDelay = &valve_fire_delay[0];
Expand Down
6 changes: 6 additions & 0 deletions dlls/bot_weapons.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
#ifndef BOT_WEAPONS_H
#define BOT_WEAPONS_H


#define SGTC_WEAPON_CROWBAR 1
#define SGTC_WEAPON_ZAT 2
#define SGTC_WEAPON_LANCE 4


// weapon ID values for Valve's Half-Life Deathmatch
#define VALVE_WEAPON_CROWBAR 1
#define VALVE_WEAPON_GLOCK 2
Expand Down
163 changes: 163 additions & 0 deletions sgtcweps.sma
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <engine>
#define PLUGIN "SGTC BOTS GIVE WEAPONS"
#define VERSION "1.0"
#define AUTHOR "Freeman"
public plugin_init()
{
register_plugin(PLUGIN,VERSION,AUTHOR)
register_event("ResetHUD", "event_spawn", "b");
set_task(float(10),"checkPlayers",_,_,_,"b")
}
public event_spawn(id)
{
//log_amx( "[SGTC Weapons] spawn.");
//make_sure_has_gun(id);
}
public make_sure_has_gun(id)
{
if(is_user_alive(id) && is_user_bot(id) )
{
new iWeapon = get_user_weapon( id );
new szWeapon[ 32 ];
if ( iWeapon )
get_weaponname( iWeapon , szWeapon , 31 );
else
return 0;
new szUsername[ 32 ];
get_user_name(id, szUsername, 31);
log_amx( "[SGTC Weapons] %s has weapon: %s.", szUsername, szWeapon);
if (equal( szWeapon, "weapon_batsup") || equal( szWeapon, "weapon_coujaf") || equal( szWeapon, "weapon_couteau") )
{
if ( get_user_team(id) == 1 ) //tauri
{
new iChance = random_num(0, 4);
if (iChance == 0)
{
give_item(id, "weapon_mp5")
}
else if (iChance == 1)
{
give_item(id, "weapon_psg1")
}
else if (iChance == 2)
{
give_item(id, "weapon_psg1")
}
else if (iChance == 3)
{
give_item(id, "weapon_m16")
}
else
{
give_item(id, "weapon_p90")
}
}
else // goauld
{
new iChance = random_num(0, 4);
if (iChance == 0)
{
give_item(id, "weapon_reetou")
}
else if (iChance == 1)
{
give_item(id, "weapon_glstaff")
}
else if (iChance == 2)
{
give_item(id, "weapon_zatarc")
}
else if (iChance == 3)
{
give_item(id, "weapon_lance")
}
else
{
give_item(id, "weapon_main")
}
}
}
else
{
//log_amx( "[SGTC Weapons] (dont give a wep) %s has weapon: %s.", szUsername, szWeapon);
}
}
}
public checkPlayers() {
new realPlayers = 0;
log_amx( "[SGTC Weapons] checkPlayers.");
for (new i = 1; i <= get_maxplayers(); i++) {
if ( !is_user_bot(i) && is_user_alive(i) ) {
realPlayers = realPlayers + 1;
}
if (is_user_alive(i) && is_user_connected(i) ) {
make_sure_has_gun(i) ;
}
if (is_user_bot(i) && get_user_team(i) == 0 )
{
log_amx( "[SGTC Weapons] force spectating bot to join.");
new iChance = random_num(0, 1);
if (iChance == 0)
client_cmd(i,"jointeam 1;classe 1 1") ;
else
client_cmd(i,"jointeam 2;classe 2 2") ;
}
}
if (/*realPlayers < 1 &&*/ get_cvar_num("mp_timeleft") < 0)
{
log_amx( "[SGTC ] killbots.");
/*for (new i = 1; i <= get_maxplayers(); i++) {
user_kill(i);*/
new szNextMap[ 32 ];
new szcmd[ 64 ];
get_cvar_string( "amx_nextmap", szNextMap, 31);
format(szcmd,64,"changelevel %s", szNextMap);
server_cmd(szcmd);
//}
}
return PLUGIN_HANDLED;
}
Binary file added waypoints/ctp_amon.HPB_wp1
Binary file not shown.
Binary file added waypoints/ctp_amon.HPB_wpt
Binary file not shown.
Binary file added waypoints/ctp_crypt.HPB_wp1
Binary file not shown.
Binary file added waypoints/ctp_crypt.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_chateau.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_chateau.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_conquest.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_conquest.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_crypt.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_crypt.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_escape.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_escape.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_hina.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_hina.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_land3.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_land3.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_loop.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_loop.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_newstrike.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_newstrike.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_nox.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_nox.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_prison.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_pyramide.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_quietvillage.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_quietvillage.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_shunky.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_shunky.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_stargate.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_stargate.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_strike3.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_strike3.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_target2a.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_tekluhanak.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_temple.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_temple.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_thor.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_thor.HPB_wpt
Binary file not shown.
Binary file added waypoints/sg_tokra2.HPB_wp1
Binary file not shown.
Binary file added waypoints/sg_tokra2.HPB_wpt
Binary file not shown.

0 comments on commit dc229d6

Please sign in to comment.