public change_race(id,saychat){
	 #if ADVANCED_DEBUG == 1
		writeDebugInfo("change_race",id)
	#endif

	if (warcraft3==false)
		return PLUGIN_CONTINUE

	if (get_cvar_num("FT_CD")) {
		if (!WAR3_CD_installed(id)){
			client_print(id,print_chat,"%L",id,"CHEATING_DEATH_NOT_INSTALLED",g_MOD)
			return PLUGIN_CONTINUE
		}
	}

	save_xp_info(id,0)

	WAR3_chooserace(id)

	return PLUGIN_CONTINUE

}

public player_skills(id){
	#if ADVANCED_DEBUG == 1
		writeDebugInfo("player_skills",id)
	#endif

	if (warcraft3==false)
		return PLUGIN_CONTINUE
		
	if (get_cvar_num("FT_CD")) {
		if (!WAR3_CD_installed(id)){
			client_print(id,print_chat,"%L",id,"CHEATING_DEATH_NOT_INSTALLED",g_MOD)
			return PLUGIN_CONTINUE
		}
	}

	new name[32], message[2048], temp[2048]
	
	new race_name[RACE_NAME_LENGTH]
	new players[32], numberofplayers, i, j, playerid, pos, found
	new skill1[64], skill2[64], skill3[64], skill4[64]

	get_players(players, numberofplayers)

	if(FT_STEAM)
		add(message, 2047, "<body bgcolor=#000000><font color=#FFB000>")

	for(j=1;j<(NUM_RACES+1);j++){
		pos = 0
		found = 0
		temp = ""
		race_name=""
		racename(j,id,race_name,RACE_NAME_LENGTH_F)

		if(FT_STEAM)
			pos += format(temp[pos],2048-pos, "<font color='green'><b>%s</b></font><ul>",race_name)
		else
			pos += format(temp[pos],2048-pos, "^n%s",race_name)

		for (i = 0; i < numberofplayers; ++i){
			playerid=players[i]
			get_user_name(playerid,name,31)

			replace(name, 127, "<", "&lt;")
			replace(name, 127, ">", "&gt;")

			if(p_data[playerid][P_RACE] == j){
				found++

				new race_skill[4][RACE_SKILL_LENGTH]

				for(new k=0;k<4;k++){
					raceskill(p_data[playerid][0],k+1,id,race_skill[k],RACE_SKILL_LENGTH_F)
				}

				if(p_data[playerid][P_SKILL1])
					format(skill1,63,", %s %d",race_skill[0],p_data[playerid][P_SKILL1])
				if(p_data[playerid][P_SKILL2])
					format(skill2,63,", %s %d",race_skill[1],p_data[playerid][P_SKILL2])
				if(p_data[playerid][P_SKILL3])
					format(skill3,63,", %s %d",race_skill[2],p_data[playerid][P_SKILL3])
				if(p_data[playerid][P_ULTIMATE])
					format(skill4,63,", %s",race_skill[3],p_data[playerid][P_ULTIMATE])
				
				if (FT_STEAM)
					pos += format(temp[pos],2048-pos,"<li>%s - %d%s%s%s%s</li>",name,p_data[playerid][P_LEVEL],skill1,skill2,skill3,skill4)
				else
					pos += format(temp[pos],2048-pos,"/t%s - %d%s%s%s%s^n",name,p_data[playerid][P_LEVEL],skill1,skill2,skill3,skill4)
			}
		}
		if(found > 0){
			pos += format(temp[pos],2048-pos,"</ul>")

			if(strlen(message) < 2048)
				add(message, 2047, temp)
		}
	}

	new motdmessage[128]
	format(motdmessage, 127, "%L",id,"PLAYER_SKILLS","","")
	show_motd(id,message,motdmessage)

	return PLUGIN_CONTINUE
}

public cmd_Shield(id){
	#if ADVANCED_DEBUG == 1
		writeDebugInfo("cmd_Shield",id)
	#endif

	if (!WAR3_check())
		return PLUGIN_CONTINUE

	new parm[1]
	parm[0] = id
	set_task(0.1,"_cmd_Shield",TASK_SHIELD+id,parm,1)
	
	return PLUGIN_CONTINUE
}

public _cmd_Shield(parm[1]){
	new id = parm[0]

	if(!is_user_connected(id))
		return PLUGIN_CONTINUE

	new seq = entity_get_int(id,EV_INT_sequence)
	
	if(seq == 89){
		p_data_b[id][PB_SHIELD] = true
	}
	else if(seq == 94){
		p_data_b[id][PB_SHIELD] = true
	}
	else if(seq == 98){
		p_data_b[id][PB_SHIELD] = true
	}
	else{
		p_data_b[id][PB_SHIELD] = false
	}

	return PLUGIN_CONTINUE
}

public cmd_Drop(id) { 
	#if ADVANCED_DEBUG == 1
		writeDebugInfo("cmd_Drop",id)
	#endif

	if (!WAR3_check())
		return PLUGIN_CONTINUE

	cmd_Shield(id)
	
	return PLUGIN_CONTINUE 
}

public cmd_Teamselect(id,key) {
	#if ADVANCED_DEBUG == 1
		writeDebugInfo("cmd_Teamselect",id)
	#endif

	// key+1 is the team they choose
	p_data_b[id][PB_CHANGINGTEAM] = true
}

public cmd_Jointeam(id){
	#if ADVANCED_DEBUG == 1
		writeDebugInfo("cmd_Jointeam",id)
	#endif

	//new arg[2]
	//read_argv(1,arg,1)	//This is the command they pressed
	p_data_b[id][PB_CHANGINGTEAM] = true
}

public cmd_Level(id){
	#if ADVANCED_DEBUG == 1
		writeDebugInfo("cmd_Level",id)
	#endif

	displaylevel(id,0)
}
