Half-Life и Adrenaline Gamer форум http://aghl.ru/forum/ |
|
if(equal(g_mod_iTeam, LTS, TDM )){ http://aghl.ru/forum/viewtopic.php?f=28&t=2157 |
Страница 1 из 1 |
Автор: | abdobiskra [ 15 май 2015, 22:43 ] |
Заголовок сообщения: | if(equal(g_mod_iTeam, LTS, TDM )){ |
hello ! I want to define this plugin on mod AG (TDM And LTS ) TeamScore but idk how to make !! this code test by me ! but not worked ! Код: #include <amxmodx> |
Автор: | Lev [ 16 май 2015, 00:33 ] |
Заголовок сообщения: | Re: if(equal(g_mod_iTeam, LTS, TDM )){ |
Код: if(equali(g_mod_iTeam, LTS) || equali(g_mod_iTeam, TDM)){ |
Автор: | abdobiskra [ 16 май 2015, 01:29 ] |
Заголовок сообщения: | Re: if(equal(g_mod_iTeam, LTS, TDM )){ |
Код: [ 25] HL Teams Score By kill 2.4 Kuma & D-AIRY lol.amxx runningnot work !! hud score does not appear ! I'm not sure of the code plugin ! #include <amxmodx> #include <amxmisc> #include <dhudmessage> #include <hl> #include <hamsandwich> #include <fun> #define VERSION "2.4" #define TDM "tdm" #define LTS "lts" #pragma semicolon 1 new pCvar_gamemode; new MaxPlayers; new ScoreRed = 0; new ScoreBlue = 0; new gMsg_TeamScore; new g_mod_iTeam[33]; new g_iPlayerScore[33]; enum { TEAM_NONE = 0, TEAM_BLUE, TEAM_RED, TEAM_SPEC } public plugin_init() { register_plugin("HL Teams Score By killing", VERSION, "Kuma & D-AIRY"); RegisterHam(Ham_Spawn, "player", "player_spawn", 1); register_event("DeathMsg", "player_killed", "a"); gMsg_TeamScore = get_user_msgid("TeamScore"); register_message(gMsg_TeamScore, "msg_teamScore"); set_task(1.0, "score_round", _, _, _, "b"); MaxPlayers = get_maxplayers(); pCvar_gamemode = get_cvar_pointer("sv_ag_gamemode"); get_pcvar_string(pCvar_gamemode, g_mod_iTeam, charsmax(g_mod_iTeam)); } public client_infochanged(id) { new tid = get_user_team(id); switch (tid) { case TEAM_BLUE: if (g_mod_iTeam[id] != TEAM_BLUE) { if (g_mod_iTeam[id] == TEAM_RED) { ScoreRed -= g_iPlayerScore[id]; } g_mod_iTeam[id] = TEAM_BLUE; ScoreBlue += g_iPlayerScore[id]; } case TEAM_RED: if (g_mod_iTeam[id] != TEAM_RED) { if (g_mod_iTeam[id] == TEAM_BLUE) { ScoreBlue -= g_iPlayerScore[id]; } g_mod_iTeam[id] = TEAM_RED; ScoreRed += g_iPlayerScore[id]; } case TEAM_NONE: { if (g_mod_iTeam[id] == TEAM_BLUE) { ScoreBlue -= g_iPlayerScore[id]; } if (g_mod_iTeam[id] == TEAM_BLUE) { ScoreBlue -= g_iPlayerScore[id]; } } default: return; } } public client_disconnect(id) { if (g_mod_iTeam[id] == TEAM_BLUE) { server_print("Disconnected. ScoreBlue -= %d\n", g_iPlayerScore[id]); ScoreBlue -= g_iPlayerScore[id]; } if (g_mod_iTeam[id] == TEAM_RED) { server_print("Disconnected. ScoreRed -= %d\n", g_iPlayerScore[id]); ScoreRed -= g_iPlayerScore[id]; } g_iPlayerScore[id] = 0; } public client_putinserver(id) { g_iPlayerScore[id] = 0; } public player_killed() { new iKiller = read_data(1); new id = read_data(2); new iAdd = 1; //new iGift = 5; if (id == iKiller || !(1 <= iKiller <= MaxPlayers)) { if (hl_get_user_team(id) == TEAM_BLUE) { ScoreBlue -= iAdd; g_iPlayerScore[id] -= iAdd; } if (hl_get_user_team(id) == TEAM_RED) { ScoreRed -= iAdd; g_iPlayerScore[id] -= iAdd; } } else if (1 <= iKiller <= MaxPlayers) { new tid = hl_get_user_team(iKiller); switch (tid) { case 1: g_mod_iTeam[iKiller] = TEAM_BLUE; case 2: g_mod_iTeam[iKiller] = TEAM_RED; default: return; } if (hl_get_user_team(id) == tid) { if (tid == TEAM_BLUE) { ScoreBlue -= iAdd; g_iPlayerScore[id] -= iAdd; } if (tid == TEAM_RED) { ScoreRed -= iAdd; g_iPlayerScore[id] -= iAdd; } } else { if (tid == TEAM_BLUE) { ScoreBlue += iAdd; g_iPlayerScore[iKiller] += iAdd; } if (tid == TEAM_RED) { ScoreRed += iAdd; g_iPlayerScore[iKiller] += iAdd; } } } } public msg_teamScore() { static szTeam[32]; get_msg_arg_string(1, szTeam, 1); switch (szTeam[0]) { case 1: set_msg_arg_int(2, ARG_SHORT, ScoreBlue); case 2: set_msg_arg_int(2, ARG_SHORT, ScoreRed); } } public on_change_level() { new szMsg[48]; new szFormat[192]; formatex(szFormat, charsmax(szFormat), "Blue %d : %d Red %s", ScoreBlue, ScoreRed, szMsg); client_print(0, print_center, szFormat); log_message("Blue %d : %d Red", ScoreBlue, ScoreRed); } public score_round() { if(equali(g_mod_iTeam, LTS) || equali(g_mod_iTeam, TDM)){ set_dhudmessage(0, 70, 200, -1.0, 0.0, 0, 0.5, 1.1, 0.08, 1.1, true); show_dhudmessage(0, "Blue :%d| ", ScoreBlue); set_dhudmessage(200, 0, 0, -1.0, 0.0, 0, 0.5, 2.0, 0.08, 2.0, true); show_dhudmessage(0, " |%d: Red", ScoreRed); } } |
Страница 1 из 1 | Часовой пояс: UTC + 5 часов [ Летнее время ] |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |