CT nie może podnieść granatów
szelbi
20.05.2012
Witam!
Bardzo proszę o zrobienie pluginu, dzięki któremu CT nie będzie mogło podnieść ani kupić granatów. Najbardziej zależy mi na HE
Z góry dziękuję za pomoc. Za plugin i wszelką pomoc oczywiście plusiki
Bardzo proszę o zrobienie pluginu, dzięki któremu CT nie będzie mogło podnieść ani kupić granatów. Najbardziej zależy mi na HE
Z góry dziękuję za pomoc. Za plugin i wszelką pomoc oczywiście plusiki
speedkill
22.05.2012
Ogółem nie można podnieść he, więc tylko wystarczy zablokować jego kupno
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <CSWeaponsUtil> #define PLUGIN "He block buy" #define VERSION "1.0" #define AUTHOR "speedkill" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) } public CS_OnBuyItem(id, weaponid) { if(weaponid == CSW_HEGRENADE && cs_get_user_team(id) == CS_TEAM_CT) { return PLUGIN_HANDLED } return PLUGIN_CONTINUE }Ten plugin + http://amxx.pl/topic...s-weapons-util/
dasiek
22.05.2012
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <engine> #define PLUGIN "Blokada Granatow CT" #define VERSION "1.0" #define AUTHOR "CheQ" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) RegisterHam(Ham_Touch, "weaponbox", "DotykBroni"); } public DotykBroni(weapon,id) { new model[23]; entity_get_string(weapon, EV_SZ_model, model, 22); if (!is_user_connected(id) || get_user_team(id) == 1 || !equal(model, "models/w_hegrenade.mdl")) return HAM_IGNORED; return HAM_SUPERCEDE; } nie podniesie leżącego?
szelbi
22.05.2012
Ogółem nie można podnieść he, więc tylko wystarczy zablokować jego kupno
Można podnieść HE, jeśli leży gdzieś na mapie lub jest wgrany plugin na wypadanie granatów
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <engine> #define PLUGIN "Blokada Granatow CT" #define VERSION "1.0" #define AUTHOR "CheQ" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) RegisterHam(Ham_Touch, "weaponbox", "DotykBroni"); } public DotykBroni(weapon,id) { new model[23]; entity_get_string(weapon, EV_SZ_model, model, 22); if (!is_user_connected(id) || get_user_team(id) == 1 || !equal(model, "models/w_hegrenade.mdl")) return HAM_IGNORED; return HAM_SUPERCEDE; } nie podniesie leżącego?
CT nadal może podnosić granaty z ziemi
Użytkownik ^sheLLby.? edytował ten post 22.05.2012 17:59
Gość_21977_* 23.05.2012
edit. Sprawdź to:
Użytkownik benio101 edytował ten post 23.05.2012 16:15
RegisterHam(Ham_Touch, "weaponbox", "DotykBroni", 0);
public DotykBroni(weapon,id){
if(!pev_valid(weapon))
return HAM_IGNORED;
if(!(1<=id<=get_maxplayers()) || !is_user_alive(id))
return HAM_IGNORED;
if(get_user_team(id)==2 && is_grenade(weapon))
return HAM_SUPERCEDE;
return HAM_IGNORED;
}
bool:is_grenade(ent) {
if (!pev_valid(ent))
return false
static classname[sizeof g_classname_grenade + 1]
pev(ent, pev_classname, classname, sizeof g_classname_grenade)
if (equal(classname, g_classname_grenade))
return true
return false
}
Użytkownik benio101 edytował ten post 23.05.2012 16:15
szelbi
23.05.2012
benio, przy kompilowaniu mam coś takiego
Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team ctbezhe.sma(8) : error 021: symbol already defined: "RegisterHam" ctbezhe.sma(12) : error 017: undefined symbol "pev_valid" ctbezhe.sma(24) : error 017: undefined symbol "pev_valid" ctbezhe.sma(27) : error 017: undefined symbol "g_classname_grenade" ctbezhe.sma(28) : error 017: undefined symbol "pev" ctbezhe.sma(28) : error 017: undefined symbol "classname" ctbezhe.sma(28) : error 088: number of arguments does not match definition ctbezhe.sma(28) : fatal error 107: too many error messages on one line Compilation aborted. 8 Errors.
Gość_21977_* 23.05.2012
edit. Musisz wpisać to w odpowiedniej formie:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#define PLUGIN "Blokada Granatow CT"
#define VERSION "1.0"
#define AUTHOR "Benio101"
new const g_classname_grenade[] = "grenade"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Touch, "weaponbox", "DotykBroni", 0);
}
public DotykBroni(weapon,id){
if(!pev_valid(weapon))
return HAM_IGNORED;
if(!(1<=id<=get_maxplayers()) || !is_user_alive(id))
return HAM_IGNORED;
if(get_user_team(id)==2 && is_grenade(weapon))
return HAM_SUPERCEDE;
return HAM_IGNORED;
}
bool:is_grenade(ent) {
if (!pev_valid(ent))
return false
static classname[sizeof g_classname_grenade + 1]
pev(ent, pev_classname, classname, sizeof g_classname_grenade)
if (equal(classname, g_classname_grenade))
return true
return false
}
Gość_21977_* 24.05.2012
Ten sprawdziłem i działa:
Blokuje pozyskanie przez CT granatów.
W poprzednim zasugerowałem się kodem CheQ, ale granaty nie należą do weaponbox, więc dla granatów kod nie zostanie wykonany.
RegisterHam(Ham_Touch, "weaponbox", "DotykBroni"); w kodzie CheQ nigdy nie zostanie wykonany dla granatów, jedynie dla broni.
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#define PLUGIN "Blokada Granatow CT"
#define VERSION "1.0"
#define AUTHOR "Benio101"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Touch, "weapon_hegrenade", "ZablokujGranaty",0);
RegisterHam(Ham_Touch, "weapon_flashbang", "ZablokujGranaty",0);
RegisterHam(Ham_Touch, "weapon_smokegrenade", "ZablokujGranaty",0);
}
public ZablokujGranaty(grenade,id){
if(!pev_valid(grenade))
return HAM_IGNORED;
if(!(1<=id<=get_maxplayers()) || !is_user_alive(id))
return HAM_IGNORED;
if(get_user_team(id)==2)
return HAM_SUPERCEDE;
return HAM_IGNORED;
}
Blokuje pozyskanie przez CT granatów.
W poprzednim zasugerowałem się kodem CheQ, ale granaty nie należą do weaponbox, więc dla granatów kod nie zostanie wykonany.
RegisterHam(Ham_Touch, "weaponbox", "DotykBroni"); w kodzie CheQ nigdy nie zostanie wykonany dla granatów, jedynie dla broni.