Raised This Month: $ Target: $400
 0% 

teams & time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-05-2010 , 21:22   Re: teams & time
Reply With Quote #1

zombieplague never learned scripting. He learned how to cut code and paste it.
That's why he doesn't know the difference between 3 and "3".
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
zombieplague
Veteran Member
Join Date: Apr 2009
Old 12-05-2010 , 23:11   Re: teams & time
Reply With Quote #2

Quote:
Originally Posted by fysiks View Post
What was the value of the cvar before you removed it? (Hint: it was a word)
i really don't know man


PHP Code:
static team]
 
Force_Team_Joinidmenu_msgid], team 
doesn't work.

i really want to learn scripting very much. but i just don't know where to start. i am very confuse. i look through the tutorial still don't know much of the code means. please someone guide me.

this is the original code:

PHP Code:
/* AMX Mod X
*   Auto Join on Connect
*
* (c) Copyright 2007 by VEN
*
* This file is provided as is (no warranties)
*
*     DESCRIPTION
*       Plugin allow to players automatically join team/team&class on connect.
*
*     CVARS
*       ajc_team (0: OFF, N: team index, 5: auto team, default: 5) - controls team join
*       ajc_class (0: OFF, N: class index, 5: auto class, default: 5) - controls class join
*       ajc_imm (0: OFF, 1: ON, default: 1) - don't affect on immuned players (ON/OFF)
*
*     CREDITS
*       Major__ - inquiry
*/

#include <amxmodx>

#define PLUGIN_NAME "Auto Join on Connect"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "VEN"

#define IMMUNITY_ACCESS_LEVEL ADMIN_IMMUNITY

#define AUTO_TEAM_JOIN_DELAY 0.1

#define TEAM_SELECT_VGUI_MENU_ID 2

new g_pcvar_team
new g_pcvar_class
new g_pcvar_imm

public plugin_init() {
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)

    
register_message(get_user_msgid("ShowMenu"), "message_show_menu")
    
register_message(get_user_msgid("VGUIMenu"), "message_vgui_menu")

    
g_pcvar_team register_cvar("ajc_team""5")
    
g_pcvar_class register_cvar("ajc_class""5")
    
g_pcvar_imm register_cvar("ajc_imm""1")
}

public 
message_show_menu(msgiddestid) {
    if (!
should_autojoin(id))
        return 
PLUGIN_CONTINUE

    
static team_select[] = "#Team_Select"
    
static menu_text_code[sizeof team_select]
    
get_msg_arg_string(4menu_text_codesizeof menu_text_code 1)
    if (!
equal(menu_text_codeteam_select))
        return 
PLUGIN_CONTINUE

    set_force_team_join_task
(idmsgid)

    return 
PLUGIN_HANDLED
}

public 
message_vgui_menu(msgiddestid) {
    if (
get_msg_arg_int(1) != TEAM_SELECT_VGUI_MENU_ID || !should_autojoin(id))
        return 
PLUGIN_CONTINUE

    set_force_team_join_task
(idmsgid)

    return 
PLUGIN_HANDLED
}

bool:should_autojoin(id) {
    return (
get_pcvar_num(g_pcvar_team) && !get_user_team(id) && !task_exists(id) && (!get_pcvar_num(g_pcvar_imm) || !(get_user_flags(id) & IMMUNITY_ACCESS_LEVEL)))
}

set_force_team_join_task(idmenu_msgid) {
    static 
param_menu_msgid[2]
    
param_menu_msgid[0] = menu_msgid
    set_task
(AUTO_TEAM_JOIN_DELAY"task_force_team_join"idparam_menu_msgidsizeof param_menu_msgid)
}

public 
task_force_team_join(menu_msgid[], id) {
    if (
get_user_team(id))
        return

    static 
team[2], class[2]
    
get_pcvar_string(g_pcvar_teamteamsizeof team 1)
    
get_pcvar_string(g_pcvar_class, class, sizeof class - 1)
    
force_team_join(idmenu_msgid[0], team, class)
}

stock force_team_join(idmenu_msgid/* const */ team[] = "5"/* const */ class[] = "0") {
    static 
jointeam[] = "jointeam"
    
if (class[0] == '0') {
        
engclient_cmd(idjointeamteam)
        return
    }

    static 
msg_blockjoinclass[] = "joinclass"
    
msg_block get_msg_block(menu_msgid)
    
set_msg_block(menu_msgidBLOCK_SET)
    
engclient_cmd(idjointeamteam)
    
engclient_cmd(idjoinclass, class)
    
set_msg_block(menu_msgidmsg_block)


Last edited by zombieplague; 12-05-2010 at 23:20.
zombieplague is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-05-2010 , 23:19   Re: teams & time
Reply With Quote #3

Quote:
Originally Posted by zombieplague View Post
is team right ?
How the hell would I know? I don't know anything about the plugin you got it from.
__________________
fysiks is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 12-05-2010 , 12:32   Re: teams & time
Reply With Quote #4

Lesson 1 of programming is about data types
Did u bunk off to go smoke or something?
__________________
minimiller is offline
Send a message via MSN to minimiller
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 11:20.


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