←  Pytania

AMXX.pl: Support AMX Mod X i SourceMod

»

jak stowrzyc ten totem

  • +
  • -
NewaX - zdjęcie NewaX 11.11.2011

a wiec mam taki kod napisany przez ^Grzyboo
/* Script generated by Pawn Studio */
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#define PLUGIN  "New Plugin"
#define AUTHOR  "Unknown"
#define VERSION "1.0"
new bool:used_totem[33];
public plugin_init()
{
	    register_plugin(PLUGIN, VERSION, AUTHOR)
	   
	    register_think("M4Totem","TotemThink");
}
public StworzTotem(id)
{
	    if (used_totem[id])
			    return PLUGIN_CONTINUE;
			   
	    used_totem[id] = true;
	   
	    new Float:origin[3];
	    entity_get_vector(id, EV_VEC_origin, origin);
	   
	    new ent = create_entity("info_target");
	    entity_set_string(ent, EV_SZ_classname, "M4Totem");
	    entity_set_edict(ent, EV_ENT_owner, id);
	    entity_set_int(ent, EV_INT_solid, SOLID_NOT);
	    entity_set_vector(ent, EV_VEC_origin, origin);
	    entity_set_float(ent, EV_FL_ltime, halflife_time() + 7 + 0.1);
	   
	    entity_set_model(ent, "models/w_medkit.mdl");
	    set_rendering ( ent, kRenderFxGlowShell, 0,100,255, kRenderFxNone, 20)   ;
	    drop_to_floor(ent);
	   
	    entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.1);
	   
	    return PLUGIN_CONTINUE;
}
public TotemThink(ent)
{
	    new id = entity_get_edict(ent, EV_ENT_owner);
	   
	    if (entity_get_edict(ent, EV_ENT_euser2) == 1)
	    {			  
			    new Float:forigin[3], origin[3];
			    entity_get_vector(ent, EV_VEC_origin, forigin);
			    FVecIVec(forigin,origin);
			   
			    new entlist[33];
			    new numfound = find_sphere_class(ent, "player", 300.0 , entlist, 32);
			   
			    for (new i=0; i < numfound; i++)
			    {			  
					    new pid = entlist[i];
					   
					    if (!is_user_alive(pid) || get_user_team(id) == get_user_team(pid))
							    continue;
					   
					    if(!user_has_weapon(pid, CSW_M4A1))
							    give_item(id, "weapon_m4a1");
			    }
			   
			    entity_set_edict(ent, EV_ENT_euser2, 0);
			    entity_set_float(ent, EV_FL_nextthink, halflife_time() + 1.0);
			   
			    return PLUGIN_CONTINUE;
	    }
	   
	    if (entity_get_float(ent, EV_FL_ltime) < halflife_time() || !is_user_alive(id))
	    {
			    remove_entity(ent);
			    return PLUGIN_CONTINUE;
	    }
	   
	    if (entity_get_float(ent, EV_FL_ltime)-2.0 < halflife_time())
			    set_rendering ( ent, kRenderFxNone, 255,255,255, kRenderTransAlpha, 100 ) ;
			   
	    new Float:forigin[3], origin[3];
	    entity_get_vector(ent, EV_VEC_origin, forigin);
	    FVecIVec(forigin,origin);
			   
	    entity_set_edict(ent, EV_ENT_euser2 ,1);
	    entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.5);
			   
	    return PLUGIN_CONTINUE;
}

jesli dobrze zrozumialem to ten plugin stwarza nam totem z ktorego po dotknieciu dostaje sie m4. tylko jak go sie stwarza przez klikniecie e/use? czy w jakis inny sposob?
Odpowiedz

  • +
  • -
Stachuu :D ?? - zdjęcie Stachuu :D ?? 11.11.2011

w w/w kodzie nie napisane jest jak go postawic tzn
sam czysty kod od totemu bez możliwości jego postawienia
Odpowiedz

  • +
  • -
NewaX - zdjęcie NewaX 11.11.2011

ahaa a dorobil by ktos??
Odpowiedz

  • +
  • -
Stachuu :D ?? - zdjęcie Stachuu :D ?? 11.11.2011

a w jaki sposob chcesz stawiac ten totem ?
Odpowiedz

  • +
  • -
NiFreZ - zdjęcie NiFreZ 11.11.2011

@up napisał że na "e" czyli IN_USE


a jak zrobić żeby stawiać go np jako CMD

bind klawisz stawiam_totem


?
Odpowiedz

  • +
  • -
NewaX - zdjęcie NewaX 12.11.2011

znaczy nie mi najbardziej pasowalo by stawianie totemu na danej wspolrzędnej. napisze ktos kod jak go tak postawic?
Użytkownik newax edytował ten post 13.11.2011 18:30
Odpowiedz

  • +
  • -
Mafio_PL - zdjęcie Mafio_PL 13.11.2011

Weźcie pomóżcie mu ja też tego bardzo potrzebuje
@@@@
Odpowiedz