Raised This Month: $12 Target: $400
 3% 

Make any spawned entity (model) solid


Post New Thread Reply   
 
Thread Tools Display Modes
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 10-19-2018 , 15:16   Re: Make any spawned entity (model) solid
Reply With Quote #11

Quote:
Originally Posted by SomewhereLost View Post
What attitude?

Seemslike you havent read it correctly.



I was just asking for
Maybe it's the time you start searching? Just search for 'entity_set_model' ffs. It's simple, the first parameter is the entity and the second is the model you want to set.
__________________

Last edited by edon1337; 10-19-2018 at 15:16.
edon1337 is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 10-19-2018 , 15:22   Re: Make any spawned entity (model) solid
Reply With Quote #12

Thats why I mentioned before, if I had any clue how to code such thing I'd most likely post it in the Scripting section. Anyways, if someone bothers to make those changes, I think this part from GHW_Entspawner what's should be modified

PHP Code:
public spawnent(id,level,cid)
{
    if(!
cmd_access(id,level,cid,2))
    {
        return 
PLUGIN_HANDLED
    
}
    new 
arg1[32]
    
read_argv(1,arg1,31)
    new 
arg2[32]
    
read_argv(2,arg2,31)
    new 
num2=-1
    
for(new i=0;i<num;i++)
    {
        if(
containi(precached_name[i],arg1)!=-1)
        {
            if(
num2!=-1)
            {
                
console_print(id,"[AMXX] %L",id,"MSG_NOSPAWN_MORE",arg1)
                return 
PLUGIN_HANDLED
            
}
            
num2=i
        
}
    }
    if(
num2==-1)
    {
        
console_print(id,"[AMXX] %L",id,"MSG_NOSPAWN_NONE",arg1)
        return 
PLUGIN_HANDLED
    
}
    new 
sequence str_to_num(arg2)
    if(!
strlen(arg2))
    {
        
sequence precached_sequence[num2]
    }
    new 
Float:origin[3]
    new 
Float:angles[3]
    new 
Float:v_angle[3]
    
entity_get_vector(id,EV_VEC_origin,origin)
    
entity_get_vector(id,EV_VEC_v_angle,v_angle)
    
entity_get_vector(id,EV_VEC_angles,angles)

    new 
ent create_entity("info_target")

    
entity_set_string(ent,EV_SZ_classname,"ghw_spawned_ent")

    
entity_set_model(ent,precached[num2])

    
entity_set_origin(ent,origin)
    
entity_set_vector(ent,EV_VEC_v_angle,v_angle)
    
entity_set_vector(ent,EV_VEC_angles,angles)

    
//entity_set_int(ent, EV_INT_solid,SOLID_BBOX)
    
entity_set_int(ent,EV_INT_movetype,MOVETYPE_FLY)
    
entity_set_edict(ent,EV_ENT_owner,33)

    
entity_set_float(ent,EV_FL_framerate,1.0)
    
entity_set_int(ent,EV_INT_sequence,sequence)

    
entity_set_size(ent,Float:{-0.1, -0.1, -0.1},Float:{0.10.10.1})

    new 
mapname[32]
    new 
string[16]
    
get_mapname(mapname,31)
    
format(mapname,31,"[%s]",mapname)
    
write_file(refferencefile,mapname,-1)
    
write_file(refferencefile,precached[num2],-1)
    
format(string,15,"%d",sequence)
    
write_file(refferencefile,string,-1)
    
format(string,15,"%f",origin[0])
    
write_file(refferencefile,string,-1)
    
format(string,15,"%f",origin[1])
    
write_file(refferencefile,string,-1)
    
format(string,15,"%f",origin[2])
    
write_file(refferencefile,string,-1)
    
format(string,15,"%f",angles[0])
    
write_file(refferencefile,string,-1)
    
format(string,15,"%f",angles[1])
    
write_file(refferencefile,string,-1)
    
format(string,15,"%f",angles[2])
    
write_file(refferencefile,string,-1)
    
format(string,15,"%f",v_angle[0])
    
write_file(refferencefile,string,-1)
    
format(string,15,"%f",v_angle[1])
    
write_file(refferencefile,string,-1)
    
format(string,15,"%f",v_angle[2])
    
write_file(refferencefile,string,-1)

    
console_print(id,"[AMXX] %L",id,"MSG_SPAWN",precached_name[num2],sequence)
    return 
PLUGIN_HANDLED

__________________

Last edited by SomewhereLost; 10-19-2018 at 15:22.
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-22-2018 , 02:43   Re: Make any spawned entity (model) solid
Reply With Quote #13

I'm assuming you want to make an entity and give it the model size?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 10-22-2018 at 02:44.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 10-22-2018 , 08:19   Re: Make any spawned entity (model) solid
Reply With Quote #14

Yeah thats about it.
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 10-22-2018 , 08:47   Re: Make any spawned entity (model) solid
Reply With Quote #15

Quote:
Originally Posted by SomewhereLost View Post
Yeah thats about it.
The code you provided already has a specific entity size set. Also if you want to make the entity solid, just uncomment this sentence:
PHP Code:
//entity_set_int(ent, EV_INT_solid,SOLID_BBOX) 
__________________
edon1337 is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 10-22-2018 , 10:10   Re: Make any spawned entity (model) solid
Reply With Quote #16

That is commented because I already tried that but didnt work. And also those sizes are incorrect, as I know it needs xyz of the entity or model or smth like that which I dont know how to calculate.
Those sizes basically gives a very small space near the model where if you step on it you will get stuck.
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 10-22-2018 , 10:38   Re: Make any spawned entity (model) solid
Reply With Quote #17

Quote:
Originally Posted by SomewhereLost View Post
That is commented because I already tried that but didnt work. And also those sizes are incorrect, as I know it needs xyz of the entity or model or smth like that which I dont know how to calculate.
About solidity check this thread. I also had the same problem and the issue was the order of natives.

Quote:
Originally Posted by SomewhereLost View Post
Those sizes basically gives a very small space near the model where if you step on it you will get stuck.
That's because you haven't set the correct size for it. Try new sizes until you find the one that fits the most.
__________________

Last edited by edon1337; 10-22-2018 at 10:38.
edon1337 is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 10-22-2018 , 11:05   Re: Make any spawned entity (model) solid
Reply With Quote #18

Like the size of the model is actually a big one, how can I find the correct size for it without just writing random numbers 938485727 times?
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 10-22-2018 , 14:03   Re: Make any spawned entity (model) solid
Reply With Quote #19

Quote:
Originally Posted by SomewhereLost View Post
Like the size of the model is actually a big one, how can I find the correct size for it without just writing random numbers 938485727 times?
Well, you don't have to keep increasing by 1.0, try 5.0, 10.0, 15.0, 50.0...
__________________

Last edited by edon1337; 10-22-2018 at 14:04.
edon1337 is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 10-22-2018 , 14:17   Re: Make any spawned entity (model) solid
Reply With Quote #20

Are those sizes somehow related to origins?
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
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 11:46.


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