Raised This Month: $32 Target: $400
 8% 

Problem Entity Origin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 02-15-2022 , 07:50   Problem Entity Origin
Reply With Quote #1

Hi, well my problem is that I would like the entity to appear higher than it appears, but I can't get it, it always stays as in the image.

Another problem is that I would like to change the color of the model, is it possible? use glow at the end but would like to change its color if possible

PHP Code:
new iUserPet[33]

CreateSusa(id)
{
    new 
susanowner id
    
new susanoo create_entity("info_target")
    
    if ( !
pev_valid(susanoo) ) return;
    
    
set_pev(susanoopev_classname"susanoo")        // name of ent
    
entity_set_model(susanoo"models/shmod/susanoo.mdl")    // model
    
    
    // I Try this for change the origin but not found
    
new Float:Origin[3], Float:vOrigin[3]
    
//get_user_origin(susanowner, Origin, 1)
    
pev(susanownerpev_originOrigin)
    
Origin[2]+= 50
    
    vOrigin
[0] += Origin[0]
    
vOrigin[1] += Origin[1]  
    
vOrigin[2] += Origin[2]
    
//engfunc(EngFunc_SetOrigin, susanoo, vOrigin)
    
set_pev(susanoopev_originvOrigin );
    
    
set_pev(susanoopev_movetypeMOVETYPE_FOLLOW)        // follor player id
    
set_pev(susanoopev_aimentsusanowner)        // owner    
    
set_pev(susanoopev_framerate1.0)            // This is for animation? 
    
set_pev(susanoopev_animtimeget_gametime())        // This is for animation? 
    
    // What is sequence?
    
set_pev(susanoopev_sequence0)            // ?
    
    // I use this for glow
    
set_rendering(susanookRenderFxGlowShell1540210kRenderNormal25);
     
/*
    //  -----  But i tried to use this to change the color of the model but not found    -----
     ---------------------------------------------------------------------------
     
    new Float:fVecColor[3] // = {154.0, 0.0, 210.0} 
    fVecColor[0]=float(154.0);
    fVecColor[1]=float(0.0);
    fVecColor[2]=float(210.0);
    new Float:flAmount = 0.0
    //Float:{LOCKED_COLOR}
    set_pev(susanoo, pev_renderfx, kRenderFxNone)
    set_pev(susanoo, pev_rendercolor, fVecColor )
    set_pev(susanoo, pev_rendermode, kRenderNormal) 
    set_pev(susanoo, pev_renderamt, flAmount)
    
    set_pev(susanoo, pev_rendermode, kRenderTransColor)
    set_rendering(susanoo, kRenderTransColor, 154, 0, 210)
    */
    
    
iUserPet[id] = susanoo;
    
client_print(susanownerprint_chat"Tenes susanoo:")
    



and another question I tried to put life into the entity and it would take damage, but it just doesn't, is this ok?

PHP Code:
   new Float:p_cvar_health get_pcvar_float(phealth); 
    
set_pev(susanoopev_solidSOLID_BBOX); // touch on edge, block  
    
set_pev(susanoopev_healthp_cvar_health); // X hp para entidad
    
set_pev(susanoopev_takedamageDAMAGE_YES); // daños activado 
Arje is offline
zXCaptainXz
Member
Join Date: May 2017
Old 02-15-2022 , 15:16   Re: Problem Entity Origin
Reply With Quote #2

I believe this is your problem
Origin[2]+= 50
->
Origin[2]+= 50.0
Origins are floats and you are incrementing them with an integer so it counts as 0

As for changing the color, nothing comes to my mind right now but I believe it’s possible.

As for your setting health, I believe you should give your entity a size so it gets a hitbox
Code:
new Float:maxs[3] = {16.0,16.0,36.0}
new Float:mins[3] = {-16.0,-16.0,-36.0}
entity_set_size(susanoo,mins,maxs)
There should be a fakemeta method if you prefer so you can try and figure it out
zXCaptainXz is offline
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 02-15-2022 , 18:09   Re: Problem Entity Origin
Reply With Quote #3

first thanks for the time, but this is not a problem i try it, but i have another scripts with only "50" and found right.
I believe this is your problem
Origin[2]+= 50
->
Origin[2]+= 50.0

so idk how to change the origin z of the generated entity..

yes i found the form in fakemeta, thanks , but now my problem is that the model is put on but it gets stuck, i proof others SOLID_ but if I put another the model does not appear

PHP Code:
    new Float:maxs[3] = {16.0,16.0,36.0}
    new 
Float:mins[3] = {-16.0,-16.0,-36.0}
    
set_pev(susanoopev_minsmins
    
set_pev(susanoopev_maxsmaxs)  
    
set_pev(susanoopev_sizeFloat:{16.0,16.0,36.0,-16.0,-16.0,-36.0}) 
But another question, how do I check if the entity is still alive/dead?

Last edited by Arje; 02-15-2022 at 18:13. Reason: explain more
Arje is offline
NOVA GAMING
Member
Join Date: Apr 2020
Old 02-15-2022 , 23:20   Re: Problem Entity Origin
Reply With Quote #4

use
PHP Code:
is_valid_ent
pev_valid 
Btw Does that Origin Bug is fixed?
__________________
NOVA GAMING is offline
Reply


Thread Tools
Display Modes

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 03:05.


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