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

Solved How i can trace everyone around me?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ayyyyyyylmao
Junior Member
Join Date: Apr 2018
Old 08-09-2018 , 07:12   How i can trace everyone around me?
Reply With Quote #1

im using old syntax, here is my trace snippet
Code:
stock TraceClientViewEntity(cl)
{
 new Float:m_Origin[3];
 new Float:m_angRotation[3];
 GetClientEyePosition(cl, m_Origin);
 GetClientEyeAngles(cl, m_angRotation);
 new Handle:tr = TR_TraceRayFilterEx(m_Origin, m_angRotation, MASK_VISIBLE, RayType_Infinite, TRDontHitSelf, cl);
 new pEntity = -1;
 if (TR_DidHit(tr))
 {
  pEntity = TR_GetEntityIndex(tr);
  CloseHandle(tr);
  return pEntity;
 }
 CloseHandle(tr);
 return -1;
}
public bool:TRDontHitSelf(entity, mask, any:data)
{
 if (entity == data) return false;
 return true;
}
here how i checking if im aiming at anyone
Code:
	new target = TraceClientViewEntity(client);
	if (target < 1 || target > MaxClients) return;
	if (!IsValidEdict(target)) return;
	decl String:m_iszNetworkId[32];
	GetClientAuthString(target, m_iszNetworkId, sizeof(m_iszNetworkId));
	PrintToChat(client, "SteamId=%s", m_iszNetworkId);
I have a problem, idk how i can trace everyone around me

Last edited by ayyyyyyylmao; 08-10-2018 at 09:30.
ayyyyyyylmao is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 08-09-2018 , 07:43   Re: How i can trace EVERYTHING around player?
Reply With Quote #2

Well neither of those snippets does nothing that the title says.

We have to create a radius around the player...

PHP Code:
public bool SomeNative(int iClient)
{
    
float fCPosition[3], fEPosition[3], fDistance;

    for (
int i 1MaxClientsi++)
    {
        if (
IsValidEntity(i))
        {
            
GetEntPropVector(iClientProp_Data"m_vecOrigin"fCPosition);
            
GetEntPropVector(iProp_Data"m_vecOrigin"fEPosition);

            
fDistance GetVectorDistance(fCPositionfEPosition);

            if (
fDistance amount_of_units)
                return 
true;
        }
    }

    return 
false;

Doing this, more problems might occur.
- What if there's more than one player? Then radius will hit eachother.
- Your server will spit errors on you, saying that the client is not ingame or connected.
mug1wara is offline
ayyyyyyylmao
Junior Member
Join Date: Apr 2018
Old 08-09-2018 , 07:57   Re: How i can trace EVERYTHING around player?
Reply With Quote #3

Quote:
Originally Posted by mug1wara View Post
Well neither of those snippets does nothing that the title says.

We have to create a radius around the player...

PHP Code:
public bool SomeNative(int iClient)
{
    
float fCPosition[3], fEPosition[3], fDistance;

    for (
int i 1MaxClientsi++)
    {
        if (
IsValidEntity(i))
        {
            
GetEntPropVector(iClientProp_Data"m_vecOrigin"fCPosition);
            
GetEntPropVector(iProp_Data"m_vecOrigin"fEPosition);

            
fDistance GetVectorDistance(fCPositionfEPosition);

            if (
fDistance amount_of_units)
                return 
true;
        }
    }

    return 
false;

Doing this, more problems might occur.
- What if there's more than one player? Then radius will hit eachother.
- Your server will spit errors on you, saying that the client is not ingame or connected.
nonono, im making visible-check for my plugin, like if i can see any player, i receive they steamid, if i can see noone, i will receive -1

Last edited by ayyyyyyylmao; 08-09-2018 at 08:00.
ayyyyyyylmao is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-09-2018 , 08:28   Re: How i can trace EVERYTHING around player?
Reply With Quote #4

Quote:
Originally Posted by ayyyyyyylmao View Post
nonono, im making visible-check for my plugin, like if i can see any player, i receive they steamid, if i can see noone, i will receive -1
Instead of GetClientEyeAngles use the origin of the target entity.

Instead of RayType_Infinite use RayType_EndPosition ( infinite uses angles and endposition uses another entity's origin ).

Feel free to use filters for invisible things like glasses, and filter both target and client entities.

After filtering:

if(TR_DidHit())
// Player cannot see target player.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 08-09-2018 , 08:46   Re: How i can trace everyone around me?
Reply With Quote #5

But the title "How i can trace everyone around me?"...

nvm then.
mug1wara is offline
ayyyyyyylmao
Junior Member
Join Date: Apr 2018
Old 08-09-2018 , 08:52   Re: How i can trace EVERYTHING around player?
Reply With Quote #6

Quote:
Originally Posted by eyal282 View Post
Instead of GetClientEyeAngles use the origin of the target entity.

Instead of RayType_Infinite use RayType_EndPosition ( infinite uses angles and endposition uses another entity's origin ).

Feel free to use filters for invisible things like glasses, and filter both target and client entities.

After filtering:

if(TR_DidHit())
// Player cannot see target player.
meh, my raytraces so bad, like i can see the player, but trace cant
ayyyyyyylmao is offline
ayyyyyyylmao
Junior Member
Join Date: Apr 2018
Old 08-09-2018 , 08:53   Re: How i can trace everyone around me?
Reply With Quote #7

Quote:
Originally Posted by mug1wara View Post
But the title "How i can trace everyone around me?"...

nvm then.
visible* around me
ayyyyyyylmao is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 08-09-2018 , 18:04   Re: How i can trace everyone around me?
Reply With Quote #8

A trace is the entity you cursor as aiming at. This doesnt mean they are not on your screen.

I have seen posts about this. Maybe check out frans aimbot plugin.
__________________

Last edited by Neuro Toxin; 08-10-2018 at 17:49.
Neuro Toxin is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 08-10-2018 , 08:33   Re: How i can trace everyone around me?
Reply With Quote #9

https://sm.alliedmods.net/new-api/ha...ClientsInRange

PHP Code:
int GetClientsInRange(float origin[3], ClientRangeType rangeTypeint[] clientsint size
__________________
Ilusion9 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 02:28.


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