Skip to content

Commit

Permalink
Release 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dronelektron committed Jan 1, 2023
2 parents a40bbab + 804a904 commit 7cc692f
Show file tree
Hide file tree
Showing 10 changed files with 426 additions and 6 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Allows you to grab, move and throw players

### Console Commands

* sm_gravitygun - Open personal settings menu
* sm_gravitygun_grab - Grab a player
* sm_gravitygun_throw [speed] - Throw a player

Expand All @@ -29,10 +30,20 @@ If you do not specify a `speed`, then the value from `sm_gravitygun_throw_speed`
* sm_gravitygun_capture_mode [value] - Capture mode (static - 0, dynamic - 1) [default: "1"]
* sm_gravitygun_distance [value] - Capture distance (min - 64.0, max - 32768.0) [default: "128.0"]
* sm_gravitygun_speed_factor [value] - How fast to move a player (min - 1.0, max - 10.0) [default: "5.0"]
* sm_gravitygun_throw_speed [value] - Throw speed (min - 1.0, max - 32768.0) [default: "1024.0"]
* sm_gravitygun_cone_angle [value] - Cone angle in degrees (min - 1.0, max - 60.0) [default: "15.0"]
* sm_gravitygun_throw_speed [value] - Throw speed (min - 256.0, max - 32768.0) [default: "1024.0"]
* sm_gravitygun_cone_angle [value] - Cone angle in degrees (min - 5.0, max - 60.0) [default: "15.0"]
* sm_gravitygun_cone_distance [value] - Cone distance (min - 64.0, max - 32768.0) [default: "512.0"]

##### Trace Mode

* Static - Grab a player at a distance specified in the console variable `sm_gravitygun_distance`
* Dynamic - Grab a player at a distance between you and them

##### Capture Mode

* Line - The player who crossed the line will be captured
* Cone - The player who is inside the cone and who is closer to the crosshair will be captured

### Notes

Bind the `sm_gravitygun_grab` command as follows:
Expand Down
4 changes: 3 additions & 1 deletion scripting/gravity-gun.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "gg/client"
#include "gg/math"
#include "gg/menu"
#include "gg/message"
#include "gg/settings-storage"
#include "gg/use-case"
Expand All @@ -11,6 +12,7 @@
#include "modules/console-command.sp"
#include "modules/console-variable.sp"
#include "modules/math.sp"
#include "modules/menu.sp"
#include "modules/message.sp"
#include "modules/settings-storage.sp"
#include "modules/use-case.sp"
Expand All @@ -19,7 +21,7 @@ public Plugin myinfo = {
name = "Gravity gun",
author = "Dron-elektron",
description = "Allows you to grab, move and throw players",
version = "1.5.1",
version = "1.6.0",
url = "https://github.com/dronelektron/gravity-gun"
};

Expand Down
4 changes: 2 additions & 2 deletions scripting/include/gg/client.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
#define SPEED_FACTOR_MAX 10.0
#define SPEED_FACTOR_DEFAULT 5.0

#define THROW_SPEED_MIN 1.0
#define THROW_SPEED_MIN 256.0
#define THROW_SPEED_MAX 32768.0
#define THROW_SPEED_DEFAULT 1024.0

#define CONE_ANGLE_MIN 1.0
#define CONE_ANGLE_MIN 5.0
#define CONE_ANGLE_MAX 60.0
#define CONE_ANGLE_DEFAULT 15.0

Expand Down
15 changes: 15 additions & 0 deletions scripting/include/gg/menu.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#if defined _gg_menu_included
#endinput
#endif
#define _gg_menu_included

#define INFO_MAX_SIZE 256
#define ITEM_MAX_SIZE 256

#define GRAVITY_GUN_SETTINGS "Gravity gun settings"

#define ITEM_TRACE_MODE_LINE "Line"
#define ITEM_TRACE_MODE_CONE "Cone"

#define ITEM_CAPTURE_MODE_STATIC "Static"
#define ITEM_CAPTURE_MODE_DYNAMIC "Dynamic"
1 change: 0 additions & 1 deletion scripting/include/gg/message.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#define PARAMETER_TRACE_MODE "Trace mode"
#define PARAMETER_CAPTURE_MODE "Capture mode"
#define PARAMETER_DISTANCE "Distance"
#define PARAMETER_DISTANCE_STEP "Distance step"
#define PARAMETER_SPEED_FACTOR "Speed factor"
#define PARAMETER_THROW_SPEED "Throw speed"
#define PARAMETER_CONE_ANGLE "Cone angle"
Expand Down
7 changes: 7 additions & 0 deletions scripting/modules/console-command.sp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
void Command_Create() {
RegAdminCmd("sm_gravitygun", Command_SettingsMenu, ADMFLAG_GENERIC);
RegAdminCmd("+sm_gravitygun_grab", Command_CapturePlayer, ADMFLAG_GENERIC);
RegAdminCmd("-sm_gravitygun_grab", Command_ReleasePlayer, ADMFLAG_GENERIC);
RegAdminCmd("sm_gravitygun_throw", Command_ThrowPlayer, ADMFLAG_GENERIC);
Expand All @@ -11,6 +12,12 @@ void Command_Create() {
RegAdminCmd("sm_gravitygun_cone_distance", Command_ConeDistance, ADMFLAG_GENERIC);
}

public Action Command_SettingsMenu(int client, int args) {
Menu_Settings(client);

return Plugin_Handled;
}

public Action Command_CapturePlayer(int client, int args) {
UseCase_CapturePlayer(client);

Expand Down
Loading

0 comments on commit 7cc692f

Please sign in to comment.