AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with Bot (https://forums.alliedmods.net/showthread.php?t=84331)

rectos 01-24-2009 13:54

Problem with Bot
 
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.

Dores 01-24-2009 14:17

Re: Problem with Bot
 
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.

Exolent[jNr] 01-24-2009 18:20

Re: Problem with Bot
 
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.


All times are GMT -4. The time now is 01:44.

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