Raised This Month: $ Target: $400
 0% 

create fake player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-02-2009 , 21:48   Re: create fake player
Reply With Quote #2

Quote:
Originally Posted by whosyourdaddy View Post
how can i spawn like a fake player behind me, like it will look like a normal player where if u run into it u will stop, it can take damage, and has a gun in its hand
Below is from my Aimbot Detection plugin (link in sig).

PHP Code:
//not sure if you will need all of these
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>

new g_BotID

public AddBot()
{        
    new 
szTeam[2]
    new 
szName[33]
    
format(szName 32 "FakePlayer"  )
    
    
g_BotID engfunc(EngFunc_CreateFakeClientszName)
    
    if(!
g_BotID
        return 
PLUGIN_HANDLED
    
    engfunc
(EngFunc_FreeEntPrivateDatag_BotID )

    static 
szRejectReason[128]
    
dllfunc(DLLFunc_ClientConnectg_BotID szName"127.0.0.1"szRejectReason)
    
    if( !
is_user_connected(g_BotID) ) 
        return 
PLUGIN_HANDLED

    dllfunc
(DLLFunc_ClientPutInServerg_BotID)
    
set_pev(g_BotID,pev_spawnflagspev(g_BotIDpev_spawnflags) | FL_FAKECLIENT)
    
set_pev(g_BotID,pev_flagspev(g_BotID,pev_flags) | FL_FAKECLIENT)

    
//Set the bot to a team
    
formatszTeam "%d" CS_TEAM_CT
    
engclient_cmd(g_BotID"jointeam"szTeam)
    
engclient_cmd(g_BotID"joinclass""1")
    
    
//Spawn bot
    
fm_user_spawn(g_BotID)
    
    
//Make our bot appear as a spectator on scoreboard
    
message_begin(MSG_ALLget_user_msgid("TeamInfo") , _0)
    
write_byte(g_BotID)
    
write_string("SPECTATOR")
    
message_end()
    
    return 
PLUGIN_HANDLED

There are also forwards in the source to detect when the player gets shot\killed.

PHP Code:
    RegisterHam(Ham_Killed,     "player",  "func_Ham_Killed_Player")
    
RegisterHam(Ham_TakeDamage"player" "func_Ham_TakeDamage"
To get it placed behind you, you will need to use get\set origin along with some coordinate manipulation.
__________________

Last edited by Bugsy; 01-02-2009 at 22:07.
Bugsy 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 09:10.


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