Raised This Month: $ Target: $400
 0% 

Brekaeable ent.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 02-25-2009 , 09:05   Brekaeable ent.
Reply With Quote #1

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.")


Last edited by xbatista; 02-25-2009 at 09:08.
xbatista is offline
Send a message via Skype™ to xbatista
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode