AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Catch PodBot Movement. (https://forums.alliedmods.net/showthread.php?t=246158)

Paulster1022 08-12-2014 18:57

Catch PodBot Movement.
 
Essentially want to catch the movement of Bots. It isn't accurate. Works fine with humans though.

Code:

public plugin_init( )
{
register_forward(FM_CmdStart, "fw_cmdstart")
}


public fw_cmdstart(id, uc, seed)
{
            static buttons
            buttons = get_uc(uc, UC_Buttons)

        if(buttons & IN_MOVELEFT && hasMoved[id] != LEFT)
        {
                write_file(g_random_file, "Latest Key:", 0)
                write_file(g_key_file, "Left", 0)
                hasMoved[id] = LEFT
        }

        else if(buttons & IN_MOVERIGHT && hasMoved[id] != RIGHT)
        {
                write_file(g_random_file, "Latest Key:", 0)
                write_file(g_key_file, "Right", 0)
                hasMoved[id] = RIGHT
        }
}

*Not complete code but, is there a better way to go about this for bots? Like i said, it works but it isn't accurate but for humans its great. Thx, I'm using podbots.

NikKOo31 08-12-2014 20:03

Re: Catch PodBot Movement.
 
I don't think bots use IN_MOVE*, try using IN_LEFT and IN_RIGHT instead

Paulster1022 08-12-2014 20:30

Re: Catch PodBot Movement.
 
Thanks, ill Try :)

Paulster1022 08-12-2014 20:41

Re: Catch PodBot Movement.
 
Doesn't Seem to be accurate. I see him moving left, but it sometimes calls it... Up and down seem a bit more accurate. Another way to detect movement on bots? I've tryed client_prethink function, still not accurate on what direction bot is moving in.

All podbots mostly hold the forward(W) key. Not like regular players, maybe that's why i'm not seeing IN_MOVELEFT or IN_MOVERIGHT or even IN_BACK being called.

NikKOo31 08-13-2014 00:08

Re: Catch PodBot Movement.
 
I saw in a post some time ago, someone catching the aim move by the difference with pev_angles (or pev_v_angles, not sure), maybe you can use that, but I can't find that post now D:


All times are GMT -4. The time now is 13:19.

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