Obrażenia z noża VIP
Barthez
29.08.2011
Witam 
Mam mały problem otóż udało mi się ustawić DMG z noża na taki jaki chciałem
tutaj .sma
ale mam problem z dodaniem flagi żeby to działało tylko dla tych którzy mają daną flagę, chodzi mi o tą flagę " ADMIN_LEVEL_H " .. mógłby mi ktoś pomóc z tym kodem ? i napisać jak mam to dodać ? Próbowałem 3x swoimi sposobami i nic.

Mam mały problem otóż udało mi się ustawić DMG z noża na taki jaki chciałem

tutaj .sma
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <hamsandwich> #define PLUGIN "More knife" #define VERSION "1.0" #define AUTHOR "peku33" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); RegisterHam(Ham_TakeDamage, "player", "TakeDamage") } public TakeDamage(victim, entity, attacker, Float:damage, damagebits) { if(is_user_connected(attacker) && is_user_connected(victim)) { if(get_user_weapon(attacker) == 29) { SetHamParamFloat(4, damage * 1.2); } return HAM_OVERRIDE; } return HAM_IGNORED; }
ale mam problem z dodaniem flagi żeby to działało tylko dla tych którzy mają daną flagę, chodzi mi o tą flagę " ADMIN_LEVEL_H " .. mógłby mi ktoś pomóc z tym kodem ? i napisać jak mam to dodać ? Próbowałem 3x swoimi sposobami i nic.
BoB0_
29.08.2011
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#define PLUGIN "More knife"
#define VERSION "1.0"
#define AUTHOR "peku33"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage")
}
public TakeDamage(victim, entity, attacker, Float:damage, damagebits)
{
if(get_user_flags(id) & ADMIN_LEVEL_F))
{
if(is_user_connected(attacker) && is_user_connected(victim))
{
if(get_user_weapon(attacker) == 29)
{
SetHamParamFloat(4, damage * 1.2);
}
return HAM_OVERRIDE;
}
}
return HAM_IGNORED;
}
Edited by BoB0_, 29.08.2011 23:44.
Barthez
29.08.2011
nie mogę skompilować .. błąd przy " if(get_user_flags(id) & ADMIN_LEVEL_H))" a na dole wyskakuje :
Error: Undefined symbol "id" on line 15
Error: Invalid expression, assumed zero on line 15
Error: Undefined symbol "id" on line 15
Error: Invalid expression, assumed zero on line 15
BoB0_
29.08.2011
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#define PLUGIN "More knife"
#define VERSION "1.0"
#define AUTHOR "peku33"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage")
}
public TakeDamage(victim, entity, attacker, Float:damage, damagebits)
{
if(get_user_flags(idattacker) & ADMIN_LEVEL_F))
{
if(is_user_connected(attacker) && is_user_connected(victim))
{
if(get_user_weapon(attacker) == 29)
{
SetHamParamFloat(4, damage * 1.2);
}
return HAM_OVERRIDE;
}
}
return HAM_IGNORED;
}
sebul
29.08.2011
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "More knife"
#define VERSION "1.0"
#define AUTHOR "peku33"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage")
}
public TakeDamage(victim, entity, attacker, Float:damage, damagebits)
{
if(!is_user_connected(attacker) || !is_user_connected(victim))
return HAM_IGNORED;
if(get_user_flags(attacker) & ADMIN_LEVEL_H) && get_user_weapon(attacker) == CSW_KNIFE)
{
SetHamParamFloat(4, damage * 1.2);
return HAM_HANDLED;
}
return HAM_IGNORED;
}
Edited by sebul, 29.08.2011 23:49.
Barthez
29.08.2011
Error: Undefined symbol "idattacker" on line 15 << teraz coś takiego .. kurde
Hiroshima
29.08.2011
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#define PLUGIN "More knife"
#define VERSION "1.0"
#define AUTHOR "peku33"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage")
}
public TakeDamage(victim, entity, attacker, Float:damage, damagebits)
{
if(is_user_connected(attacker) && is_user_connected(victim) && (get_user_flags(attacker) && ADMIN_LEVEL_F))
{
if(get_user_weapon(attacker) == 29)
{
SetHamParamFloat(4, damage * 1.2);
}
return HAM_OVERRIDE;
}
return HAM_IGNORED;
}
chyba tak powinno być
Barthez
30.08.2011
sebul jak chciałem skompilować to od Ciebie to wyskakuje :
hiroshima
skompilowac skompilwoalo sie
Ale czy moglbys mi ten kod poprawic .. bo to dziala tez dla tych co nie maja flagi ..
Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team Error: Invalid expression, assumed zero on line 20 Error: Expected token: ";", but found ")" on line 20 Error: Invalid expression, assumed zero on line 20 Error: Too many error messages on one line on line 20 Compilation aborted. 4 Errors. Could not locate output file C:\Program Files\Programy\AMX Mod X\files\base\scripting\compiled\vip2.amx (compile failed).
hiroshima
skompilowac skompilwoalo sie

Hiroshima
30.08.2011
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#define PLUGIN "More knife"
#define VERSION "1.0"
#define AUTHOR "peku33"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage")
}
public TakeDamage(victim, entity, attacker, Float:damage, damagebits)
{
if(is_user_connected(attacker) && is_user_connected(victim) && (get_user_flags(attacker) && ADMIN_LEVEL_H) && get_user_weapon(attacker) == 29)
{
SetHamParamFloat(4, damage * 1.2);
return HAM_HANDLED;
}
return HAM_IGNORED;
}
sprawdz
sebul
30.08.2011
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "More knife"
#define VERSION "1.0"
#define AUTHOR "peku33"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage")
}
public TakeDamage(victim, entity, attacker, Float:damage, damagebits)
{
if(!is_user_connected(attacker) || !is_user_connected(victim))
return HAM_IGNORED;
if(get_user_flags(attacker) & ADMIN_LEVEL_H && get_user_weapon(attacker) == CSW_KNIFE)
{
SetHamParamFloat(4, damage * 1.2);
return HAM_HANDLED;
}
return HAM_IGNORED;
}
Jeden nawias niepotrzebny był.