Dodatki do klasy
Xterq
31.08.2012
Cześć, jak będzie wyglądał kod aby klasa miała z m4a1,deagla +15 dmg ???
Jak bedzie wygladal kod aby m4a1,deagla,knife zmienilo model?
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits) { if(!is_user_connected(idattacker)) return HAM_IGNORED; if(!ma_perk[idattacker]) return HAM_IGNORED; if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_AK47 && damagebits & DMG_BULLET) cod_inflict_damage(idattacker, this, 15.0, 0.0, idinflictor, damagebits);
Jak bedzie wygladal kod aby m4a1,deagla,knife zmienilo model?
public fw_SetModel(entity, model[]) { if(!pev_valid(entity)) return FMRES_IGNORED if(!equali(model, "models/w_m3.mdl")) return FMRES_IGNORED; new entityowner = pev(entity, pev_owner); if(!ma_klase[entityowner]) return FMRES_IGNORED; engfunc(EngFunc_SetModel, entity, "models/cod/w_m3.mdl") return FMRES_SUPERCEDE }
ELOS
31.08.2012
get_user_weapon(idattacker) == CSW_AK47 || get_user_weapon(idattacker) == CSW_DEAGLE && damagebits & DMG_BULLET)powinno działać ; )
ELOS
31.08.2012
Spróbuj coś takiego
public fw_SetModel(entity, model[]) { if(!pev_valid(entity)) return FMRES_IGNORED new entityowner = pev(entity, pev_owner); if(!ma_klase[entityowner]) return FMRES_IGNORED; if(equali(model, "models/w_m3.mdl")) { engfunc(EngFunc_SetModel, entity, "models/cod/w_m3.mdl") } else if(equali(model, "models/w_deagle.mdl")) { engfunc(EngFunc_SetModel, entity, "models/cod/w_deagle.mdl") } return FMRES_SUPERCEDE }
ELOS
31.08.2012
w tym wypadku nie wiem czy tak zadziała
else if(equali(model, "models/w_deagle.mdl")) { engfunc(EngFunc_SetModel, entity, "models/cod/w_deagle.mdl") engfunc(EngFunc_SetModel, entity, "models/cod/v_deagle.mdl") engfunc(EngFunc_SetModel, entity, "models/cod/p_deagle.mdl") }
Xterq
31.08.2012
Dodałem i są errory.
tu cały kod klasy.
tu cały kod klasy.
#include <amxmodx> #include <amxmisc> #include <codmod> #include <engine> #include <fakemeta> #include <hamsandwich> #define DMG_BULLET (1<<1) #define SZYBKOSC_GRACZA(%1) (250.0+cod_get_user_trim(%1, 1, 1, 1)*1.3) new pSpeeds new const nazwa[] = "Soldat"; new const opis[] = "Dostaje Golden M4A1, Golden Deagle + wieksze obrazenia oraz Golden Knife i 1/1 z niego, po wybraniu noza jest szybszy !"; new const bronie = (1<<CSW_M4A1)|(1<<CSW_DEAGLE); new const zdrowie = 25; new const kondycja = 5; new const inteligencja = 0; new const wytrzymalosc = 10; new bool:ma_klase[33]; public plugin_init() { register_plugin(nazwa, "1.0", "amxx.pl"); cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc); pSpeeds = register_cvar("wieksza_szybkosc","150.0") register_event("CurWeapon", "CurWeapon", "be", "1=1") register_forward(FM_SetModel, "fw_SetModel"); RegisterHam(Ham_TakeDamage, "player", "TakeDamage"); } public cod_class_enabled(id) { ma_klase[id] = true; if(!(get_user_flags(id) & ADMIN_LEVEL_D)) { client_print(id, print_chat, "[Soldat] Nie masz uprawnien, aby uzywac tej klasy.") return COD_STOP; } return COD_CONTINUE; } public cod_class_disabled(id) { ma_klase[id] = false; engfunc(EngFunc_SetClientMaxspeed, id, SZYBKOSC_GRACZA(id)); } public plugin_precache() { precache_model("models/soldat/p_m4a1.mdl"); precache_model("models/soldat/v_m4a1.mdl"); precache_model("models/soldat/p_deagle.mdl"); precache_model("models/soldat/v_deagle.mdl"); precache_model("models/soldat/p_knife.mdl"); precache_model("models/soldat/v_knife.mdl"); } public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits) { if(!is_user_connected(idattacker)) return HAM_IGNORED; if(!ma_klase[idattacker]) return HAM_IGNORED; if(get_user_weapon(idattacker) == CSW_M4A1 || get_user_weapon(idattacker) == CSW_DEAGLE && damagebits & DMG_BULLET) cod_inflict_damage(idattacker, this, 15.0, 0.0, idinflictor, damagebits); return HAM_IGNORED; } public eventKnife_Speed(id) { if(!ma_klase[id]) return; if( read_data(2) == CSW_KNIFE ) { engfunc(EngFunc_SetClientMaxspeed, id, SZYBKOSC_GRACZA(id)+get_pcvar_float(pSpeeds)); } else { engfunc(EngFunc_SetClientMaxspeed, id, SZYBKOSC_GRACZA(id)); } } public CurWeapon(id) { new weapon = read_data(2); if(ma_klase[id]) { if(weapon == CSW_M4A1) { set_pev(id, pev_viewmodel2, "models/soldat/v_m4a1.mdl") set_pev(id, pev_weaponmodel2, "models/soldat/p_m4a1.mdl") } else if(weapon == CSW_DEAGLE) { set_pev(id, pev_viewmodel2, "models/soldat/v_deagle.mdl") set_pev(id, pev_weaponmodel2, "models/cod/p_m3.mdl") } else if(weapon == CSW_KNIFE) { set_pev(id, pev_viewmodel2, "models/soldat/v_knife.mdl") set_pev(id, pev_weaponmodel2, "models/soldat/p_knife.mdl") } } } public fw_SetModel(entity, model[]) { if(!pev_valid(entity)) return FMRES_IGNORED new entityowner = pev(entity, pev_owner); if(!ma_klase[entityowner]) return FMRES_IGNORED; else if(equali(model, "models/w_m4a1.mdl")) { engfunc(EngFunc_SetModel, entity, "models/soldat/v_m4a1.mdl") engfunc(EngFunc_SetModel, entity, "models/soldat/p_m4a1.mdl") else if(equali(model, "models/w_deagle.mdl")) { engfunc(EngFunc_SetModel, entity, "models/soldat/v_deagle.mdl") engfunc(EngFunc_SetModel, entity, "models/soldat/p_deagle.mdl") else if(equali(model, "models/w_knife.mdl")) { engfunc(EngFunc_SetModel, entity, "models/soldat/v_knife.mdl") engfunc(EngFunc_SetModel, entity, "models/soldat/p_knife.mdl") }
Gość_21977_* 31.08.2012
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#define DMG_BULLET (1<<1)
#define SZYBKOSC_GRACZA(%1) (250.0+cod_get_user_trim(%1, 1, 1, 1)*1.3)
new pSpeeds
new const nazwa[] = "Soldat";
new const opis[] = "Dostaje Golden M4A1, Golden Deagle + wieksze obrazenia oraz Golden Knife i 1/1 z niego, po wybraniu noza jest szybszy !";
new const bronie = (1<<CSW_M4A1)|(1<<CSW_DEAGLE);
new const zdrowie = 25;
new const kondycja = 5;
new const inteligencja = 0;
new const wytrzymalosc = 10;
new bool:ma_klase[33];
public plugin_init()
{
register_plugin(nazwa, "1.0", "amxx.pl");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
pSpeeds = register_cvar("wieksza_szybkosc","150.0")
register_event("CurWeapon", "CurWeapon", "be", "1=1")
register_forward(FM_SetModel, "fw_SetModel");
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}
public cod_class_enabled(id)
{
ma_klase[id] = true;
if(!(get_user_flags(id) & ADMIN_LEVEL_D))
{
client_print(id, print_chat, "[Soldat] Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}
return COD_CONTINUE;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
engfunc(EngFunc_SetClientMaxspeed, id, SZYBKOSC_GRACZA(id));
}
public plugin_precache()
{
precache_model("models/soldat/p_m4a1.mdl");
precache_model("models/soldat/v_m4a1.mdl");
precache_model("models/soldat/p_deagle.mdl");
precache_model("models/soldat/v_deagle.mdl");
precache_model("models/soldat/p_knife.mdl");
precache_model("models/soldat/v_knife.mdl");
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(get_user_weapon(idattacker) == CSW_M4A1 || get_user_weapon(idattacker) == CSW_DEAGLE && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 15.0, 0.0, idinflictor, damagebits);
return HAM_IGNORED;
}
public eventKnife_Speed(id)
{
if(!ma_klase[id])
return;
if( read_data(2) == CSW_KNIFE )
{
engfunc(EngFunc_SetClientMaxspeed, id, SZYBKOSC_GRACZA(id)+get_pcvar_float(pSpeeds));
}
else
{
engfunc(EngFunc_SetClientMaxspeed, id, SZYBKOSC_GRACZA(id));
}
}
public CurWeapon(id)
{
new weapon = read_data(2);
if(ma_klase[id])
{
if(weapon == CSW_M4A1)
{
set_pev(id, pev_viewmodel2, "models/soldat/v_m4a1.mdl")
set_pev(id, pev_weaponmodel2, "models/soldat/p_m4a1.mdl")
}
else if(weapon == CSW_DEAGLE)
{
set_pev(id, pev_viewmodel2, "models/soldat/v_deagle.mdl")
set_pev(id, pev_weaponmodel2, "models/cod/p_m3.mdl")
}
else if(weapon == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/soldat/v_knife.mdl")
set_pev(id, pev_weaponmodel2, "models/soldat/p_knife.mdl")
}
}
}
public fw_SetModel(entity, model[])
{
if(!pev_valid(entity))
return FMRES_IGNORED
new entityowner = pev(entity, pev_owner);
if(!ma_klase[entityowner])
return FMRES_IGNORED;
else if(equali(model, "models/w_m4a1.mdl")){
engfunc(EngFunc_SetModel, entity, "models/soldat/v_m4a1.mdl")
engfunc(EngFunc_SetModel, entity, "models/soldat/p_m4a1.mdl")
} else if(equali(model, "models/w_deagle.mdl")){
engfunc(EngFunc_SetModel, entity, "models/soldat/v_deagle.mdl")
engfunc(EngFunc_SetModel, entity, "models/soldat/p_deagle.mdl")
} else if(equali(model, "models/w_knife.mdl")){
engfunc(EngFunc_SetModel, entity, "models/soldat/v_knife.mdl")
engfunc(EngFunc_SetModel, entity, "models/soldat/p_knife.mdl")
}
return PLUGIN_CONTINUE;
}
Gość_21977_* 31.08.2012
Automatyczna wiadomość
Ten temat został przeniesiony z forum
Scripting AMXX → Pytania
do
Mody → Call of Duty Mod → Pytania
Ten temat został przeniesiony z forum
Scripting AMXX → Pytania
do
Mody → Call of Duty Mod → Pytania
Xterq
01.09.2012
jak gracz wybierze klase to zwiesza cały serwer.
[uwaga=benio101]Ten temat został zamknięty przez moderatora.
Powód: Autor tematu zbanowany
Jeśli się z tym nie zgadzasz,
raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.
Z pozdrowieniami,
Zespół AMXX.PL[/uwaga]
[uwaga=benio101]Ten temat został zamknięty przez moderatora.
Powód: Autor tematu zbanowany
Jeśli się z tym nie zgadzasz,

Z pozdrowieniami,
Zespół AMXX.PL[/uwaga]