This is just an example from tutorial, 1.how to do breakeble ent and have for example 200health???2.And you can create only 1 ent per round.3.And delete it on round end???.I need an example.
PHP Code:
// fakemeta
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
new g_Classname[] = "func_car"
new g_Model[] = "models/car.mdl"
public plugin_init()
{
register_plugin("OMFG","HAX","LOL")
register_clcmd("say car","CmdSayCar")
register_forward(FM_Touch,"ForwardTouch")
}
public plugin_precache()
precache_model(g_Model)
public CmdSayCar(id)
{
new Ent = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"info_target"))
set_pev(Ent,pev_classname,g_Classname)
engfunc(EngFunc_SetModel,Ent,g_Model)
set_pev(Ent,pev_solid,SOLID_TRIGGER)
engfunc(EngFunc_SetSize,Ent,Float:{-50.0,-50.0,-50.0},Float:{50.0,50.0,50.0})
set_pev(Ent,pev_owner,id)
}
public ForwardTouch(Ptd,Ptr)
{
new Classname[33],Ent = Ptd,id = Ptr
pev(Ptd,pev_classname,Classname,32)
if(!equal(Classname,g_Classname))
{
Ent = Ptr
id = Ptd
pev(Ptr,pev_classname,Classname,32)
if(!equal(Classname,g_Classname))
return
}
new Owner = pev(Ent,pev_owner)
if(Owner != id)
return
client_print(id,print_chat,"You have used this car. Due to time purposes, I'm not going to add code beyond this.")
}