Skip to content

Commit 92ab8a8

Browse files
committed
initial
0 parents  commit 92ab8a8

33 files changed

+4475
-0
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
3+
*.smx
4+
/*
5+
6+
!/.gitignore
7+
!/general_insurgency/
8+
!/WIS/
9+
!/Neptune/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"override_mode_config"
2+
{
3+
"checkpoint" "server_checkpoint_neptune.cfg"
4+
"hunt" "server_hunt_neptune.cfg"
5+
"outpost" "server_outpost_neptune.cfg"
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"override_mode_config"
2+
{
3+
"checkpoint" "server_checkpoint_wis.cfg"
4+
"hunt" "server_hunt_wis.cfg"
5+
"outpost" "server_outpost_wis.cfg"
6+
}

WIS/scripting/BreakLimit.sp

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/**
2+
* 1.0 添加了玩家无限负重的功能
3+
* 1.1 添加了玩家无限支援点的功能
4+
* 1.2 添加player_pick_squad的相关逻辑
5+
**/
6+
7+
#pragma semicolon 1
8+
#pragma newdecls required
9+
10+
#include <sourcemod>
11+
#include <sdktools>
12+
13+
#include "INSExtendAPI"
14+
15+
#define PLUGIN_NAME "限制修改"
16+
#define PLUGIN_AUTHOR "PakuPaku"
17+
#define PLUGIN_DESCRIPTION "限制修改"
18+
#define PLUGIN_VERSION "1.2"
19+
#define PLUGIN_URL "https://github.com/TFXX"
20+
21+
public Plugin myinfo =
22+
{
23+
name = PLUGIN_NAME,
24+
author = PLUGIN_AUTHOR,
25+
description = PLUGIN_DESCRIPTION,
26+
version = PLUGIN_VERSION,
27+
url = PLUGIN_URL
28+
};
29+
30+
public void OnPluginStart()
31+
{
32+
PrintToServer("%sV%s]正在加载插件...", PLUGIN_NAME, PLUGIN_VERSION);
33+
34+
//create_forward();
35+
36+
init_plugin_convars();
37+
//init_sdk_calls();
38+
hook_events();
39+
40+
//g_cookieShowHealth = RegClientCookie("display_health", "是否显示血量", CookieAccess_Private);
41+
42+
PrintToServer("%sV%s]插件加载完成!", PLUGIN_NAME, PLUGIN_VERSION);
43+
}
44+
45+
public void OnPluginEnd()
46+
{
47+
unhook_events();
48+
49+
//delete_forward();
50+
}
51+
52+
static ConVar g_cvarInfCarryWeight = null;
53+
static ConVar g_cvarInfSupplyPoint = null;
54+
55+
static void init_plugin_convars()
56+
{
57+
g_cvarInfCarryWeight = CreateConVar("sm_break_limit_infinite_carry_weight", "1", "是否让玩家的负重为无限", FCVAR_NONE);
58+
g_cvarInfSupplyPoint = CreateConVar("sm_break_limit_infinite_supply_point", "0", "是否让玩家的支援点为无限", FCVAR_NONE);
59+
AutoExecConfig(true, "plugin.BreakLimit");
60+
}
61+
62+
static void hook_events()
63+
{
64+
HookEventEx("player_pick_squad", EVENTS_POST_player_pick_squad, EventHookMode_Post);
65+
HookEventEx("weapon_deploy", EVENTS_POST_weapon_deploy, EventHookMode_Post);
66+
}
67+
68+
static void unhook_events()
69+
{
70+
UnhookEvent("weapon_deploy", EVENTS_POST_weapon_deploy, EventHookMode_Post);
71+
UnhookEvent("player_pick_squad", EVENTS_POST_player_pick_squad, EventHookMode_Post);
72+
}
73+
74+
static Action EVENTS_POST_player_pick_squad(Event event, const char[] name, bool dontBroadcast)
75+
{
76+
int client = GetClientOfUserId(GetEventInt(event, "userid"));
77+
make_carry_weight_infinite(client);
78+
make_supply_point_infinite(client);
79+
return Plugin_Continue;
80+
}
81+
82+
static Action EVENTS_POST_weapon_deploy(Event event, const char[] name, bool dontBroadcast)
83+
{
84+
int client = GetClientOfUserId(GetEventInt(event, "userid"));
85+
make_carry_weight_infinite(client);
86+
make_supply_point_infinite(client);
87+
return Plugin_Continue;
88+
}
89+
90+
static void make_carry_weight_infinite(int client)
91+
{
92+
if (!g_cvarInfCarryWeight.BoolValue)
93+
{
94+
return;
95+
}
96+
97+
//set_player_carry_weight(client, 0);
98+
set_player_weight_cache(client, 0);
99+
}
100+
101+
static void make_supply_point_infinite(int client)
102+
{
103+
if (!g_cvarInfSupplyPoint.BoolValue)
104+
{
105+
return;
106+
}
107+
108+
set_player_recieved_tokens(client, 255);
109+
set_player_available_tokens_tokens(client, 255);
110+
}

WIS/scripting/Debug.sp

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
#pragma semicolon 1
2+
#pragma newdecls required
3+
4+
#include <sourcemod>
5+
#include <sdkhooks>
6+
#include <sdktools>
7+
#include <dhooks>
8+
#include <vectorhint>
9+
#include "INSExtendAPI"
10+
11+
#define PLUGIN_NAME "调试模块"
12+
#define PLUGIN_AUTHOR "tg"
13+
#define PLUGIN_DESCRIPTION "辅助调试"
14+
#define PLUGIN_VERSION "1.0"
15+
#define PLUGIN_URL "https://github.com/TFXX"
16+
17+
public Plugin myinfo = {
18+
name= PLUGIN_NAME,
19+
author = PLUGIN_AUTHOR,
20+
description = PLUGIN_DESCRIPTION,
21+
version = PLUGIN_VERSION,
22+
url = PLUGIN_URL
23+
};
24+
25+
Handle g_fn;
26+
27+
public void OnPluginStart()
28+
{
29+
30+
GameData gd = LoadGameConfigFile("insurgency.games");
31+
32+
/*
33+
DynamicDetour dtr = DHookCreateDetour(Address_Null, CallConv_THISCALL, ReturnType_Void, ThisPointer_CBaseEntity);
34+
res = dtr.SetFromConf(gd, SDKConf_Signature, "CINSPlayer::OnNearPlayer");
35+
PrintToServer("%b", res);
36+
dtr.AddParam(HookParamType_CBaseEntity);
37+
dtr.AddParam(HookParamType_Float);
38+
res = dtr.Enable(Hook_Post, OnHookPost);
39+
PrintToServer("%b", res);
40+
*/
41+
42+
// CTeam::GetAliveMembers();
43+
StartPrepSDKCall(SDKCall_Entity);
44+
PrepSDKCall_SetFromConf(gd, SDKConf_Signature, "CTeam::GetAliveMembers");
45+
PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
46+
g_fn = EndPrepSDKCall();
47+
if (INVALID_HANDLE == g_fn)
48+
{
49+
SetFailState("SDKCALL初始化失");
50+
}
51+
52+
PrintToServer("%d", MaxClients);
53+
54+
RegConsoleCmd("d", cmd);
55+
}
56+
57+
public void OnMapStart()
58+
{
59+
char gamemode[32];
60+
FindConVar("mp_gamemode").GetString(gamemode, 32);
61+
PrintToServer(gamemode);
62+
}
63+
64+
stock Action cmd(int client, int args)
65+
{
66+
/*
67+
int weapon = CINSPlayer_GetActiveINSWeapon(client);
68+
int primary_ammo = GetEntProp(weapon, Prop_Data, "m_iPrimaryAmmoCount");
69+
char classname[64];
70+
GetEntityClassname(weapon, classname, sizeof(classname));
71+
int entity = CreateEntityByName(classname);
72+
PrintToConsole(client, "%d %d", entity, primary_ammo);
73+
DispatchKeyValue(entity, "solid", "6");
74+
DispatchKeyValue(entity, "count", "9999");
75+
float ground_pos[3];
76+
GetClientAimGround(client, ground_pos);
77+
TeleportEntity(entity, ground_pos, NULL_VECTOR, NULL_VECTOR);
78+
DispatchSpawn(entity);
79+
SetEntityMoveType(entity, MOVETYPE_NONE);
80+
81+
*/
82+
83+
int offset = FindSendPropInfo("CINSPlayer", "m_EquippedGear");
84+
PrintToConsole(client, "offset : %d", offset);
85+
int gear[7];
86+
for (int i = 0; i < 7; i++)
87+
{
88+
gear[i] = GetEntData(client, i * 4 + offset);
89+
PrintToConsole(client, "%d : %d", i, gear[i]);
90+
}
91+
92+
/*
93+
sec_light_armor
94+
ins_light_armor
95+
sec_heavy_armor
96+
ins_heavy_armor
97+
sec_chest_rig
98+
ins_chest_rig
99+
sec_chest_carrier
100+
ins_chest_carrier
101+
?nightmap
102+
*/
103+
104+
return Plugin_Continue;
105+
}
106+
107+
stock MRESReturn OnHookPost(int entity, DHookParam param)
108+
{
109+
int entity2 = DHookGetParam(param, 1);
110+
float d = DHookGetParam(param, 2);
111+
PrintToConsole(entity, "%d -> %d = %f", entity, entity2, d);
112+
return MRES_Ignored;
113+
}
114+
115+
116+
117+
float DOWN_VECTOR[3] = {90.0, 0.0, 0.0};
118+
stock bool GetClientAimGround(int client, float ground_pos[3])
119+
{
120+
float pos[3];
121+
float angle[3];
122+
GetClientEyePosition(client, pos);
123+
GetClientEyeAngles(client, angle);
124+
125+
Handle ray = TR_TraceRayFilterEx(pos, angle, MASK_SOLID_BRUSHONLY, RayType_Infinite, TraceWorldOnly_TRACE_FILTER, client);
126+
127+
if (!TR_DidHit(ray))
128+
{
129+
CloseHandle(ray);
130+
return false;
131+
}
132+
133+
TR_GetEndPosition(pos, ray);
134+
CloseHandle(ray);
135+
136+
ray = TR_TraceRayFilterEx(pos, DOWN_VECTOR, MASK_SOLID_BRUSHONLY, RayType_Infinite, TraceWorldOnly_TRACE_FILTER, client);
137+
if (!TR_DidHit(ray))
138+
{
139+
CloseHandle(ray);
140+
return false;
141+
}
142+
143+
144+
TR_GetEndPosition(ground_pos, ray);
145+
CloseHandle(ray);
146+
return true;
147+
}
148+
149+
const float MATH_PI = 3.14159265359;
150+
151+
public bool TraceWorldOnly_TRACE_FILTER(int entity, int contents_mask, any data)
152+
{
153+
//return (entity != data && entity <= 0);
154+
if(entity == data || entity > 0)
155+
return false;
156+
return true;
157+
}

0 commit comments

Comments
 (0)