A o to kod.
#include <amxmodx>
#include <fakemeta>
new const FLARE_MODEL[] = "models/zombie_plague/v_grenade_flare.mdl";
//new const FLARE_SOUNDS[][] = { "zombie_plague/thunder1.wav", "zombie_plague/thunder2.wav" };
new pcvar_flare_duration;
public plugin_init()
{
	    register_plugin("Smoke Flares", "0.1", "Mini_Midget")
	   
	    pcvar_flare_duration = register_cvar("flare_duration", "60.0")
	   
	    register_forward(FM_SetModel, "fw_setmodel")   
	    register_forward(FM_Think, "fw_think");
}
public plugin_precache()
{
	    engfunc(EngFunc_PrecacheModel, FLARE_MODEL);
	    //for (new i = 0 ; i < sizeof FLARE_SOUNDS ; i++)
	    //	  engfunc(EngFunc_PrecacheSound, FLARE_SOUNDS[i]);
}
public fw_setmodel(ent, model[])
{
			    //Not a valid ent	 or	  Thrower not alive
	    if (!pev_valid(ent) || !is_user_alive(pev(ent, pev_owner))) // not a valid ent
			    return FMRES_IGNORED;
	   
	    new Float: duration = get_pcvar_float(pcvar_flare_duration)
			   
	    if (equali(model,"models/w_smokegrenade.mdl"))
	    {
			    new className[33]
			    pev(ent, pev_classname, className, 32)
			   
			    // Stop smoke grenade from exploding
			    set_pev(ent, pev_nextthink, get_gametime() + duration);
			    //Effects
			    set_pev(ent,pev_effects,EF_BRIGHTLIGHT);
			    fm_set_rendering(ent, kRenderFxGlowShell, 150, 150, 250, kRenderNormal, 16)
			    //Sound
			    //engfunc(EngFunc_EmitSound, ent, CHAN_AUTO, FLARE_SOUNDS[random(sizeof FLARE_SOUNDS)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
			   
			    if(equal(className, "weaponbox") || equal(className, "armoury_entity") || equal(className, "grenade"))
		    {
					    engfunc(EngFunc_SetModel, ent, FLARE_MODEL);
					    return FMRES_SUPERCEDE
			    }
	    }
			   
	    return FMRES_IGNORED;
}
public fw_think(ent)
{
			    //Not a valid ent	 or	  Thrower not alive
	    if (!pev_valid(ent) || !is_user_alive(pev(ent, pev_owner))) // not a valid ent
			    return FMRES_IGNORED;
			   
	    static classname[33]
	    pev(ent, pev_classname, classname, sizeof classname - 1);
	    static model[33]
	    pev(ent, pev_model, model, sizeof model - 1);
	   
	    if( equal(model, FLARE_MODEL) && equal(classname, "grenade"))
			    engfunc(EngFunc_RemoveEntity, ent);
			   
	    return FMRES_IGNORED;
}
stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16) {
	    new Float:RenderColor[3];
	    RenderColor[2] = float(<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />;
	    RenderColor[0] = float(r);
	    RenderColor[1] = float(g);
	    set_pev(entity, pev_renderfx, fx);
	    set_pev(entity, pev_rendercolor, RenderColor);
	    set_pev(entity, pev_rendermode, render);
	    set_pev(entity, pev_renderamt, float(amount));
	    return 1;
}
przy kompilacji wyskakuje
Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team /tmp/textfuJnc0.sma(76) : error 017: undefined symbol "B" /tmp/textfuJnc0.sma(86) : warning 203: symbol is never used: "b" 1 Error. Could not locate output file /home/groups/amxmodx/public_html/websc3/textfuJnc0.amx (compile failed).


 Forum
 
Forum
 Użytkownicy
 
Użytkownicy
 Kalendarz
 
Kalendarz
 Dodatki SourceMod
 
Dodatki SourceMod



 
	 Temat jest zamknięty
 Temat jest zamknięty![[ROZWIĄZANE] Kompilacja: post #1](https://amxx.pl/public/style_images/tctc91_luminous/icon_share.png) 
					

 
				
				









