|
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
|

08-30-2013
, 07:16
Need Help in Function Clarification [Auto PUG]
|
#1
|
The problem i am getting is
PHP Code:
ShowSyncHudMsg(0, g_MsgSync2, "%L", LANG_PLAYER, "CAPTAINS_DISCONNECTED_HUD")
This call gets executed even when player chosen as Captain is connected.What i am not able to undertand is what variable toapprove stores ? and how this function is working.8/10 Times the function executes and shows captain disconnected and random teams are set.Can anyone help me out understanding or solving the issue ?
PHP Code:
public TeamsInfo() { //log_amx("TeamsInfo stage 1") if (g_bCpt) { //log_amx("TeamsInfo stage 2") new nameCT[70], nameT[70] new infoT[500] new infoCT[500] new players[32], pnum, tempid; new toapprove get_players(players, pnum, "ch") get_user_name(gCptT, nameT, 69) get_user_name(gCptCT, nameCT, 69) formatex(infoT, 499, "%L^n-------------^n%L^n^n", LANG_PLAYER, ( get_pcvar_num(cvar_TeamTag) ? "TEAM_A" : "TERRORISTS" ), LANG_PLAYER, "TEAM_INFO_CAPTAINS", nameT) formatex(infoCT, 499, "%L^n-------------^n%L^n^n", LANG_PLAYER, ( get_pcvar_num(cvar_TeamTag) ? "TEAM_B" : "COUNTER_TERRORISTS" ), LANG_PLAYER, "TEAM_INFO_CAPTAINS", nameCT) log_amx("TeamsInfo stage 3") for (new i ; i < pnum ; i++) { tempid = players[i] if ((cs_get_user_team(tempid) == CS_TEAM_T) && (tempid != gCptT)) { new nameofp[70] get_user_name(tempid, nameofp, 69) add(infoT, 499, nameofp) add(infoT, 499, "^n") } else if ((cs_get_user_team(tempid) == CS_TEAM_CT) && (tempid != gCptCT)) { new nameofCTp[70] get_user_name(tempid, nameofCTp, 69) add(infoCT, 499, nameofCTp) add(infoCT, 499, "^n") } if ((cs_get_user_team(tempid) == CS_TEAM_T) && (tempid == gCptT)) toapprove++ else if ((cs_get_user_team(tempid) == CS_TEAM_CT) && (tempid == gCptCT)) { toapprove++ } } if (toapprove != 2) { set_hudmessage(255, 0, 0, 0.40, 0.32, 0, 6.0, 12.0) ShowSyncHudMsg(0, g_MsgSync2, "%L", LANG_PLAYER, "CAPTAINS_DISCONNECTED_HUD") new taskId = scanForTaskID() set_task(5.0, "RandomTeams", taskId) return PLUGIN_HANDLED } set_hudmessage(27, 162, 229, 0.28, 0.32, 0, 6.0, 1.0) ShowSyncHudMsg(0, g_MsgSync8, infoT) log_amx("TeamsInfo stage 4") set_hudmessage(27, 162, 229, 0.58, 0.32, 0, 6.0, 1.0) ShowSyncHudMsg(0, g_MsgSync2, infoCT) new taskId = scanForTaskID() set_task(1.0, "TeamsInfo", taskId) } else { set_hudmessage(0, 255, 0, 0.40, 0.32, 0, 6.0, 12.0) ShowSyncHudMsg(0, g_MsgSync2, "%L", LANG_PLAYER, "TEAMS_ARE_SET_HUD") return PLUGIN_CONTINUE } return PLUGIN_CONTINUE }
__________________
|
|