Raised This Month: $ Target: $400
 0% 

[SOLVED] Help giving fakeclient a weapon


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-24-2009 , 11:53   [SOLVED] Help giving fakeclient a weapon
Reply With Quote #1

Is this possible? I tried fm_give_item but no dice.

Here is my bot creation code if it helps:

I tried calling fm_give_item( g_BotID , "weapon_deagle" ) after the AddBot call in my code.

PHP Code:
public AddBot()
{        
    new 
szTeam[2]
    new 
szName[6]

    
formatszName "xyz%2d" random_num(10,99) )
    
g_BotID engfunc(EngFunc_CreateFakeClientszName )
    
    if ( !
g_BotID 
        return 
PLUGIN_HANDLED
    
    engfunc
EngFunc_FreeEntPrivateDatag_BotID )

    static 
szRejectReason[128]
    
dllfuncDLLFunc_ClientConnectg_BotID szName"127.0.0.1"szRejectReason )
    
    
dllfuncDLLFunc_ClientPutInServerg_BotID)
    
set_pevg_BotIDpev_spawnflagspev(g_BotIDpev_spawnflags) | FL_FAKECLIENT )
    
set_pevg_BotIDpev_flagspev(g_BotID,pev_flags) | FL_FAKECLIENT )

    
//Bot created, assign to appropriate team. 
    
formatszTeam "%d" , (fm_cs_get_user_teamg_PlayerToWatch ) == CS_TEAM_T) ? CS_TEAM_CT CS_TEAM_T 
    
engclient_cmdg_BotID"jointeam"szTeam )
    
engclient_cmdg_BotID"joinclass""1" )
    
    
//Spawn bot
    
fm_user_spawng_BotID )
    
    
//Make bot invisible
    
fm_set_renderingg_BotIDkRenderFxNone000kRenderTransAlpha)
    
    
//Make our bot appear as a spectator on scoreboard
    
message_beginMSG_ALLget_user_msgid("TeamInfo") , _)
    
write_byteg_BotID )
    
write_string"SPECTATOR" )
    
message_end()
    
    
EnableHamForwardg_Ham_TakeDamage )

    return 
PLUGIN_HANDLED

__________________

Last edited by Bugsy; 02-24-2009 at 22:54.
Bugsy is offline
 


Thread Tools
Display Modes

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 16:52.


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