View Single Post
SergiCruz
Senior Member
Join Date: Mar 2012
Location: Andalucía, España
Old 05-10-2015 , 15:54   Re: [HELP]Make bot choose random human classes zp4.3fix5a
Reply With Quote #2

Try adding this to your code. It should work with any kind of bots.
PHP Code:
#define MAX_HUMAN_CLASS 8 // Set to the number of classes you have
#define TASK_SET_CLASS 19825
#define ID_SET_CLASS (taskid - TASK_SET_CLASS)

public client_putinserver(id)
    if (
is_user_bot(id))
    {
        
remove_task(id+TASK_SET_CLASS)
        
set_task(1.0"SetBotRandomClass"id+TASK_SET_CLASS)
    }

public 
client_disconnect(id)
    
remove_task(id+TASK_SET_CLASS)

public 
SetBotRandomClass(taskid)
    
g_player_class[ID_SET_CLASS] = random_num(1MAX_HUMAN_CLASS
__________________
PodBot waypointer. Feel free to ask for waypoints for zm_ maps.
SergiCruz is offline
Send a message via MSN to SergiCruz