Compare commits

..

5 Commits

Author SHA1 Message Date
Resxt
36d38a1aca Update README.md 2025-10-25 22:23:33 +02:00
Resxt
af2937a9c9 chat_command_god_mode 1.0.4
Fixed an unresolved external error introduced in 1.0.3
2025-09-20 17:12:14 +02:00
Resxt
8cceef1167 chat_command_god_mode 1.0.3
Added Origins robot exit as a waittill to re-apply god mode, since the game's script disables invulnerability when you exit it
2025-09-20 15:09:21 +02:00
Resxt
15c0cbf7cb chat_command_info 1.2.1
Removed on screen printing for weapons and attachments since it wasn't very practical due to the amount of elements to display and the use cases. It now prints to the console instead

Added console printing for powerups and perks while keeping on screen printing
2025-09-20 15:06:54 +02:00
Resxt
af452157f6 chat_commands 1.1.7
Updated GetAvailablePerks util function

Instead of returning perks from the vending machine, it will now return all perks from the wunderfizz if the map has wunderfizz machine(s). If not then it will use the regular perks machines just like before (fixed Origins returning 5 perks instead of the 9 available)
2025-09-20 15:03:58 +02:00
4 changed files with 56 additions and 28 deletions

View File

@@ -8,14 +8,18 @@ If you do monitor your server with [IW4MAdmin](https://github.com/RaidMax/IW4M-A
The `chat_command` scripts you find here work for both MP and ZM and can be placed in the `scripts` folder.
MP only scripts are in the [mp](mp) folder and ZM only scripts are in the [zm](zm) folder.
- **[IMPORTANT]** For dedicated servers, by default, each command is available on any server listed in the `level.chat_commands["ports"]` array variable declared in `chat_commands.gsc`.
If you use a port other than 4976 and 4977 you have to add them manually to this array to be used by any command.
If a specific command should only be available on certain server(s) (ports) then edit the CreateCommand function in the command's script to use an array you declare yourself with the port(s) you want
## chat_commands.gsc
The core script that holds the configuration, runs all the chat logic and holds utils function that are shared between all the `chat_command` scripts.
**[IMPORTANT]** Installing `chat_commands.gsc` is **mandatory** to make the commands work as this is the core of this whole system and all the command scripts depend on it.
**[IMPORTANT]** By default `chat_commands.gsc` is made to be placed in the `scripts` folder.
- **[IMPORTANT]** Installing `chat_commands.gsc` is **mandatory** to make the commands work as this is the core of this whole system and all the command scripts depend on it.
- **[IMPORTANT]** By default `chat_commands.gsc` is made to be placed in the `scripts` folder.
If you place it in the `scripts\mp` or `scripts\zm` folder instead then you will need to update the include of each command script accordingly (first line) or you will get errors.
You simply have to replace `#include scripts\chat_commands` with `#include scripts\mp\chat_commands;` or `#include scripts\zm\chat_commands;` in each of your command script.
You simply have to replace `#include scripts\chat_commands` with `#include scripts\mp\chat_commands;` or `#include scripts\zm\chat_commands;` in each of your command script.
Also note that `chat_commands.gsc` doesn't provide any command on its own.
You must install at least one command script to be able to use commands. Otherwise it will always say that you don't have any command.

View File

@@ -1,4 +1,5 @@
#include scripts\chat_commands;
#include common_scripts\utility;
Init()
{
@@ -60,7 +61,7 @@ ThreadGodMode()
for(;;)
{
self waittill("spawned_player");
self waittill_any("spawned_player", "gr_eject_sequence_complete"); // Origins robot ejected
self DoGodMode(true);
}

View File

@@ -61,7 +61,9 @@ ListPerksCommand(args)
ListWeapons(displayMode)
{
waitTime = 1.5;
PrintLn("-------------------------------");
PrintLn("Available weapons");
PrintLn("-------------------------------");
if (IsMultiplayerMode())
{
@@ -69,16 +71,14 @@ ListWeapons(displayMode)
{
foreach (index in GetArrayKeys(level.tbl_weaponids))
{
self thread TellPlayer(array(getweapondisplayname(level.tbl_weaponids[index]["reference"] + "_mp")), waitTime);
wait waitTime;
PrintLn(getweapondisplayname(level.tbl_weaponids[index]["reference"] + "_mp"));
}
}
else
{
foreach (index in GetArrayKeys(level.tbl_weaponids))
{
self thread TellPlayer(array(level.tbl_weaponids[index]["reference"] + "_mp"), waitTime);
wait waitTime;
PrintLn(level.tbl_weaponids[index]["reference"] + "_mp");
}
}
}
@@ -88,16 +88,14 @@ ListWeapons(displayMode)
{
foreach (weapon in GetArrayKeys(level.zombie_weapons))
{
self thread TellPlayer(array(getweapondisplayname(weapon)), waitTime);
wait waitTime;
PrintLn(getweapondisplayname(weapon));
}
}
else
{
foreach (weapon in GetArrayKeys(level.zombie_weapons))
{
self thread TellPlayer(array(weapon), waitTime);
wait waitTime;
PrintLn(weapon);
}
}
}
@@ -139,26 +137,44 @@ ListAttachments(weaponName)
attachmentsFinal = AddElementToArray(attachmentsFinal, StrTok(attachment, "_")[0]);
}
self thread TellPlayer(attachmentsFinal, 2);
PrintLn("-------------------------------");
PrintLn("Available attachments for " + getweapondisplayname(finalWeaponName) + " (" + StrTok(finalWeaponName, "_mp")[0] + "_mp" + ")");
PrintLn("-------------------------------");
if (DebugIsOn())
foreach (attachment in attachmentsFinal)
{
Print("-------------------------------");
Print("Available attachments for " + getweapondisplayname(finalWeaponName) + " (" + StrTok(finalWeaponName, "_mp")[0] + "_mp" + ")");
foreach (attachment in attachmentsFinal)
{
Print(attachment);
}
PrintLn(attachment);
}
}
ListPowerups()
{
self thread TellPlayer(GetAvailablePowerups(), 2);
powerups = GetAvailablePowerups();
self thread TellPlayer(powerups, 2);
PrintLn("-------------------------------");
PrintLn("Available powerups");
PrintLn("-------------------------------");
foreach (powerup in powerups)
{
PrintLn(powerup);
}
}
ListPerks()
{
self thread TellPlayer(GetAvailablePerks(), 2);
perks = GetAvailablePerks();
self thread TellPlayer(perks, 2);
PrintLn("-------------------------------");
PrintLn("Available perks");
PrintLn("-------------------------------");
foreach (perk in perks)
{
PrintLn(perk);
}
}

View File

@@ -780,14 +780,21 @@ GetAvailablePerks()
{
perks = [];
foreach (machine in GetEntArray( "zombie_vending", "targetname" ))
if (GetEntArray("random_perk_machine", "targetname").size == 0)
{
if (machine.script_noteworthy != "specialty_weapupgrade")
foreach (machine in GetEntArray( "zombie_vending", "targetname" ))
{
perks = AddElementToArray(perks, machine.script_noteworthy);
if (machine.script_noteworthy != "specialty_weapupgrade")
{
perks = AddElementToArray(perks, machine.script_noteworthy);
}
}
}
Print("perkssize: " + perks.size);
else
{
perks = level._random_perk_machine_perk_list;
}
return perks;
}