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

Ground != Walls && Ground != Roof issue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 01-10-2014 , 08:07   Ground != Walls && Ground != Roof issue
Reply With Quote #1

I use code below but message appear if entity touch on walls or roof.

Any way to hook only ground?

PHP Code:
    if(Entity_GetGroundEntity(entity))
    {
        
PrintToChatAll("Rocket touch on ground");
    } 
Thanks for all help.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
arthurdead
Senior Member
Join Date: Jul 2013
Old 01-10-2014 , 10:11   Re: Ground != Walls && Ground != Roof issue
Reply With Quote #2

Quote:
Originally Posted by rodrigo286 View Post
I use code below but message appear if entity touch on walls or roof.

Any way to hook only ground?

PHP Code:
    if(Entity_GetGroundEntity(entity))
    {
        
PrintToChatAll("Rocket touch on ground");
    } 
Thanks for all help.
hook start touch on the rocket and GetEntityFlags FL_ONGROUND ? br ?

Last edited by arthurdead; 01-10-2014 at 10:13.
arthurdead is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 01-10-2014 , 10:48   Re: Ground != Walls && Ground != Roof issue
Reply With Quote #3

I tried this but dont work

Any other method?

Thanks.

Sim, sou BR
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
arthurdead
Senior Member
Join Date: Jul 2013
Old 01-10-2014 , 14:39   Re: Ground != Walls && Ground != Roof issue
Reply With Quote #4

Quote:
Originally Posted by rodrigo286 View Post
I tried this but dont work

Any other method?

Thanks.

Sim, sou BR
found this
Code:
GetEntPropEnt(entity, Prop_Send, "m_hGroundEntity"); // 0 = World (aka on ground) | -1 = In air | Any other positive value = CBaseEntity pointer to the entity below player

Last edited by arthurdead; 01-10-2014 at 14:42.
arthurdead is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 01-10-2014 , 18:43   Re: Ground != Walls && Ground != Roof issue
Reply With Quote #5

-1 = Hook wall , roof and floor, i need hook only floor...
0 = Dont hook any.

Thanks for help...
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 01-10-2014 , 20:32   Re: Ground != Walls && Ground != Roof issue
Reply With Quote #6

I suppose that you could do a trace ray around at a distance of 1 units and up the z value by 1 or more and check if it touch a wall, if it does that mean the rocket touched a wall or a roof and not a floor.

EDIT: if "if(Entity_GetGroundEntity(entity))" is called when ever it touch a wall, floor or roof you can start the tray ray after this.

Last edited by Mathias.; 01-10-2014 at 20:36.
Mathias. is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 01-11-2014 , 07:55   Re: Ground != Walls && Ground != Roof issue
Reply With Quote #7

I did not understand, could you give me an example?

Regards.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 01-11-2014 , 11:41   Re: Ground != Walls && Ground != Roof issue
Reply With Quote #8

I'm not so good with trace ray, but I know it possible, I will try give me some time.
Mathias. is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 01-11-2014 , 12:17   Re: Ground != Walls && Ground != Roof issue
Reply With Quote #9

Thanks I'll wait.

Regards.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 01-11-2014 , 14:31   Re: Ground != Walls && Ground != Roof issue
Reply With Quote #10

actually I have difficulty to figure it out myself, I'm really bad with trace and vectors.

PHP Code:
#include <sourcemod>
#include <sdktools>

new beamsprite = -1;
new 
halosprite = -1;

public 
OnPluginStart()
{
    
RegConsoleCmd("test"MyCallBack);
    
    
beamsprite PrecacheModel("materials/sprites/laser.vmt");
    
halosprite PrecacheModel("materials/sprites/halo01.vmt");   
}

public 
Action:MyCallBack(clientargs)
{
    for (new 
1MaxClientsi++)
    {
        if (
IsClientInGame(i))
        {
            new 
Float:client_origin[3], Float:client_angle[3], Float:client_vector[3], Float:end_pos[3];
            
GetClientEyeAngles(iclient_angle);
            
GetClientAbsOrigin(iclient_origin);

            
GetAngleVectors(client_angleclient_vectorNULL_VECTORNULL_VECTOR);
            
            new 
Handle:trace TR_TraceRayFilterEx(client_originclient_vectorMASK_SOLIDRayType_InfiniteFilter_Entitiesi);
            
            if (
TR_DidHit(trace))
            {
                
TR_GetEndPosition(end_postrace);
                
PrintToChatAll("Start: %d, %d, %d end: %d, %d, %d"RoundToNearest(client_origin[0]), RoundToNearest(client_origin[1]), RoundToNearest(client_origin[2]), RoundToNearest(end_pos[0]), RoundToNearest(end_pos[1]), RoundToNearest(end_pos[2]));
                new 
color[4] = {2550255255};
                
TE_SetupBeamPoints(client_originend_posbeamspritehalosprite000.10.12.000.0color0);
                
TE_SendToAll(0.0);
                return 
Plugin_Handled;
            }
        }
    }

    return 
Plugin_Handled;
}


public 
bool:Filter_Entities(entitycontentsMask)
{
    if (!
IsValidEntity(entity))
    {
        return 
true;
    }
    return 
false;

I just want to make this work and afterward check if the distance between the traceray and end point is lower than 10 or something like that.

EDIT: I do a for loop because when I run it in a local server and type the command I'm counted as 0 which is the server and return an error.

Last edited by Mathias.; 01-11-2014 at 14:32.
Mathias. 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 09:25.


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