2. Albo jak usunąć C4 z inventa, fm_strip_user_weapons(id) nie pomaga.
3. Lub jak usunąć wszystkie(!) rzeczy z inventa i sprawdzić czy nie ma broni?
Spoiler
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <fakemeta_util>
new weaponid //, clip, ammo;
new gBuyCommands[][] =
{
"glock", "usp", "p228", "deagle", "elites", "fn57", "m3", "xm1014", "autoshotgun", "mac10", "tmp", "mp5", "ump45", "p90",
"galil", "ak47", "scout", "sg552", "awp", "g3sg1", "famas", "m4a1", "aug", "bullpup", "sg550", "m249", "shield", "hegren",
"sgren", "flash", "vest", "vesthelm", "defuser", "nvgs", "primammo", "secammo", "km45", "9x19mm", "nighthawk", "228compact",
"12gauge", "smg", "mp", "c90", "cv47", "defender", "clarion", "krieg552", "bullpup", "magnum", "d3au1", "krieg550", "buyammo1",
"buyammo2", "fullupdate", "cl_autobuy", "cl_rebuy", "cl_setautobuy", "rebuy", "autobuy", "buy"
}
public plugin_init()
{
register_plugin("Sub-Machine","0.1","CamiLoWski")
register_event("CurWeapon", "AktualnaBron", "be", "1=1")
RegisterHam(Ham_Spawn, "player", "GetUserWeapon", 1)
register_clcmd("drop", "HookDrop")
for (new i; i < sizeof gBuyCommands; i++)
register_clcmd(gBuyCommands[i], "BlockCommands")
return PLUGIN_CONTINUE
}
public BlockCommands(id)
return PLUGIN_HANDLED;
public HookDrop(id)
{
client_print(id, print_center, "This weapon cannot be dropped.")
return PLUGIN_HANDLED
}
public GetUserWeapon(id)
{
if(is_user_alive(id) && !is_user_hltv(id))
{
fm_strip_user_weapons(id)
new rand
rand = random_num(0,3)
switch (rand) {
case 0: {
fm_give_item(id, "weapon_tmp")
fm_give_item(id, "ammo_9mm")
engclient_cmd(id, "weapon_tmp")
}
case 1: {
fm_give_item(id, "weapon_p90")
fm_give_item(id, "ammo_57mm")
engclient_cmd(id, "weapon_P90")
}
case 2: {
fm_give_item(id, "weapon_mp5navy")
fm_give_item(id, "ammo_9mm")
engclient_cmd(id, "weapon_mp5navy")
}
case 3: {
fm_give_item(id, "weapon_mac10")
fm_give_item(id, "ammo_45acp")
engclient_cmd(id, "weapon_mac10")
}
}
}
}
public AktualnaBron(id)
{
if(!is_user_alive(id) && is_user_hltv(id))
return PLUGIN_CONTINUE;
weaponid = get_user_weapon(id)
if(weaponid == CSW_KNIFE || weaponid == CSW_C4 || weaponid == CSW_FLASHBANG || weaponid == CSW_HEGRENADE || weaponid == CSW_SMOKEGRENADE)
return PLUGIN_CONTINUE;
if(weaponid == CSW_MP5NAVY || weaponid == CSW_TMP)
fm_give_item(id, "ammo_9mm")
if(weaponid == CSW_MAC10)
fm_give_item(id, "ammo_45acp")
if(weaponid == CSW_P90)
fm_give_item(id, "ammo_57mm")
if(weaponid == CSW_C4)
client_print(id, print_chat, "Nie podkladaj paki!") // Nie wiem czemu nawet msg nie wywala -,-
return PLUGIN_HANDLED;
}

Dodatki SourceMod



Temat jest zamknięty









