Raised This Month: $ Target: $400
 0% 

Getting Bot you just spawned.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-27-2013 , 16:25   Getting Bot you just spawned.
Reply With Quote #1

Hello everybody,

I'd like to spawn a Pod-Bot and setting it's origin to somewhere else.
I'm using
PHP Code:
server_cmd("pb add %d %d %d %d"skillpersonalityteammodel
to spawn it, but how do I get the bot Id to use set_user_origin?
This would only work for the first bot :
PHP Code:
static id_bot
    
for( new 1<= g_MaxPlayersi++) 
    {
        if(
is_user_bot(i) && is_user_alive(i))
        {
            
id_bot i
        
}
    } 
__________________

Last edited by Kia; 05-27-2013 at 16:26.
Kia is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 05-27-2013 , 17:05   Re: Getting Bot you just spawned.
Reply With Quote #2

save the bot id-s to a global variable and after spawning a bot loop trough players and find a bot thats not in the variable?
jimaway is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-27-2013 , 17:20   Re: Getting Bot you just spawned.
Reply With Quote #3

Got this now
PHP Code:
public ham_playerspawn(id)
{
    if(
is_user_bot(id) && !g_bIsSpawnedBot[id])
    {
        
set_user_origin(idg_iNextSpawnPos)
        
g_bIsSpawnedBot[id] = true
    
}

__________________
Kia 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 16:21.


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