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

How to control fake client movement?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Beaverboys
Member
Join Date: Aug 2012
Old 05-25-2015 , 02:34   How to control fake client movement?
Reply With Quote #1

I've created a bot using CreateFakeClient and I'm writing code inside of OnGameFrame to try to control it. The code is based largely on an AMXX plugin and I don't know what to replace EngFunc_RunPlayerMove with.
PHP Code:
public OnGameFrame() 
{
    static 
idbuttonsIsUserClosemsecFloat:floatvar[3], Float:targ_origin[3], Float:v_length;
    
global_get(glb_frametimev_length);
    
msec RoundFloat(v_length 1000.0);

    for (
id 1id <= IsBot[31]; id++)
        if (
PumpFake[id] > 0)
            
PumpFake[id] += 4;
        else if (
IsBot[id])
            if (
IsPlayerAlive(id))
            {
                
GetEntPropVector(idProp_Send"m_vecOrigin"floatvar);
                
targ_origin TargetOrigin[id], targ_origin[2] = floatvar[2];
                
IsUserClose = (GetVectorDistance(floatvartarg_origin) > 30.0) ? 1buttons 0;

                if (!
IsUserClose)
                {
                    
targ_origin[0] -= floatvar[0], targ_origin[1] -= floatvar[1], targ_origin[2] -= floatvar[2];
                    
v_length GetVectorLength(targ_origin);
                    
targ_origin[0] /= v_lengthtarg_origin[1] /= v_lengthtarg_origin[2] /= v_length;
                    
GetVectorAngles(targ_originfloatvar);
                    
floatvar[0] *= -1;
                    if (
floatvar[1] > 180.0floatvar[1] -= 360;
                    else if (
floatvar[1] < -180.0floatvar[1] += 360;
                    else if (
floatvar[1] == 180.0 || floatvar[1] == -180.0floatvar[1] = -179.999999;

                    
SetEntPropVector(idProp_Data"m_angEyeAngles"floatvar);
                    
floatvar[0] /= -3.0;
                    
SetEntPropVector(idProp_Data"m_vecAngles"floatvar);
                }
                else if (
Snapstat != || TeamWithBall == (GetClientTeam(id) - 1))
                    
buttons = (Snapstat == && (id == TCenter || id == CTCenter)) ? IN_DUCK IN_ATTACK;

                
engfunc(EngFunc_RunPlayerMoveidfloatvar, (!IsUserClose && Snapstat != && !(Kicking && !Snapstat) && GameActive) ? 400.0 0.00.00.0buttons0msec);
            }

I also need to figure out what to replace "global_get(glb_frametime, v_length)" with.
Beaverboys is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 05-25-2015 , 03:35   Re: How to control fake client movement?
Reply With Quote #2

This may work with fake clients https://forums.alliedmods.net/showthread.php?t=132773
kadet.89 is offline
Send a message via Skype™ to kadet.89
Beaverboys
Member
Join Date: Aug 2012
Old 05-25-2015 , 04:56   Re: How to control fake client movement?
Reply With Quote #3

Quote:
Originally Posted by kadet.89 View Post
Could I just set the fake clients angles toward a particular entity and make them move forward?
Beaverboys is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 05-25-2015 , 05:16   Re: How to control fake client movement?
Reply With Quote #4

You can use https://sm.alliedmods.net/new-api/sd...TeleportEntity but it will not look naturally. If you want a naturall result, then you should hook and override AI with c++ extension

Last edited by kadet.89; 05-25-2015 at 05:18.
kadet.89 is offline
Send a message via Skype™ to kadet.89
Miu
Veteran Member
Join Date: Nov 2013
Old 05-25-2015 , 07:57   Re: How to control fake client movement?
Reply With Quote #5

I don't think you can set fake clients' angles, only proper bots
Miu is offline
Beaverboys
Member
Join Date: Aug 2012
Old 05-25-2015 , 21:09   Re: How to control fake client movement?
Reply With Quote #6

I just need a bot to run toward a certain player and slash them, what would be the best way to do that?
Beaverboys is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 05-25-2015 , 22:06   Re: How to control fake client movement?
Reply With Quote #7

I think you need to set the move and maybe angles vectors in onplayerruncmd, i think move should be the same as the vector youre setting in your code

Last edited by Miu; 05-25-2015 at 22:09.
Miu is offline
Beaverboys
Member
Join Date: Aug 2012
Old 05-26-2015 , 02:28   Re: How to control fake client movement?
Reply With Quote #8

Quote:
Originally Posted by Miu View Post
I think you need to set the move and maybe angles vectors in onplayerruncmd, i think move should be the same as the vector youre setting in your code
I'm not sure exactly how to do this, could you maybe provide some example code?
Beaverboys is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 05-26-2015 , 04:47   Re: How to control fake client movement?
Reply With Quote #9

if ure on tf2 use item_teamflag trick to make bot move to func_caputrezone
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 05-26-2015 , 07:13   Re: How to control fake client movement?
Reply With Quote #10

Quote:
Originally Posted by Michalplyoutube View Post
if ure on tf2 use item_teamflag trick to make bot move to func_caputrezone
Like said Michal, you can look my plugin MannVsTank I used this for force bot Giant to Capture a point.
__________________
Benoist3012 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 03:26.


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