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

Make a bags solid what wrong and why?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lis_16
Senior Member
Join Date: Feb 2008
Old 04-25-2011 , 18:22   Make a bags solid what wrong and why?
Reply With Quote #1

PHP Code:
// engine 
#include <amxmodx> 
#include <amxmisc> 
#include <engine> 
#include <vector>

new g_Classname[] = "func_car" 
new g_Model[] = "models/worek.mdl" 

public plugin_init() {     
    
register_plugin("OMFG","HAX","LOL")
    
register_clcmd("say car","CmdSayCar")
    
register_touch(g_Classname,"player","TouchCar")



public 
plugin_precache() precache_model(g_Model


public 
CmdSayCar(id) {     
    new 
Ent create_entity("func_wall")
    new 
origin[3]
    new 
Float:org[3]
    
get_user_origin(idorigin3)
    
drop_to_floor(Ent)
    
IVecFVec (origin,org )
    
entity_set_origin(Entorg)
    
entity_set_model(Ent,g_Model)
    
entity_set_string(Ent,EV_SZ_classname,g_Classname)
    
entity_set_int(EntEV_INT_solidSOLID_BBOX)
    
entity_set_int(EntEV_INT_movetypeMOVETYPE_TOSS)
    
entity_set_size(Ent,Float:{-27.260000, -22.280001, -22.290001},Float:{27.340000,  26.629999,  29.020000})
    
entity_set_edict(Ent,EV_ENT_owner,id)
    
}     


public 
TouchCar(Ent,id) {     
    
entity_set_int(EntEV_INT_solidSOLID_BBOX)
    
client_print(idprint_chat"Bags touched")

Why can i go through the bags? I was looking for anserw a couple of hours and i can't find it.

I write this code after read this thread:

http://forums.alliedmods.net/showthr...ghlight=entity

Entity is making where I'm looking, size is good (touchcar shows it).
lis_16 is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-26-2011 , 00:36   Re: Make a bags solid what wrong and why?
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=79578
__________________

SonicSonedit is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 04-26-2011 , 05:11   Re: Make a bags solid what wrong and why?
Reply With Quote #3

You aren't fun. I read this code, but it's almost same with difference mine is in engine. I read about 20 topics about solid and i don't know why it don't wanna work.
lis_16 is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-26-2011 , 07:06   Re: Make a bags solid what wrong and why?
Reply With Quote #4

lis_16
Then take code from that plugin and see if it will work for you. If it will, then line after line re-code that code into engine and see when it stops work. That way you'll find a error.
__________________

SonicSonedit is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 04-26-2011 , 07:23   Re: Make a bags solid what wrong and why?
Reply With Quote #5

PHP Code:
    entity_set_size(Ent,Float:{-27.260000, -22.280001, -22.290001},Float:{27.340000,  26.629999,  29.020000}) 
That is wrong if you're using the engine method.

AFAIK, when you use the engine method to set the size of the ent. You are setting the size RESPECTED to 0.0. While using fakemeta on setting the ent size you are setting its size RESPECTED to the model itself.

I read this up somewhere on these forums.
__________________
It's a mystery.
Mini_Midget is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-26-2011 , 07:41   Re: Make a bags solid what wrong and why?
Reply With Quote #6

This is wrong also, because both module use the engine call pfnSetSize.
__________________
Arkshine is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-26-2011 , 07:50   Re: Make a bags solid what wrong and why?
Reply With Quote #7

Arkshine
Even engfunc(EngFunc_SetSize ?
__________________

SonicSonedit is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 04-26-2011 , 08:04   Re: Make a bags solid what wrong and why?
Reply With Quote #8

So what should i change to make it works? I'm not a pro scripter
lis_16 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-26-2011 , 08:11   Re: Make a bags solid what wrong and why?
Reply With Quote #9

Yes, SonicSonedit, both are just wrappers to engine call.

lis_16, try to comment entity_set_edict(Ent,EV_ENT_owner,id) and see what happens.
__________________

Last edited by Arkshine; 04-26-2011 at 08:13.
Arkshine is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 04-26-2011 , 08:27   Re: Make a bags solid what wrong and why?
Reply With Quote #10

PHP Code:
// engine 
#include <amxmodx> 
#include <amxmisc> 
#include <engine> 
#include <vector>

new g_Classname[] = "func_car" 
new g_Model[] = "models/worek.mdl" 

public plugin_init() {     
    
register_plugin("OMFG","HAX","LOL")
    
register_clcmd("say car","CmdSayCar")



public 
plugin_precache() precache_model(g_Model


public 
CmdSayCar(id) {     
    new 
Ent create_entity("func_wall")
    new 
origin[3]
    new 
Float:org[3]
    
get_user_origin(idorigin3)
    
drop_to_floor(Ent)
    
IVecFVec (origin,org )
    
entity_set_origin(Entorg)
    
entity_set_model(Ent,g_Model)
    
entity_set_string(Ent,EV_SZ_classname,g_Classname)
    
entity_set_int(EntEV_INT_solidSOLID_BBOX)
    
entity_set_int(EntEV_INT_movetypeMOVETYPE_TOSS)
    
entity_set_size(Ent,Float:{-27.260000, -22.280001, -22.290001},Float:{27.340000,  26.629999,  29.020000})
    
//entity_set_edict(Ent,EV_ENT_owner,id)
    

That works excelent. THANKS!!!

But why when I set ent's owner won't work?
lis_16 is offline
Reply



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 07:49.


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