Raised This Month: $ Target: $400
 0% 

Can't create ent when aiming on players.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 02-26-2009 , 08:57   Can't create ent when aiming on players.
Reply With Quote #1

How to do: the player can't create wall/ent when aiming on other player?
PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "XxX"
#define AUTHOR "xbatista"
#define VERSION "0.1"
 
new g_Classname1[] = "wall_brekeable"
new WallModel[] = "models/wall.mdl"

public plugin_precache()
{
    
precache_model(WallModel)
}
public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("+wall""wall"
    
//    register_forward(FM_Touch,"ForwardTouch")
}
public 
wall(id

    new 
went engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"func_wall")) 
    new 
Float:flOrigin[3]
    new 
aVector[3]
    
get_user_origin(idaVector3)
    
IVecFVec(aVectorflOrigin)
    
set_pev(wentpev_originflOrigin)
    
    
set_pev(wentpev_classnameg_Classname1
    
engfunc(EngFunc_SetModelwentWallModel
    
set_pev(wentpev_solidSOLID_BBOX
    
set_pev(wentpev_health700.0)
    
set_pev(wentpev_takedamageDAMAGE_YES)
    
engfunc(EngFunc_SetSizewentFloat:{-5.0, -90.0, -150.0}, Float:{5.090.0150.0}) 

/*public ForwardTouch(Ptd,Ptr)
{
    new Classname[33],Ent = Ptd,id = Ptr
   pev(Ptd,pev_classname,Classname,32)
   
   if(!equal(Classname,g_Classname1))
    {
        Ent = Ptr
        id = Ptd
       
        pev(Ptr,pev_classname,Classname,32)
       
        if(!equal(Classname,g_Classname1))
            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.")
}*/ 
EDIT: hmmm.....I solved it somehow...
PHP Code:
   new targetbody;
    
get_user_aiming idtargetbody );

    if ( 
<= target <= g_maxplayers )
    {
        new 
s_Name32 ];
        
get_user_name targets_Namecharsmax target ) );
        return 
PLUGIN_HANDLED;
    } 
And another little problem... The distance I need, around aimed player? How to do this?
Please help.

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



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:56.


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