Raised This Month: $ Target: $400
 0% 

Problem with Bot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rectos
New Member
Join Date: Jan 2009
Old 01-24-2009 , 13:54   Problem with Bot
Reply With Quote #1

Hi all.
PHP Code:
// Bot() creates a Bot, puts him in spectators
public Bot() {
    new 
botid
    botid 
find_player("ali"bot_name)
    if(!
botid) {
        
botid engfunc(EngFunc_CreateFakeClientbot_name)
        new 
ptr[128]
        
dllfunc(DLLFunc_ClientConnectbotidbot_name"127.0.0.1"ptr )
        
dllfunc(DLLFunc_ClientPutInServerbotid)
        
cs_set_user_team(botidCS_TEAM_SPECTATOR)
    }
    return 
botid
}
...
//this should kick "username", but...
    
Bot()
    
client_cmd(id"amx_kick %s"username// id = id of Bot, got with get_user_userid 
... i got this, and nothing happens!

L 01/24/2009 - 19:48:47: Invalid player id 18
L 01/24/2009 - 19:48:47: [AMXX] Run time error 10 (plugin "SupraBan.amxx") (native "client_cmd") - debug not enabled!


I want to, let's say, "port" the command amx_kick through the bot, so that it seems like the bot is kicking someone. Anyone help me pls?

Additional info: the bot IS in spect.
rectos is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 01-24-2009 , 14:17   Re: Problem with Bot
Reply With Quote #2

I don't think you can run/execute client commands from bots.

Please correct me anyone who knows that I'm wrong, but please don't -karma me for my stupidity dammit.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-24-2009 , 18:20   Re: Problem with Bot
Reply With Quote #3

Dores is correct. Bots cannot be used with client_cmd().

If you want the bot to kick the player, then just rewrite the amx_kick code from admincmd.sma and make it seem like the bot kicked the player.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 01:44.


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