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

TE_Setupbeamlaser spawns at wrong location


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 02-02-2012 , 15:40   TE_Setupbeamlaser spawns at wrong location
Reply With Quote #1

Hi guys.

Code:
public Action:TestCommand_Used(client, args)
{
    decl targetid;
    
    targetid = GetClientAimTarget(client, true);
    
    if(targetid > 0)
    {
        if(IsClientConnected(targetid))
        {
            if(IsClientInGame(targetid) && !IsFakeClient(targetid))
            {
                if(GetUserAdmin(targetid) == INVALID_ADMIN_ID)
                {
                    
                    decl String:username[MAX_NAME_LENGTH];
                    decl String:targetname[MAX_NAME_LENGTH];
                        
                    GetClientName(client, username, MAX_NAME_LENGTH);
                    GetClientName(targetid, targetname, MAX_NAME_LENGTH);
                    
                    TE_SetupBeamLaser(client, targetid, g_sprite, 0, 0, 0, 1.0, 2.0, 2.0, 3, 0.0, beamcolor, 1);
                    
                    for(new i=1;i<=MaxClients;i++)
                    {
                        if(IsClientConnected(i))
                        {
                            if(IsClientInGame(i) && !IsFakeClient(i))
                            {
                                if(GetUserAdmin(i) != INVALID_ADMIN_ID)
                                {
                                    PrintToChat(i, "%s used testcommand on %s", username, targetname);
                                    
                                    TE_SendToClient(i);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    
    return Plugin_Handled;
}
Somehow this beam does not appear between the two entities. However, when I turn around a bit, I see a red flicker (color is 255,0,0,100), so the material (materials/sprites/laserbeam.vmt) is definately being precached correctly when the plugin starts. I have no idea why the beam is not between the two entities but somewhere else and only visible in a glitchy and dislocated/disoriented way in front of my eyes if I turn around and stand still in a certain position.
Clientid and targetid are definately correct because the nicknames in the debugline are as well.

I'm using L4D2 btw.

Any ideas?
I'm clueless on that one.


Also, I wanted to play a laserbeam-sound but unfortunately I can't find any in the L4D2-soundlib, although I'm sure that I just haven't looked properly yet. Maybe one of you can give me the path of a useable soundfile, I'm pretty sure I heard one in a l4d2-plugin before.


Thanks in advance!
House

Last edited by Dr. Greg House; 02-02-2012 at 15:46.
Dr. Greg House is offline
 



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 10:45.


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