Raised This Month: $ Target: $400
 0% 

cs_get_user_team , case 1 , 2 & 3??


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Stressful
Senior Member
Join Date: Feb 2011
Old 06-21-2011 , 22:23   Re: cs_get_user_team , case 1 , 2 & 3??
Reply With Quote #1

ok Thanks , Anyway how do you make it like if the user connect , the team is T , then the msg will appear?
Stressful is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-21-2011 , 22:49   Re: cs_get_user_team , case 1 , 2 & 3??
Reply With Quote #2

It depends on what your goal is. Easiest would be to hook spawn and do it then, IMO.
__________________
fysiks is online now
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 06-22-2011 , 04:23   Re: cs_get_user_team , case 1 , 2 & 3??
Reply With Quote #3

Quote:
Originally Posted by Stressful View Post
ok Thanks , Anyway how do you make it like if the user connect , the team is T , then the msg will appear?
When user connects he has no team, you need to hook spawn or teaminfo and set a variable for that player indicating that's the first thime he spawned/joined team.

You already have a spawn example, I'll show you a join team example:

Code:
#include <amxmodx>

new bool:g_bJoined[33]

public plugin_init()
{
    register_event("TeamInfo", "player_joinTeam", "a")
}

public client_disconnect(id)
{
    g_bJoined[id] = false
}

public player_joinTeam()
{
    new id = read_data(1)

    new szTeam[2]

    read_data(2, szTeam, charsmax(szTeam))

    /* this triggers when player joins the game aswell, having team UNASSIGNED... OR if player already joined once, skip. */

    if(szTeam[0] == 'U' || g_bJoined[id])
        return

    g_bJoined[id] = true

    switch(szTeam[0])
    {
        case 'T':
        {
            client_print(id, print_chat, "Welcome to this server, terrorist !")
        }

        case 'C':
        {
            client_print(id, print_chat, "Welcome to this server, counter-terrorist !")
        }

        case 'S':
        {
            client_print(id, print_chat, "Welcome to this server, spectator !")
        }
    }
}
__________________

Last edited by Hunter-Digital; 06-22-2011 at 04:34. Reason: fixed something in code xD
Hunter-Digital 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 23:30.


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