AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   A tiny question# (https://forums.alliedmods.net/showthread.php?t=251261)

amnezia 11-09-2014 01:44

A tiny question#
 
well guys, i'm using sylvesters Autoteam join plugin saw it somewhere in a post.

Code:
Code:

#include <amxmodx>
#include <hamsandwich>

#define TID_HIDE_MENU 5323568

new bool:g_autojoin_team[33]
new
bool:g_autojoin_class[33]
new
g_vgui_menus[33][5]

public
plugin_init(){
   
register_plugin("autojoin", "1.0", "Sylwester")
   
register_message(get_user_msgid("ShowMenu"), "message_show_menu")
}


public
client_connect(id){
   
get_user_info(id, "_vgui_menus", g_vgui_menus[id], 4)
   
set_user_info(id, "_vgui_menus", "0")
   
g_autojoin_team[id] = true
}


public
message_show_menu(msgid, dest, id) {
    new
tmp[32]
   
get_msg_arg_string(4, tmp, 31)
    if(
contain(tmp, "#Team_Select")==0){
        if(!
g_autojoin_team[id])
            return
PLUGIN_CONTINUE
        g_autojoin_team
[id] = false
        g_autojoin_class
[id] = true
        client_cmd
(id, "jointeam 5")
        return
PLUGIN_HANDLED
   
}
    if(
contain(tmp, "#CT_Select")==0 || contain(tmp, "#Terrorist_Select")==0){
        if(!
g_autojoin_class[id])
            return
PLUGIN_CONTINUE
       
if(!task_exists(TID_HIDE_MENU+id))
           
set_task(0.1, "hide_menu", TID_HIDE_MENU+id)
       
g_autojoin_class[id] = false
        client_cmd
(id, "joinclass 5")
       
set_user_info(id, "_vgui_menus", g_vgui_menus[id])
        return
PLUGIN_HANDLED
   
}
    return
PLUGIN_CONTINUE
}

public
hide_menu(tid){
    new
id = tid-TID_HIDE_MENU
    show_menu
(id, 0, "^n", 1)
    if(!
is_user_alive(id))
       
ExecuteHam(Ham_CS_RoundRespawn, id)

it works perfectly fine, but 1 little problem im running a zombie plague server.
which means when they connect they connect as a human..
how can i make it that whoever joins the server they will be a zombie.
untill the next round?


All times are GMT -4. The time now is 17:32.

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