AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   EngFunc SetSize of model.With picture. (https://forums.alliedmods.net/showthread.php?t=86496)

xbatista 02-26-2009 13:58

EngFunc SetSize of model.With picture.
 
1 Attachment(s)
Look at the picture.
The model won't be set by SetSize what I've done :/
Model can be angled whatever when I aimed.
I need just angle model by SetSize.

PHP Code:

        engfunc(EngFunc_SetSizewent,
        
Float:{-90.0,-5.0,-150.0},
        
Float:{90.0,5.0,150.0}); 

PHP Code:

#include <amxmodx>
#include <fakemeta>

#define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)
#define fm_remove_entity(%1) engfunc(EngFunc_RemoveEntity, %1)

#define PLUGIN "XxX"
#define AUTHOR "xbatista"
#define VERSION "0.1"
 
new g_maxplayers
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"
    
g_maxplayers get_maxplayers()
    
register_logevent("logevent_round_end"2"1=Round_End"
    
//    register_forward(FM_Touch,"ForwardTouch")
}
public 
wall(id

    new 
targetbody;
    
get_user_aiming idtargetbody );

    if ( 
<= target <= g_maxplayers )
    {
        new 
s_Name32 ];
        
get_user_name targets_Namecharsmax target ) );
        return 
PLUGIN_HANDLED;
    }
    
    new 
went engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"func_wall")) 
    new 
Float:fVecAngle[3];
    new 
vecAim[3];
    
get_user_origin(idvecAim3//where the player is aiming
 
    
new Float:fOrigin[3];
    
IVecFVec(vecAimfOrigin); 
 
    
set_pev(wentpev_originfOrigin);
    
pev(idpev_anglesfVecAngle)
    
    
fVecAngle[0] = 0.0
    
    
if (fVecAngle[1] < 0.0)
    {
        
fVecAngle[1] *= (-1.0)
    }
    
    
set_pev(wentpev_classnameg_Classname1
    
engfunc(EngFunc_SetModelwentWallModel
    
set_pev(wentpev_anglesfVecAngle)
    
set_pev(wentpev_solidSOLID_BBOX
    
set_pev(wentpev_health500.0)
    
set_pev(wentpev_takedamageDAMAGE_YES)
    if ( ( (
fVecAngle[1] >= 45.0) && (fVecAngle[1] <= 135.0) ) )
    {
        
fVecAngle[1] = 90.0;
        
engfunc(EngFunc_SetSizewent,
        
Float:{-90.0,-5.0,-150.0},
        
Float:{90.0,5.0,150.0});
    }
    else
    {
        
fVecAngle[1] = 0.0;
        
engfunc(EngFunc_SetSizewent,
        
Float:{-5.0,-90.0,-150.0},
        
Float:{5.0,90.0,150.0});
    }
    return 
PLUGIN_CONTINUE;

public 
logevent_round_end(id)
{
    new 
went = -1;
    while( ( 
went fm_find_ent_by_class wentg_Classname1 ) ) )
        
fm_remove_entitywent ); 
}
//public ForwardTouch(Ptd,Ptr) 
//{ 
//    if(!pev_valid(Ptd))
//            return FMRES_IGNORED;
//    
//    new Classname[33]
//    pev(Ptd,pev_classname,Classname,32) 
//    
//    if(!equal(Classname,g_Classname1)) 
//            return FMRES_IGNORED;
//
//    return FMRES_IGNORED;
//} 

Sorry for bad eng.

Dr.G 02-26-2009 14:30

Re: EngFunc SetSize of model.With picture.
 
check this http://forums.alliedmods.net/showthread.php?t=76707

xbatista 02-26-2009 15:08

Re: EngFunc SetSize of model.With picture.
 
I don't know how to do :/
Hard to me.I'm learning about ents 2nd day .
Please help with my code.

xPaw 02-26-2009 15:15

Re: EngFunc SetSize of model.With picture.
 
inglesh roolz. try to say better what you want todo pls

xbatista 02-26-2009 15:18

Re: EngFunc SetSize of model.With picture.
 
!!!ENT!!! is creating good by SetSize,but !!!MODEL!!! won't...


All times are GMT -4. The time now is 17:06.

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