hlmod.hu
https://hlmod.hu/

ZM Scenario Demo elleni plugin
https://hlmod.hu/viewtopic.php?f=29&t=3197
Oldal: 5 / 5

Szerző:  rericsi8 [ 2012.02.02. 20:07 ]
Hozzászólás témája:  Re: ZM Scenario Demo elleni plugin

Vath írta:
Ez támadó npc akar lenni :D


Kód:
#include <amxmodx> 
#include <engine>

public plugin_init()
{     
   register_clcmd("sexyartic", "sexyartic")     
   register_think("npc_sexyartic","npc_think");
}
public plugin_precache()    
{
   precache_model("models/sexyartic.mdl")     
   precache_model("models/p_m4alex.mdl")
}

public onna(id)
{     

   new Float:origin[3]     
   
   entity_get_vector(id,EV_VEC_origin,origin)     
   new ent = create_entity("info_target")     
   give_weapon(ent)     
   
   entity_set_origin(ent,origin);     
   origin[2] += 300.0     
   entity_set_origin(id,origin)     
   
   entity_set_float(ent,EV_FL_takedamage,1.0)     
   entity_set_float(ent,EV_FL_health,100.0)     
   
   entity_set_string(ent,EV_SZ_classname,"npc_sexyartic");     
   entity_set_model(ent,"models/sexyartic.mdl");     
   entity_set_int(ent,EV_INT_solid, 2)     
   
   entity_set_byte(ent,EV_BYTE_controller1,125);     
   entity_set_byte(ent,EV_BYTE_controller2,125);   
   entity_set_byte(ent,EV_BYTE_controller3,125);   
   entity_set_byte(ent,EV_BYTE_controller4,125);     
   
   new Float:maxs[3] = {16.0,16.0,36.0}   
   new Float:mins[3] = {-16.0,-16.0,-36.0}   
   entity_set_size(ent,mins,maxs)   
   
   entity_set_float(ent,EV_FL_animtime,2.0)   
   entity_set_float(ent,EV_FL_framerate,1.0)   
   entity_set_int(ent,EV_INT_sequence,0);   
   
   entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.01) 
   drop_to_floor(ent)     
   return 1;
}

public give_weapon(ent)
{         
   new entWeapon = create_entity("info_target")       
   
   entity_set_string(entWeapon, EV_SZ_classname, "npc_weapon")   
   
   entity_set_int(entWeapon, EV_INT_movetype, MOVETYPE_FOLLOW)       
   entity_set_int(entWeapon, EV_INT_solid, SOLID_NOT)       
   entity_set_edict(entWeapon, EV_ENT_aiment, ent)       
   entity_set_model(entWeapon, "models/p_m4alex.mdl")
}

public npc_think(id)
{   
   // Put your think stuff here.   
   entity_set_float(id,EV_FL_nextthink,halflife_time() + 0.01)
}
     
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/


fura nekem hogy pár sorból megoldanak egy npc-t, de nem ez van fönt a tutorialban?
hogy tudom beállítani hogy meik csapatban legyen, hány hp-ja legyen, mik a cvarok?, milyen fegyver-t használjon

Oldal: 5 / 5 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/