Cześć jak ustawić na ten plugin flagę ?
admin_level_h
Spoiler
#include <amxmodx> #include <fakemeta> #define PLUGIN "BaseballBat" #define VERSION "0.4" #define AUTHOR "(SAMURAI) Edit: Elite as shot" #define V_MODEL "models/v_baseball.mdl" #define W_MODEL "models/w_baseball.mdl" #define P_MODEL "models/p_baseball.mdl" #define KNIFE_W_MODEL "models/w_knife.mdl" new const gSounds[][] = { "bb/knife_deploy1.wav", "bb/knife_hitwall1.wav", "bb/knife_hit1.wav", "bb/knife_hit2.wav", "bb/knife_hit3.wav", "bb/knife_hit4.wav", "bb/knife_slash1.wav", "bb/knife_slash2.wav", "bb/knife_stab.wav" }; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) // HL Event CurWeapon register_event("CurWeapon", "Event_CurWeapon", "be","1=1"); // FM_SetModel Fakemeta forward register_forward(FM_SetModel,"fw_setmodel"/*,1*/); // For sound register_forward(FM_EmitSound,"fw_emitsound"); } // Plugin Precache forward public plugin_precache() { // precache the required models engfunc(EngFunc_PrecacheModel,V_MODEL); engfunc(EngFunc_PrecacheModel,P_MODEL); engfunc(EngFunc_PrecacheModel,W_MODEL); for(new i = 0 ; i < sizeof gSounds ; i++) precache_sound(gSounds[i]); } public Event_CurWeapon(id) { if(!is_user_alive(id)) return PLUGIN_CONTINUE; new weaponID = read_data(2); if(weaponID != CSW_KNIFE) return PLUGIN_CONTINUE; set_pev(id, pev_viewmodel2, V_MODEL); set_pev(id, pev_weaponmodel2, P_MODEL); return PLUGIN_CONTINUE; } public fw_setmodel(ent,const model[]) { // check if isn't a valid model if(!pev_valid(ent)) return FMRES_IGNORED; // if isn't w_knife model if(strcmp(KNIFE_W_MODEL,model) ) return FMRES_IGNORED; // get ent classname static classname[32] pev(ent,pev_classname,classname,31); if(!strcmp(classname, "weaponbox") || !strcmp(classname, "armoury_entity") || !strcmp(classname, "grenade")) { // set model engfunc(EngFunc_SetModel, ent, W_MODEL); return FMRES_SUPERCEDE; } return FMRES_IGNORED; } public fw_emitsound(id,channel,sample[],Float:volume,Float:attenuation,fFlags,pitch) { { if(equal(sample,"weapons/knife_deploy1.wav")) { emit_sound(id,channel,gSounds[6],volume,attenuation,fFlags,pitch); return FMRES_SUPERCEDE; } if(equal(sample,"weapons/knife_hitwall1.wav")) { emit_sound(id,channel,gSounds[1],volume,attenuation,fFlags,pitch); return FMRES_SUPERCEDE; } if(equal(sample,"weapons/knife_hit1.wav")) { emit_sound(id,channel,gSounds[2],volume,attenuation,fFlags,pitch); return FMRES_SUPERCEDE; } if(equal(sample,"weapons/knife_hit2.wav")) { emit_sound(id,channel,gSounds[3],volume,attenuation,fFlags,pitch); return FMRES_SUPERCEDE; } if(equal(sample,"weapons/knife_hit3.wav")) { emit_sound(id,channel,gSounds[4],volume,attenuation,fFlags,pitch); return FMRES_SUPERCEDE; } if(equal(sample,"weapons/knife_hit4.wav")) { emit_sound(id,channel,gSounds[5],volume,attenuation,fFlags,pitch); return FMRES_SUPERCEDE; } if(equal(sample,"weapons/knife_slash1.wav")) { emit_sound(id,channel,gSounds[6],volume,attenuation,fFlags,pitch); return FMRES_SUPERCEDE; } if(equal(sample,"weapons/knife_slash2.wav")) { emit_sound(id,channel,gSounds[7],volume,attenuation,fFlags,pitch); return FMRES_SUPERCEDE; } if(equal(sample,"weapons/knife_stab.wav")) { emit_sound(id,channel,gSounds[7],volume,attenuation,fFlags,pitch); return FMRES_SUPERCEDE; } } return FMRES_IGNORED; }