Quote:
Originally Posted by Stressful
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 !")
}
}
}
__________________