[Question] Set size to a angle

Сообщения
36
Реакции
0
Hello.
I want to make a model that is placed in a special angle and make it solid so we can walk on it. As you can see in the video, in the middle is solid, but rather than that is not and we fall down.

Video Demonstration - I am trying to make all this bridge(platform) solid.

Current code i am using. Is mins/maxs only possible for boxes, or angles too?

Код:
#include <amxmodx>
//#include <engine>
#include <fakemeta>

#define PLUGIN "FloppyTown Bridge"
#define VERSION "1.0"
#define AUTHOR "EFFEX"

new const Float:g_fOrigin[3] = {229.0, -1075.1, 678.3}
new const Float:g_fAngle[3] = {-3.5, 133.6, 13.0}

new const Float:g_fMins[3] = { -17.7, -965.6, -1.0 }
new const Float:g_fMaxs[3] = { 17.8, 970.4, 10.9 }

new const g_szDefaultModel[] = "models/bridge_3.mdl"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)

    register_clcmd("spawn2", "spawnBox")

    new map[32]
    get_mapname(map, charsmax(map))
    if(equal(map, "hns_floppytown"))
    {
        spawnBox()
    }
}

public plugin_precache()
{
    precache_model(g_szDefaultModel)
}

public spawnBox()
{
    // Create our entity
    new iEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "func_wall"))

    // Set the name for the entity
     set_pev(iEnt, pev_classname, "hns_floppy_bridge")
   
    // Set the world model      
    engfunc(EngFunc_SetModel, iEnt, g_szDefaultModel)

    // Lets make the entity solid
    set_pev(iEnt, pev_solid, SOLID_BBOX)

    // Set the size
    engfunc(EngFunc_SetSize, iEnt, g_fMins, g_fMaxs)
    set_pev(iEnt, pev_mins, g_fMins)
    set_pev(iEnt, pev_maxs, g_fMaxs)
    set_pev(iEnt, pev_absmin, g_fMins)
    set_pev(iEnt, pev_absmax, g_fMaxs)

    // Set the origin of the entity
    engfunc(EngFunc_SetOrigin, iEnt, g_fOrigin)

    // Set the movetype so doesnt affect the gravity and collides.
    set_pev(iEnt, pev_movetype, MOVETYPE_FLY)

    // Finally set the angle
    set_pev(iEnt, pev_angles, g_fAngle)
}
 
Последнее редактирование:
Сообщения
36
Реакции
0
Ok i actually managed to make it work, but now i have another problem.
Players can walk on this model and its solid, but when we throw grenades they are not solid on the model, they fall down. Any suggestion? (Code is the same)
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу