AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Sort of get player location (https://forums.alliedmods.net/showthread.php?t=243319)

Jhob94 07-02-2014 16:52

Sort of get player location
 
Well, i am using lasermines plugin. I made it doesnt shows laser when someone is acrossing the laser.
But i would like it to show the laser untill touch the body that is blocking it.
It has this to get end of laser location:
PHP Code:

pev(i_Entpev_vuser1vEnd

But i need to get player location that is touching the lasermine. How? :3

devilicioux 07-03-2014 04:34

Re: Sort of get player location
 
I am not sure but try this out ..
Register touch with the Laser entity .. and get player origin when the touch function gets called ..

klippy 07-03-2014 07:13

Re: Sort of get player location
 
Quote:

Originally Posted by devilicioux (Post 2161243)
I am not sure but try this out ..
Register touch with the Laser entity .. and get player origin when the touch function gets called ..

You can't do that, since temporary entities can't be touched(he talks about laser sprite, not lasermine entity on the wall).
In ltm_Think(i_Ent) forward, in this switch case
PHP Code:

case BEAMBREAK_THINK

you should find this piece of code(you could just search for it)
PHP Code:

if( fBeamthink fCurrTime && get_pcvar_num(g_LVISIBLE))
{
    
DrawLaser(i_EntvOriginvEnd );
    
set_pevi_EntLASERMINE_BEAMTHINKfCurrTime 0.1 );


and replace it with this code(not tested, I just thought of that code, but it should work if i haven't missed something)
PHP Code:

if( fBeamthink fCurrTime && get_pcvar_num(g_LVISIBLE))
{
    if(
fFraction 1.0)
        
get_tr2(0TR_vecEndPosvEnd);
                        
    
DrawLaser(i_EntvOriginvEnd );
    
set_pevi_EntLASERMINE_BEAMTHINKfCurrTime 0.1 );




All times are GMT -4. The time now is 21:11.

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