AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with the entity in the ground (https://forums.alliedmods.net/showthread.php?t=240979)

OnePL 05-25-2014 10:49

Problem with the entity in the ground
 
hello

I have this code to create a entity (ball)

PHP Code:

new Float:pochodzenie[3]

public 
plugin_init() register_clcmd("say /add""DodajPilke")

public 
DodajPilke(id) {
    if(
pev_valid(pilka)) remove_entity_name("ball")

    new 
origin[3]
    
get_user_origin(idorigin3)
    
IVecFVec(originpochodzenie)

    
pochodzenie[2] += 15.0
    StworzPilke
(pochodzenie)
    
ZapiszPilke(pochodzenie)
}

StworzPilke(Float:origin[3] = { 0.00.00.0 }) {
    
pilka create_entity("info_target")

    if(
is_valid_ent(pilka)) {
        
set_pev(pilkapev_classname"ball")
        
set_pev(pilkapev_solid2)
        
set_pev(pilkapev_movetype10)
        
engfunc(EngFunc_SetModelpilkaMODEL_PILKI)
        
engfunc(EngFunc_SetOriginpilkaorigin)
        
engfunc(EngFunc_SetSizepilkaFloat:{ -5.0, -5.00.0 }, Float:{ 5.05.048.0 })
        
set_pev(pilkapev_framerate0.0)
        
set_pev(pilkapev_sequence1)
        
set_pev(pilkapev_skinrandom(3))

        
pochodzenie origin
        stworz_pilke 
true
    
}
    
RegisterHamFromEntity(Ham_Thinkpilka"KopnieciePilki")
    
set_pev(pilkapev_nextthinkget_gametime() + 0.03)


everything is ok except one ... the model is in the ground

http://i.imgur.com/E1BBvgD.png

what is wrong? what is missing?

Xalus 05-25-2014 11:37

Re: Problem with the entity in the ground
 
engfunc(EngFunc_SetSize, pilka, Float:{ -5.0, -5.0, 0.0 }, Float:{ 5.0, 5.0, 48.0 })

Wierd size, the 'solid-box' may be above the midle of the ball, so the rest is under?

OnePL 05-25-2014 11:51

Re: Problem with the entity in the ground
 
half of the ball is in the ground, I would like that the whole model of the ball was on the ground

Xalus 05-25-2014 14:14

Re: Problem with the entity in the ground
 
Quote:

Originally Posted by OnePL (Post 2142336)
half of the ball is in the ground, I would like that the whole model of the ball was on the ground

No shit -_-

Try: engfunc(EngFunc_SetSize, pilka, Float:{ -5.0, -5.0, -24.0 }, Float:{ 5.0, 5.0, 24.0 })


All times are GMT -4. The time now is 09:46.

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