Hej, potrzebuję dodać/przerobić bf2 mod by działał plugin na modele za zdobyte medale pod koniec mapy.
Chodzi mi o "bf2_get_user_medals" i dodanie w odpowiednie miejsca...
Skrawek kody z pluginu na modele:
new bronze = bf2_get_user_medals(id, 1); new silver = bf2_get_user_medals(id, 2); new gold = bf2_get_user_medals(id, 3); new medals = bronze + silver + gold;
Nie wiem czy to w pluginie medale_sql czy do bf2rank albo obydwu więc zamieszczam oba poniżej:
medale_sql
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <sqlx> #include <colorchat> new const nazwy[][] = { "Zlote", "Srebrne", "Brazowe" } new Handle: g_SqlTuple; new gQuery[512]; enum _:staty { KILL, GOLD, SILVER, BRONZE, ID } enum _:cvary { HOST, PASS, USER, DBNAME, MIMPLR } new gStaty[staty][33]; new gZdobyl[staty][33]; new gCvary[cvary]; new gNick[33][33]; new gData[2048], len, gLast; public plugin_end() SQL_FreeHandle(g_SqlTuple); public SqlInit() { new temp[staty][64]; get_pcvar_string(gCvary[HOST], temp[HOST], 63); get_pcvar_string(gCvary[PASS], temp[PASS], 63); get_pcvar_string(gCvary[USER], temp[USER], 63); get_pcvar_string(gCvary[DBNAME], temp[DBNAME], 63); g_SqlTuple = SQL_MakeDbTuple(temp[HOST], temp[USER], temp[PASS], temp[DBNAME]); if(g_SqlTuple == Empty_Handle) set_fail_state("Nie mozna utworzyc uchwytu do polaczenia."); new iErr, szError[32]; new Handle:link = SQL_Connect(g_SqlTuple, iErr, szError, 31); if(link == Empty_Handle){ log_amx("Error (%d): %s", iErr, szError); set_fail_state("Brak polaczenia z baza danych"); } new Handle:query; query = SQL_PrepareQuery(link, "CREATE TABLE IF NOT EXISTS `medale` ( \ `id` int(5) NOT NULL auto_increment, \ `nick` varchar(36) NOT NULL, \ `kill` INT(11) NOT NULL DEFAULT 0, \ `gold` INT(11) NOT NULL DEFAULT 0, \ `silver` INT(11) NOT NULL DEFAULT 0, \ `bronze` INT(11) NOT NULL DEFAULT 0, \ `suma` INT(11) NOT NULL DEFAULT 0, \ PRIMARY KEY (`id`) \ )"); SQL_Execute(query); SQL_FreeHandle(query); WczytajMedale(); } public plugin_init() { register_plugin("Medale SQL Ver", "1.2", "byCZEK"); register_event("DeathMsg", "event_death", "a"); register_message(SVC_INTERMISSION, "MsgIntermission"); register_clcmd("say /medale", "MenuMedali"); gCvary[HOST] = register_cvar("medale_hostname", "x"); gCvary[PASS] = register_cvar("medale_password", "x"); gCvary[USER] = register_cvar("medale_username", "x"); gCvary[DBNAME] = register_cvar("medale_dbname", "x"); gCvary[MIMPLR] = register_cvar("medale_minp", "1"); set_task(0.1, "SqlInit"); } public client_putinserver(id) { Wyczysc(id); get_user_name(id, gNick[id], 32); formatex(gQuery, charsmax(gQuery), "SELECT * FROM `medale` WHERE `nick` = ^"%s^" ORDER BY `id` LIMIT 1", gNick[id]); new ids[1]; ids[0] = id; SQL_ThreadQuery(g_SqlTuple, "handleLoadData", gQuery, ids, 1); } public client_disconnect(id) { new suma = (gStaty[GOLD][id]+gZdobyl[GOLD][id])*3 + (gStaty[SILVER][id]+gZdobyl[SILVER][id])*2 + gStaty[BRONZE][id]+gZdobyl[BRONZE][id]; formatex(gQuery, charsmax(gQuery), "UPDATE `medale` SET `kill` = `kill` + %d, `gold` = `gold` + %d, `silver` = `silver` + %d, `bronze` = `bronze` + %d, `suma` = %d WHERE `id` = %d", gZdobyl[KILL][id], gZdobyl[GOLD][id], gZdobyl[SILVER][id], gZdobyl[BRONZE][id], suma, gStaty[ID][id]); SQL_ThreadQuery(g_SqlTuple, "handleStandard", gQuery); Wyczysc(id); } public Wyczysc(id) { for(new i = 0; i < staty; i++) { gStaty[i][id] = 0; gZdobyl[i][id] = 0; } } public WczytajMedale() { gLast = get_systime(); SQL_ThreadQuery(g_SqlTuple, "handeLoadRank", "SELECT * FROM `medale` ORDER BY `suma` DESC LIMIT 15"); } public handleLoadData(failstate, Handle:query, error[], errnum, data[], size){ if(failstate != TQUERY_SUCCESS){ log_amx("SQL Load error: %s",error); return; } new id = data[0]; if(!is_user_connected(id)) return; if(SQL_MoreResults(query)) { gStaty[ID][id] = SQL_ReadResult(query, 0); gStaty[KILL][id] = SQL_ReadResult(query, 2); gStaty[GOLD][id] = SQL_ReadResult(query, 3); gStaty[SILVER][id] = SQL_ReadResult(query, 4); gStaty[BRONZE][id] = SQL_ReadResult(query, 5); } else { formatex(gQuery, charsmax(gQuery), "INSERT INTO `medale` (`nick`) VALUES (^"%s^")", gNick[id]); SQL_ThreadQuery(g_SqlTuple, "handleStandard", gQuery); } } public handleStandard(failstate, Handle:query, error[], errnum, data[], size) { if(failstate != TQUERY_SUCCESS) { log_amx("SQL Insert error: %s",error); return; } } public event_death() { new kid = read_data(1); new vid = read_data(2); if(kid != vid && get_user_team(kid) != get_user_team(vid)) gZdobyl[KILL][kid]++; } public MenuMedali(id) { new m = menu_create("Medale", "MenuMedali_"); menu_additem(m, "Twoje medale"); menu_additem(m, "Ranking medali"); menu_setprop(m, MPROP_EXIT, MEXIT_ALL); menu_display(id, m); } public MenuMedali_(id, m, i) { if(i == MENU_EXIT) { menu_destroy(m); return PLUGIN_CONTINUE; } switch(i) { case 0: { TwojeMedale(id); } case 1: { RankingMedali(id); } } return PLUGIN_CONTINUE; } public TwojeMedale(id) { new m = menu_create("Twoje medale", "TwojeMedale_"); new t[128]; for(new i = 1; i < staty - 1; i++) { formatex(t, charsmax(t), "%s: \r%d", nazwy[i-1], gStaty[i][id]); menu_additem(m, t); } menu_display(id, m); } public TwojeMedale_(id, m) menu_destroy(m); public RankingMedali(id) { if(get_systime() - gLast > 20) { WczytajMedale(); } show_motd(id, gData, "Top15 Medali"); } public handeLoadRank(failstate, Handle:query, error[], errnum, data[], size) { if(failstate != TQUERY_SUCCESS) { log_amx("SQL Load error: %s",error); return; } new nick[33], medale[4], i = 0; len = formatex(gData, charsmax(gData), "<body bgcolor=#000000><font color=#FFB000><pre>%2s %-22.22s %6s %8s %8s %5s^n", "#", "Nick", nazwy[0], nazwy[1], nazwy[2], "Suma"); while(SQL_MoreResults(query)) { i++; SQL_ReadResult(query, 1, nick, 32); medale[0] = SQL_ReadResult(query, 3); medale[1] = SQL_ReadResult(query, 4); medale[2] = SQL_ReadResult(query, 5); medale[3] = medale[0] + medale[1] + medale[2]; replace_all(nick, charsmax(nick), "<", "["); replace_all(nick, charsmax(nick), ">", "]"); len += formatex(gData[len], charsmax(gData) - len, "%2d %-22.22s %6d %8d %8d %5d^n", i, nick, medale[0], medale[1], medale[2], medale[3]); SQL_NextRow(query); } } public MsgIntermission() { new name[33], players[32], best[3], num, id, fragi; get_players(players, num, "h"); if(num < get_pcvar_num(gCvary[MIMPLR])) return PLUGIN_CONTINUE; new const typ[][] = { "Zloty", "Srebrny", "Brazowy" } for(new i = 0; i < 3; i++) { for(new j = 0; j < num; j++) { id = players[j]; if(!is_user_connected(id) || best[0] == id || best[1] == id) continue; if(get_user_frags(id) > fragi) { fragi = get_user_frags(id); best[i] = id; } } fragi = 0; if(best[i]) { gZdobyl[1+i][best[i]]++; get_user_name(best[i], name, 32); ColorChat(0, TEAM_COLOR, "[Medale] %s^x03 -^x04 %s Medal -^x04 %i^x03 Miejsce", name, typ[i], i+1); } } return PLUGIN_CONTINUE; }
bf2rank
// Zapis n SQL, odkomentuj aby włączyć #define SQL // Flaga uprawnien do dawania odznak oraz restartowania ranku #define ADMIN_UPRAWNIENIA ADMIN_RCON // Aby wlaczyc kolorowy say(colorchat) w grze odkomentuj #define KOLOROWY_SAY //Nowy wyglad Hud #define NOWY_HUD //V.I.P #define VIP_BF2 #if defined VIP_BF2 // Flaga V.i.P #define VIP ADMIN_LEVEL_G #endif //Standardowy HUD //#define STANDARDOWY_HUD // Aby wlaczyc kolorowy stary hud w grze odkomentuj //#define KOLOROWY_HUD #if defined KOLOROWY_HUD //#define CZERWONY_STARY_HUD //#define NIEBIESKI_STARY_HUD //#define SZARY_STARY_HUD //#define ZOLTY_STARY_HUD //#define DRUZYNOWY_STARY_HUD #endif // Aby wlaczyc prefix w say odkomentuj #define PREFIX #include <amxmodx> #include <amxmisc> #include <cstrike> #include <csx> #include <engine> #include <fun> #include <fakemeta_util> #include <hamsandwich> new const gNazwaPluginu[] = "Battlefield 2: Rank Mod"; new const gWersjaPluginu[] = "1.5.1a"; new const gAutorPluginu[] = "MisieQ"; //Message sending variables #if defined KOLOROWY_SAY new gmsgScreenFade; new gmsgScreenShake; #else new gmsgScreenFade; new gmsgScreenShake; new gmsgSayText; #endif #if defined STANDARDOWY_HUD new gmsgStatusText; #endif #if defined NOWY_HUD new gHUD; #define TASK_HUD 9897 #endif new gHudSyncAimInfo; new gMaxPlayers; new bool:gCZBotRegisterHam; #define MAX_RANKS 17 #define MAX_BADGES 12 //Motd variables new configsdir[200]; new configfile[200]; //Cvar vars new gPcvarBF2Active; new gPcvarBadgesActive; new gPcvarFreeAwp; new gPcvarXpMultiplier; new gPcvarIconTime; new gPcvarFlagKills; new gPcvarHelpUrl; new gPcvarBadgePowers; new gPcvarFlagRoundPoints; new gPcvarFlagMatchPoints; new gPcvarXpMinPlayers; new gPcvarHudOptions; new gPcvarStatusText; new gPcvarFFA; new gPcvarSaveType; new gPcvarRankBots; new gPcvarBotQuota; new gPcvarSVLan; #if defined SQL //Cvars SQL new pPcvarDBHost; new pPcvarDBUser; new pPcvarDBPassword; new pPcvarDBBase; #endif //Cvary Odznaki new gPcvarHP; new gPcvarSpeed; new gPcvarKasa; new gPcvarGrav1; new gPcvarGrav2; new gPcvarGrav3; new gPcvarGrav4; new gPcvarGrav5; new gPcvarGrav6; new gPcvarArmor1; new gPcvarArmor2; new gPcvarArmor3; new gPcvarArmor4; new gPcvarArmor5; new gPcvarArmor6; //Cvar vars new new gPcvarWymus; new gPcvarBomba; new gGracze[32]; new gZablokuj; //Current players info new gPlayerJump[33]; new g_PlayerRank[33]; new g_PlayerBadges[33][MAX_BADGES]; new knifekills[33]; new pistolkills[33]; new sniperkills[33]; new parakills[33]; new defuses[33]; new plants[33]; new explosions[33]; new accuracy[33]; new totalkills[33]; new gSaveKey[33][32]; new smgkills[33]; new shotgunkills[33]; new riflekills[33]; new grenadekills[33]; new g_count; new bronze[33]; new silver[33]; new gold[33]; //Temp storage variables new numofbadges[33]; new bool:newplayer[33]; new g_lastwpn[33]; new bool:g_imobile[33]; new bool:freezetime; new highestrank; new highestrankid; new gStatsLoaded[33]; new gCurrentFOV[33]; new g_friend[33]; new bool:g_invis[33]; new bool:g_grav[33]; new bool:g_silent[33]; new bool:gPlayerMedkitUsed[33]; new bool:is_on_knife[33]; new menuselection[33]; //Server stats new highestrankserver, highestrankservername[32], mostkills, mostkillsid, mostkillsname[32], mostwins, mostwinsname[32]; new menuselected[33][3]; //0 - Badge/Kills selected 0/1 //1 - Badgenum/Kills //2 - Badgelevel //Sound Vars new gSoundRank[] = "bf2rank/bf2rank_promotion.wav"; //Rank gained sound new gSoundBadge[] = "bf2rank/bf2rank_award.wav"; //Badges earned sound //Sprite vars new gSprite[22], g_healspr; new const sprite_heal[] = "sprites/bf2rankspr/heal.spr" #if defined SQL //SQl vars #include <sqlx> new Handle:g_SqlTuple; new g_Cache[512]; new bool:SQLenabled; new bool:gIntermission; #else //nVault #include <nvault> new g_Vault; new gPcvarPruneDays; #endif new gPlayerName; //Bf2 includes #if defined KOLOROWY_SAY #include <colorchat> #endif #if defined KOLOROWY_HUD #include <colorstatus> #endif #if defined VIP_BF2 #include "bf2/vip.inl" #endif #include "bf2/const.inl" #include "bf2/effect.inl" #include "bf2/cmds.inl" #include "bf2/events.inl" #include "bf2/save.inl" #include "bf2/forwards.inl" #include "bf2/check.inl" #include "bf2/badgepowers.inl" #include "bf2/menu.inl" #include "bf2/hud.inl" #include "bf2/othermods.inl" #include "bf2/csx.inl" #include "bf2/ham.inl" #include "bf2/apteczka.inl" #if defined SQL #include "bf2/sql.inl" #endif public plugin_init() { register_plugin(gNazwaPluginu, gWersjaPluginu, gAutorPluginu); #if defined KOLOROWY_HUD initColorStatus(); #endif #if defined VIP_BF2 initVip(); #endif //Register all the say commands //Public register_clcmd("say /ranks","show_rankhelp",0, "Pokazuje Informacje o Ranku"); register_clcmd("say_team /ranks","show_rankhelp",0, "Pokazuje Informacje o Ranku"); register_clcmd("say /badges1","show_badgehelp",0, "Pokazuje Informacje o Odznakach"); register_clcmd("say_team /badges1","show_badgehelp",0, "Pokazuje Informacje o Odznakach"); register_clcmd("say /odznaki1","show_badgehelp",0, "Pokazuje Informacje o Odznakach"); register_clcmd("say_team /odznaki1","show_badgehelp",0, "Pokazuje Informacje o Odznakach"); register_clcmd("say /badges2","show_badgehelp2",0, "Pokazuje Informacje o Odznakach 2"); register_clcmd("say_team /badges2","show_badgehelp2",0, "Pokazuje Informacje o Odznakach 2"); register_clcmd("say /odznaki2","show_badgehelp2",0, "Pokazuje Informacje o Odznakach 2"); register_clcmd("say_team /odznaki2","show_badgehelp2",0, "Pokazuje Informacje o Odznakach 2"); register_clcmd("say /badges3","show_badgehelp3",0, "Pokazuje Informacje o Odznakach 3"); register_clcmd("say_team /badges3","show_badgehelp3",0, "Pokazuje Informacje o Odznakach 3"); register_clcmd("say /odznaki3","show_badgehelp3",0, "Pokazuje Informacje o Odznakach 3"); register_clcmd("say_team /odznaki3","show_badgehelp3",0, "Pokazuje Informacje o Odznakach 3"); register_clcmd("say /badges4","show_badgehelp4",0, "Pokazuje Informacje o Odznakach 4"); register_clcmd("say_team /badges4","show_badgehelp4",0, "Pokazuje Informacje o Odznakach 4"); register_clcmd("say /odznaki4","show_badgehelp4",0, "Pokazuje Informacje o Odznakach 4"); register_clcmd("say_team /odznaki4","show_badgehelp4",0, "Pokazuje Informacje o Odznakach 4"); register_clcmd("say /badges5","show_badgehelp5",0, "Pokazuje Informacje o Odznakach 5"); register_clcmd("say_team /badges5","show_badgehelp5",0, "Pokazuje Informacje o Odznakach 5"); register_clcmd("say /odznaki5","show_badgehelp5",0, "Pokazuje Informacje o Odznakach 5"); register_clcmd("say_team /odznaki5","show_badgehelp5",0, "Pokazuje Informacje o Odznakach 5"); register_clcmd("say", "cmd_say", 0, "<target> "); register_clcmd("say_team", "cmd_say", 0, "<target> "); register_clcmd("say /who", "cmd_who", 0, "Wyswietla liste graczy i ich pozimy"); register_clcmd("say_team /who", "cmd_who", 0, "Wyswietla liste graczy i ich pozimy"); register_clcmd("say /gracze", "cmd_who", 0, "Wyswietla liste graczy i ich pozimy"); register_clcmd("say_team /gracze", "cmd_who", 0, "Wyswietla liste graczy i ich pozimy"); register_clcmd("say /help", "cmd_help", 0, "Pokaz pomoc BF2Mod"); register_clcmd("say_team /help", "cmd_help", 0, "Pokaz pomoc BF2Mod"); register_clcmd("say /bf2menu", "Bf2menu", 0, "Pokazuje Menu"); register_clcmd("say_team /bf2menu", "Bf2menu", 0, "Pokazuje Menu"); register_clcmd("say bf2menu", "Bf2menu", 0, "Pokazuje Menu"); register_clcmd("say_team bf2menu", "Bf2menu", 0, "Pokazuje Menu"); register_clcmd("say /bf2", "Bf2menu", 0, "Pokazuje Menu"); register_clcmd("say_team /bf2", "Bf2menu", 0, "Pokazuje Menu"); register_clcmd("say bf2", "Bf2menu", 0, "Pokazuje Menu"); register_clcmd("say_team bf2", "Bf2menu", 0, "Pokazuje Menu"); register_clcmd("say menu", "Bf2menu", 0, "Pokazuje Menu"); register_clcmd("say_team menu", "Bf2menu", 0, "Pokazuje Menu"); register_clcmd("say /help", "Bf2menu", 0, "Pokazuje Menu"); register_clcmd("say_team /help", "Bf2menu", 0, "Pokazuje Menu"); register_clcmd("say help", "Bf2menu", 0, "Pokazuje Menu"); register_clcmd("say_team help", "Bf2menu", 0, "Pokazuje Menu"); register_clcmd("say /bf2helpmenu", "helpmenu", 0, "Pokazuje Menu Pomocy"); register_clcmd("say_team /bf2helpmenu", "helpmenu", 0, "Pokazuje Menu Pomocy"); register_clcmd("say /bf2statsmenu", "helpmenu", 0, "Pokazuje Menu Statystyk"); register_clcmd("say_team /bf2statsmenu", "helpmenu", 0, "Pokazuje Menu Statystyk"); register_clcmd("say /bf2adminmenu", "adminmenu", 0, "Pokazuje Menu Admina"); register_clcmd("say_team /bf2adminmenu", "adminmenu", 0, "Pokazuje Menu Admina"); register_clcmd("say /bf2stats", "show_stats", 0, "Pokazuje twoje aktualne statystyki"); register_clcmd("say_team /bf2stats", "show_stats", 0, "Pokazuje twoje aktualne statystyki"); register_clcmd("say /serverstats", "show_server_stats", 0, "Pokazuje aktualne statystyki serwera"); register_clcmd("say_team /serverstats", "show_server_stats", 0, "Pokazuje aktualne statystyki serwera"); register_clcmd("say /bf2save", "save_badges", 0, "Zapisuje Aktualne Statystyki"); register_clcmd("say_team /bf2save", "save_badges", 0, "Zapisuje Aktualne Statystyki"); //Admin register_clcmd("bf2_addbadge", "add_badge", ADMIN_UPRAWNIENIA, "<player> <badge#> <level#>"); register_clcmd("bf2_addkills", "add_kills", ADMIN_UPRAWNIENIA, "<player> <kills#>"); //Cvars //FCVAR_SERVER cvar for game monitor. register_cvar("bf2_version", gWersjaPluginu, FCVAR_SERVER); // Set cvar to update version in case new version loaded while server still running set_cvar_string("bf2_version", gWersjaPluginu); gPcvarBF2Active = register_cvar("bf2_active", "1"); gPcvarBadgesActive = register_cvar("bf2_badges", "1"); gPcvarFreeAwp = register_cvar("bf2_awp", "1"); gPcvarXpMultiplier = register_cvar("bf2_xpmultiplier", "0.1"); gPcvarXpMinPlayers = register_cvar("bf2_xpminplayers", "2"); gPcvarIconTime = register_cvar("bf2_icon_time", "1.5"); gPcvarHelpUrl = register_cvar("bf2_help_url", "http://misieq.elsat.net.pl/amxx"); gPcvarBadgePowers = register_cvar("bf2_badgepowers", "1"); gPcvarHudOptions = register_cvar("bf2_hud_options", "abcde"); gPcvarStatusText = register_cvar("bf2_statustext", "1"); #if !defined SQL gPcvarPruneDays = register_cvar("bf2_reset_days", "21"); #endif gPcvarFFA = register_cvar("bf2_ffa", "0"); gPcvarWymus = register_cvar("bf2_wymus", "1"); gPcvarBomba = register_cvar("bf2_bomba", "1"); gPcvarFlagKills = register_cvar("bf2_flag_kills", "2"); gPcvarFlagRoundPoints = register_cvar("bf2_flag_round_kills", "0"); gPcvarFlagMatchPoints = register_cvar("bf2_flag_match_kills", "0"); // Cvary Odznak gPcvarHP = register_cvar("bf2_odznaka_hp", "10"); gPcvarSpeed = register_cvar("bf2_odznaka_szybkosc", "15.0"); gPcvarKasa = register_cvar("bf2_odznaka_kasa", "150"); gPcvarGrav1 = register_cvar("bf2_odznaka_grawitacja_1", "0.9375"); gPcvarGrav2 = register_cvar("bf2_odznaka_grawitacja_2", "0.875"); gPcvarGrav3 = register_cvar("bf2_odznaka_grawitacja_3", "0.8125"); gPcvarGrav4 = register_cvar("bf2_odznaka_grawitacja_4", "0.75"); gPcvarGrav5 = register_cvar("bf2_odznaka_grawitacja_5", "0.65625"); gPcvarGrav6 = register_cvar("bf2_odznaka_grawitacja_6", "0.5625"); gPcvarArmor1 = register_cvar("bf2_dodatkowy_armor_1", "50"); gPcvarArmor2 = register_cvar("bf2_dodatkowy_armor_2", "100"); gPcvarArmor3 = register_cvar("bf2_dodatkowy_armor_3", "150"); gPcvarArmor4 = register_cvar("bf2_dodatkowy_armor_4", "200"); gPcvarArmor5 = register_cvar("bf2_dodatkowy_armor_5", "250"); gPcvarArmor6 = register_cvar("bf2_dodatkowy_armor_6", "300"); #if defined SQL /* SQL */ pPcvarDBHost = register_cvar("bf2_db_host", "x"); pPcvarDBUser = register_cvar("bf2_db_user", "x"); pPcvarDBPassword = register_cvar("bf2_db_pass", "x"); pPcvarDBBase = register_cvar("bf2_db_database", "x"); #endif gPcvarSaveType = get_cvar_pointer("csstats_rank"); gPcvarRankBots = get_cvar_pointer("csstats_rankbots"); gPcvarBotQuota = get_cvar_pointer("bot_quota"); gPcvarSVLan = get_cvar_pointer("sv_lan"); //Message sending. #if defined KOLOROWY_SAY gmsgScreenFade = get_user_msgid("ScreenFade"); gmsgScreenShake = get_user_msgid("ScreenShake"); #else gmsgScreenFade = get_user_msgid("ScreenFade"); gmsgScreenShake = get_user_msgid("ScreenShake"); gmsgSayText = get_user_msgid("SayText"); #endif #if defined STANDARDOWY_HUD gmsgStatusText = get_user_msgid("StatusText"); #endif //Register events, logs and forwards to be captured register_event("HLTV", "Event_HLTV", "a", "1=0", "2=0"); //add freeztime start code register_event("CurWeapon", "Event_CurWeapon", "be", "1=1"); register_event("SetFOV", "Event_SetFOV", "be"); register_event("DeathMsg", "Event_DeathMsg", "a"); register_logevent("LogEvent_Round_Start", 2, "0=World triggered", "1=Round_Start"); //freezetime end code register_logevent("LogEvent_Round_End", 2, "1=Round_End"); register_message(SVC_INTERMISSION, "Message_Intermission"); #if defined STANDARDOWY_HUD register_message(get_user_msgid("StatusValue"), "Message_StatusValue"); #endif register_event("StatusValue", "setTeam", "be", "1=1"); register_event("StatusValue", "on_ShowStatus", "be", "1=2", "2!0"); register_event("StatusValue", "on_HideStatus", "be", "1=1", "2=0"); // Must use post or else is_user_alive will return false when dead player respawns RegisterHam(Ham_Spawn, "player", "Ham_Spawn_Post", 1); // cz bots won't hook here must RegisterHamFromEntity RegisterHam(Ham_TakeDamage, "player", "Ham_TakeDamage_Pre"); #if defined NOWY_HUD RegisterHam(Ham_Killed, "player", "Ham_Death_Player", 1); #endif gHudSyncAimInfo = CreateHudSyncObj(); gMaxPlayers = get_maxplayers(); gPlayerName = get_xvar_id("PlayerName"); register_forward(FM_PlayerPreThink, "PlayerPreThink") register_forward(FM_CmdStart, "FM_CmdStart1"); register_forward(FM_EmitSound, "EmitSound1"); get_players(gGracze, gZablokuj, "ch"); #if defined NOWY_HUD gHUD = CreateHudSyncObj(); #endif #if defined PREFIX register_message(get_user_msgid("SayText"),"PrefixCzat"); #endif }