Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
empfun
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sourcemod
empfun
Commits
6309a30f
Commit
6309a30f
authored
Mar 27, 2020
by
Mikleo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--
parent
e5eeb427
Pipeline
#9042
passed with stages
in 14 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
18 deletions
+38
-18
dist/addons/sourcemod/plugins/empfun.smx
dist/addons/sourcemod/plugins/empfun.smx
+0
-0
dist/addons/sourcemod/scripting/empfun.sp
dist/addons/sourcemod/scripting/empfun.sp
+33
-15
dist/cfg/editor.cfg
dist/cfg/editor.cfg
+4
-2
dist/updater.txt
dist/updater.txt
+1
-1
No files found.
dist/addons/sourcemod/plugins/empfun.smx
View file @
6309a30f
No preview for this file type
dist/addons/sourcemod/scripting/empfun.sp
View file @
6309a30f
...
...
@@ -9,7 +9,7 @@
#include <updater>
#define PluginVersion "0.9
0
"
#define PluginVersion "0.9
1
"
float pVersion;
// note linearmap field is unstable
...
...
@@ -43,7 +43,7 @@ float grabbedAngleDifference[MAXPLAYERS+1] = {0.0, ...};
float grabDistance [MAXPLAYERS+1] = {0.0, ...};
float grabOffset [MAXPLAYERS+1] = {0.0, ...};
bool lockgrab
height [MAXPLAYERS+1] = {false, ...}
;
bool lockgrab
axis [MAXPLAYERS+1][3]
;
bool lockgrabrotation [MAXPLAYERS+1] = {false, ...};
...
...
@@ -162,7 +162,7 @@ public void OnPluginStart()
RegConsoleCmd("sm_entcontextheight", Command_Ent_ContextHeight);
RegConsoleCmd("sm_entcontextangle", Command_Ent_ContextAngle);
RegConsoleCmd("sm_gridsize", Command_Player_Grid_Size);
RegConsoleCmd("sm_lockgrab
height", Command_Lock_Grab_Height
);
RegConsoleCmd("sm_lockgrab
axis", Command_Lock_Grab_Axis
);
RegConsoleCmd("sm_lockgrabrotation", Command_Lock_Grab_Rotation);
...
...
@@ -263,7 +263,9 @@ public void OnLibraryAdded(const char[] name)
public OnClientConnected(int client)
{
playerGridSize[client] = 0.1;
lockgrabheight[client] = false;
lockgrabaxis[client][0] = false;
lockgrabaxis[client][1] = false;
lockgrabaxis[client][2] = false;
lockgrabrotation[client] = false;
}
public OnMapStart()
...
...
@@ -2761,21 +2763,31 @@ public Action:Hook_Grab(grabbingClient,client)
pos[0]+=eyeDir[0]*distance;
pos[1]+=eyeDir[1]*distance;
pos[2]+=grabOffset[client];
if(lockgrabheight[client])
{
float entityPos[3];
GetEntPropVector(grabbedEntity[client], Prop_Send, "m_vecOrigin", entityPos);
float entityPos[3];
GetEntPropVector(grabbedEntity[client], Prop_Send, "m_vecOrigin", entityPos);
if(lockgrabaxis[client][0])
{
pos[0] = entityPos[0];
}
if(lockgrabaxis[client][1])
{
pos[1] = entityPos[1];
}
if(lockgrabaxis[client][2])
{
pos[2] = entityPos[2];
}
decl Float:propAng[3];
GetEntPropVector(entity, Prop_Send, "m_angRotation", propAng);
if(lockgrabrotation[client])
propAng[1] = eyeAngles[1] + grabbedAngleDifference[client];
...
...
@@ -5241,7 +5253,7 @@ public Action Command_Player_Grid_Size(int client, int args)
return Plugin_Handled;
}
public Action Command_Lock_Grab_
Height
(int client, int args)
public Action Command_Lock_Grab_
Axis
(int client, int args)
{
if(!CanEditMap(client))
{
...
...
@@ -5250,12 +5262,18 @@ public Action Command_Lock_Grab_Height(int client, int args)
if(client == 0)
client = 1;
lockgrabheight[client] = !lockgrabheight[client];
char arg[64];
GetCmdArg(1, arg, sizeof(arg));
int axis = StringToInt(arg);
if(axis > 2 || axis <0)
axis = 0;
lockgrabaxis[client][axis] = !lockgrabaxis[client][axis];
if(lockgrab
height[client
])
PrintToChat(client,"grab
height locked"
);
if(lockgrab
axis[client][axis
])
PrintToChat(client,"grab
axis %d locked",axis
);
else
PrintToChat(client,"grab
height unlocked"
);
PrintToChat(client,"grab
axis %d unlocked",axis
);
return Plugin_Handled;
}
...
...
dist/cfg/editor.cfg
View file @
6309a30f
...
...
@@ -36,5 +36,7 @@ bind "l" "sm_entcontextangle 5 z"
bind "CTRL" "+movedown"
bind "SPACE" "+moveup"
bind "f1" "sm_lockgrabheight"
bind "f2" "sm_lockgrabrotation"
bind "f1" "sm_lockgrabrotation"
bind "f2" "sm_lockgrabaxis 0"
bind "f3" "sm_lockgrabaxis 1"
bind "f4" "sm_lockgrabaxis 2"
dist/updater.txt
View file @
6309a30f
...
...
@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "0.9
0
"
"Latest" "0.9
2
"
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment