reapi
reapi copied to clipboard
rg_remove_item
Made a simple plugin for my server (on new round, remove players HE-nades on small maps)
#include <amxmodx>
#include <reapi>
public plugin_init()
{
if (strcmp(MapName, "$2000") == 0 || containi(MapName, "fy_") != -1) {
RegisterHookChain(RG_CBasePlayer_OnSpawnEquip, "CBasePlayer_OnSpawnEquip", true);
}
else {
pause("ad");
}
}
public CBasePlayer_OnSpawnEquip(id)
{
if (rg_remove_item(id, "weapon_hegrenade"))
{
client_print(id, print_center, "*** Balance: Your HE was removed ***");
}
}
Works fine but got a problem: after the item is removed from the player's inventory, he can no longer pick it up (armoury_entity, weaponbox) until he dies.
Would do you think about RemovePlayerItemEx?
Try to use rg_remove_items_by_slot
Try to use
rg_remove_items_by_slot
i want to save flash smoke
This fixes it, but devs did not get it, & the PR became too loud now, it emits "snore" sounds! @JUNESYNGOTOFLEX: Set second parameter (removeAmmo) of "rg_remove_item" to true to enforce ammo clean up & fix issue.
This fixes it, but devs did not get it, & the PR became too loud now, it emits "snore" sounds! @JUNESYNGOTOFLEX: Set second parameter (removeAmmo) of "rg_remove_item" to true to enforce ammo clean up & fix issue.
no, i tried this too
Did you tried that?
rg_remove_item(id, "weapon_hegrenade", true)
Are you sure? Because it should fix the pick up & avoid the "You already have that item" (or "You can not carry anymore!") when trying to buy.
"rg_remove_item(id, "weapon_hegrenade", true)" ? Are you sure? Because it should fix the pick up & avoid the "You already have that item" when trying to buy.
my bad, sorry, fixed
Why not just find all the entities on the ground that are flashes and remove them? Save yourself the event calls.
Try to use RG_CBasePlayer_HasRestrictItem, do the same job
"Finally fixed here: https://github.com/s1lentq/ReGameDLL_CS/commit/d7b44099e763d2ed8784cc68b86f84c9a65ad539
Now, if removeAmmo = true, it will remove the item and its entire stock. If removeAmmo = false, then for grenades, it will remove one stock at a time, and if there is only one stock left, it will remove the grenade entirely."
After this fix, you will now be able to pick up or purchase additional grenades after deletion
Closed as fixed #864