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

[CS:GO] TE_SetupBeamPoints


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 03-06-2016 , 09:50   [CS:GO] TE_SetupBeamPoints
Reply With Quote #1

Hi,
Is that true TE_SetupBeamPoints don't trace through walls or some other solid/nonsolid objects?

Because I trace it from one origin to another through wall and it won't show at all. Only when there is no obstacles.
__________________

Last edited by xbatista; 03-06-2016 at 09:57.
xbatista is offline
Send a message via Skype™ to xbatista
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 03-06-2016 , 16:00   Re: [CS:GO] TE_SetupBeamPoints
Reply With Quote #2

For me it is working in csgo through walls:
PHP Code:
new _Laser;
_Laser PrecacheModel("materials/sprites/laserbeam.vmt"true);
TE_SetupBeamPoints(Origin1Origin2_Laser00060.02.02.010.0, {255255255255}, 15); 
TheWho is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 03-06-2016 , 16:25   Re: [CS:GO] TE_SetupBeamPoints
Reply With Quote #3

PHP Code:
public void eventPlayerHurt(Event event, const char[] namebool dontBroadcast)
{
    
int victim GetClientOfUserId(GetEventInt(event"userid"));
    
int attacker GetClientOfUserId(GetEventInt(event"attacker"));

    if (
victim == attacker)
        return;

    if (!
IsValidAlive(attacker))
        return;
        
    if (!
IsValidClient(victim))
        return;
        
    if (!
itemEnabled[attacker])
        return;
        
    
char weaponName[16];
    
float victimLocation[3], targetLocation[3];
    
    
GetEventString(event"weapon"weaponNamesizeof(weaponName));
    
    if (!
StrEqual(weaponName"awp"))
        return;
    
    
GetClientAbsOrigin(victimvictimLocation);
        
    
int target GetRandomClient(victim);
    if (
IsValidAlive(target)) {
        
GetClientAbsOrigin(targettargetLocation);
        
        
float distanceBetween GetVectorDistance victimLocationtargetLocation );
        
        if ( ( 
distanceBetween CHAIN_LIGHTNING_DISTANCE ) )
        {
            
victimLocation[2] += 50.0;
            
targetLocation[2] += 50.0;
            
            
PrintToChat(attacker"X1: Y1: Z1:   X2: Y2: Z2:"victimLocation[0],victimLocation[1],victimLocation[2],targetLocation[0],targetLocation[1],targetLocation[2]);
            
            
TE_SetupBeamPoints(victimLocationtargetLocationtraceLightning0005.34.04.011.1, {0100125190}, 1);
            
TE_SendToAll();
            
TE_SetupBeamPoints(victimLocationtargetLocationtraceLightning0005.36.08.010.0, {00255190}, 6); 
            
TE_SendToAll();
        }
    }
}

public 
int GetRandomClient(int client

    
int[] iClients = new int[MaxClients];
    
int iClientsNumi;
    
    
float location[3], targetOrigin[3], distanceBetween;
    
GetClientAbsOrigin(clientlocation);
    
    for (
1<= MaxClientsi++) 
    { 
        if (
IsValidAlive(i) && GetClientTeam(i) == GetClientTeam(client))
        {
            
GetClientAbsOriginitargetOrigin );
            
distanceBetween GetVectorDistance targetOriginlocation );
            
            if ( ( 
distanceBetween CHAIN_LIGHTNING_DISTANCE ) )
            {
                
iClients[iClientsNum++] = i
            }
        }
    } 
    
    if (
iClientsNum 0)
    {
        return 
iClients[GetRandomInt(0iClientsNum-1)]; 
    }
    
    return 
0;

EDIT: It hits same target, whooops sorry guys. i != client. Will put everywhere this check, it seems that I'm coursed with this specific check.
Problem solved.
__________________

Last edited by xbatista; 03-07-2016 at 15:38.
xbatista is offline
Send a message via Skype™ to xbatista
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 13:16.


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