AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Make a bags solid what wrong and why? (https://forums.alliedmods.net/showthread.php?t=155712)

lis_16 04-25-2011 18:22

Make a bags solid what wrong and why?
 
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).

SonicSonedit 04-26-2011 00:36

Re: Make a bags solid what wrong and why?
 
http://forums.alliedmods.net/showthread.php?t=79578

lis_16 04-26-2011 05:11

Re: Make a bags solid what wrong and why?
 
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.

SonicSonedit 04-26-2011 07:06

Re: Make a bags solid what wrong and why?
 
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.

Mini_Midget 04-26-2011 07:23

Re: Make a bags solid what wrong and why?
 
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.

Arkshine 04-26-2011 07:41

Re: Make a bags solid what wrong and why?
 
This is wrong also, because both module use the engine call pfnSetSize.

SonicSonedit 04-26-2011 07:50

Re: Make a bags solid what wrong and why?
 
Arkshine
Even engfunc(EngFunc_SetSize ?

lis_16 04-26-2011 08:04

Re: Make a bags solid what wrong and why?
 
So what should i change to make it works? I'm not a pro scripter :P

Arkshine 04-26-2011 08:11

Re: Make a bags solid what wrong and why?
 
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.

lis_16 04-26-2011 08:27

Re: Make a bags solid what wrong and why?
 
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?


All times are GMT -4. The time now is 20:03.

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