diff options
| author | navewindre <nw@moneybot.cc> | 2023-12-04 18:06:10 +0100 |
|---|---|---|
| committer | navewindre <nw@moneybot.cc> | 2023-12-04 18:06:10 +0100 |
| commit | aef0d1c1268ab7d4bc18996c9c6b4da16a40aadc (patch) | |
| tree | 43e766b51704f4ab8b383583bdc1871eeeb9c698 /sourcemod/scripting/gokz-measure/commands.sp | |
| parent | 38f1140c11724da05a23a10385061200b907cf6e (diff) | |
bbbbbbbbwaaaaaaaaaaa
Diffstat (limited to 'sourcemod/scripting/gokz-measure/commands.sp')
| -rw-r--r-- | sourcemod/scripting/gokz-measure/commands.sp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/sourcemod/scripting/gokz-measure/commands.sp b/sourcemod/scripting/gokz-measure/commands.sp new file mode 100644 index 0000000..5fe3028 --- /dev/null +++ b/sourcemod/scripting/gokz-measure/commands.sp @@ -0,0 +1,49 @@ +void RegisterCommands() +{ + RegConsoleCmd("+measure", CommandMeasureStart, "[KZ] Set the measure origin."); + RegConsoleCmd("-measure", CommandMeasureEnd, "[KZ] Set the measure origin."); + RegConsoleCmd("sm_measure", CommandMeasureMenu, "[KZ] Open the measurement menu."); + RegConsoleCmd("sm_measuremenu", CommandMeasureMenu, "[KZ] Open the measurement menu."); + RegConsoleCmd("sm_measureblock", CommandMeasureBlock, "[KZ] Measure the block distance."); +} + +public Action CommandMeasureMenu(int client, int args) +{ + DisplayMeasureMenu(client); + return Plugin_Handled; +} + +public Action CommandMeasureStart(int client, int args) +{ + if (!IsValidClient(client)) + { + return Plugin_Handled; + } + gB_Measuring[client] = true; + MeasureGetPos(client, 0); + return Plugin_Handled; +} + +public Action CommandMeasureEnd(int client, int args) +{ + if (!IsValidClient(client)) + { + return Plugin_Handled; + } + gB_Measuring[client] = false; + MeasureGetPos(client, 1); + MeasureDistance(client, MEASURE_MIN_DIST); + CreateTimer(4.9, Timer_DeletePoints, GetClientUserId(client)); + return Plugin_Handled; +} + +public Action CommandMeasureBlock(int client, int args) +{ + if (!IsValidClient(client)) + { + return Plugin_Handled; + } + MeasureBlock(client); + CreateTimer(4.9, Timer_DeletePoints, GetClientUserId(client)); + return Plugin_Handled; +}
\ No newline at end of file |
