RU
RU
UA
EN
PL
ГЛАВНАЯ
УСЛУГИ
ПЛАГИНЫ
КАРТЫ
REBUY
SCANMON
CASSA
SALE
ФОРУМ
МОНИТОР
HELP
КОНТАКТ
Главная
/
Plugins
/
[CS 1.6][ZP] Addon: Ranks System
[CS 1.6][ZP] Addon: Ranks System
Теги:
Скачать плагины cs
Остальные
Плагин добавляет на ваш сервер систему рангов, которую можно настроить через удобное меню, выдать или убрать опыт игроку, просмотреть статистику.
При установке скомпилируйте sma файл (это само меню) будет находиться в архиве с плагином.
Компилятор: 1.8.3 Multibild
+ZIP
1739
Команды:
Кваров и команд нет
.sma / .sp
#include
#include
#include
#include
/* ~ Благодарности ~ Docaner - За большую помощь с Array-частью + nVault-часть. ( взял с его системы предупреждений игрокам ) xUnicorn ( t3rkecorejz ) - за SQL-часть. ( взял с его системы денег ) ~ Change Log ~ 0.0.1 - Сырой релиз. 0.0.2 | Update - Переделан полностью код с Арраем. Добавлены новые функции. 0.0.3 | Stable - Добавлена система сохранения ( nVault / SQL ). Исправлен баг с крашем сервера. */ // Тип сохранения - nVault. Закомментируйте, если хотите сохранение по SQL. #define SAVE_TYPE_NVAULT #if defined SAVE_TYPE_NVAULT #tryinclude
#else #tryinclude
#endif // Путь до вашего ini/cfg файла. Изначально они такие: // configs/z_ranks_system/z_ranks.ini | z_ranks_system/z_ranks.cfg // Папку configs вписывать в путь не надо. Она автоматически добавляется при чтении файлов. #define INI_FILE_PATH "z_ranks_system/z_ranks.ini" #define CFG_FILE_PATH "z_ranks_system/z_ranks.cfg" #define TASK_SHOW_HUD 523131 // Таск худа new Array: g_aHumanExp, Array: g_aHumanRanks, Array: g_aZombieExp, Array: g_aZombieRanks; new g_iLevel[33][2], g_iExp[33][2]; new g_iColorRgb[3]; new g_szUserSteamID[33][34]; new g_iMaxPlayers; #if defined SAVE_TYPE_NVAULT new g_nVaultID; #else new Handle: g_hDBTuple, Handle: g_hConnect; new g_szQuery[512], g_iszTableName[128]; static g_iSqlConnected; #endif enum _: pCvarList { ZP_SQL_HOST = 0, ZP_SQL_USER, ZP_SQL_PASSWORD, ZP_SQL_DATABASE, ZP_SQL_TABLENAME, ZP_NVAULT_DATABASE, ZP_INFECTED_HUMAN_EXP, ZP_KILLED_ZOMBIE_EXP, ZP_KILLED_HUMAN_EXP, ZP_KILLED_NEMESIS_EXP, ZP_KILLED_SURVIVOR_EXP, ZP_KILLED_LAST_HUMAN_EXP, ZP_KILLED_LAST_ZOMBIE_EXP, ZP_KILLED_FIRST_ZOMBIE_EXP, ZP_EXPERIENCE_RESET, ZP_SPECIAL_ROUND_WORKED, ZP_LEVEL_UP_MESSAGE, ZP_LEVEL_UP_TEXT, ZP_HUD_ENABLE, ZP_HUD_RGB_COLOR, ZP_HUD_POS_X, ZP_HUD_POS_Y } new pCvar[pCvarList], g_szCfgDir[64]; public plugin_precache() { new szCfgFile[128]; get_localinfo("amxx_configsdir", g_szCfgDir, charsmax(g_szCfgDir)); formatex(szCfgFile, charsmax(szCfgFile), "%s/%s", g_szCfgDir, INI_FILE_PATH); switch(file_exists(szCfgFile)) { case 0: { static szReason[128]; formatex(szReason, charsmax(szReason), "File ^"%s^" not found!", szCfgFile); set_fail_state(szReason); } case 1: zp_read_ini_file(szCfgFile); } } public zp_read_ini_file(szCfgFile[]) { new szBuffer[128], iLine, iLen, iExperience[2][8], szRanks[2][64]; g_aHumanExp = ArrayCreate(); g_aZombieExp = ArrayCreate(); g_aHumanRanks = ArrayCreate(64); g_aZombieRanks = ArrayCreate(64); while(read_file(szCfgFile, iLine++, szBuffer, charsmax(szBuffer), iLen)) { if(!iLen || szBuffer[0] == ';') continue; parse(szBuffer, iExperience[0], charsmax(iExperience[]), szRanks[0], charsmax(szRanks[]), iExperience[1], charsmax(iExperience[]), szRanks[1], charsmax(szRanks[])); ArrayPushCell(g_aHumanExp, str_to_num(iExperience[0])); ArrayPushCell(g_aZombieExp, str_to_num(iExperience[1])); ArrayPushString(g_aHumanRanks, szRanks[0]); ArrayPushString(g_aZombieRanks, szRanks[1]); } } public plugin_init() { register_plugin("[AMXX | ZP] Z-Ranks System", "0.0.3 | Stable", "Mort3m (1331)"); register_event("HLTV", "Event_RoundStart", "a", "1=0", "2=0"); RegisterHam(Ham_Killed, "player", "HamHook_PlayerKilled_Pre", 0); g_iMaxPlayers = get_maxplayers(); pCvar[ZP_SQL_HOST] = register_cvar("zp_sql_data_host", "127.0.0.1"); pCvar[ZP_SQL_USER] = register_cvar("zp_sql_data_user", "root"); pCvar[ZP_SQL_PASSWORD] = register_cvar("zp_sql_data_password", ""); pCvar[ZP_SQL_DATABASE] = register_cvar("zp_sql_data_database", "zranks_database"); pCvar[ZP_SQL_TABLENAME] = register_cvar("zp_sql_data_tablename", "zp_zranks_system"); pCvar[ZP_NVAULT_DATABASE] = register_cvar("zp_nvault_data_database", "zranks_users"); pCvar[ZP_INFECTED_HUMAN_EXP] = register_cvar("zp_infected_human_exp", "1") pCvar[ZP_KILLED_ZOMBIE_EXP] = register_cvar("zp_killed_zombie_exp", "1"); pCvar[ZP_KILLED_HUMAN_EXP] = register_cvar("zp_killed_human_exp", "1"); pCvar[ZP_KILLED_NEMESIS_EXP] = register_cvar("zp_killed_nemesis_exp", "3"); pCvar[ZP_KILLED_SURVIVOR_EXP] = register_cvar("zp_killed_survivor_exp", "3"); pCvar[ZP_KILLED_LAST_HUMAN_EXP] = register_cvar("zp_killed_last_human_exp", "2"); pCvar[ZP_KILLED_LAST_ZOMBIE_EXP] = register_cvar("zp_killed_last_zombie_exp", "2"); pCvar[ZP_KILLED_FIRST_ZOMBIE_EXP] = register_cvar("zp_killed_first_zombie_exp", "2"); pCvar[ZP_EXPERIENCE_RESET] = register_cvar("zp_experience_reset", "1"); pCvar[ZP_SPECIAL_ROUND_WORKED] = register_cvar("zp_special_round_worked", "0"); pCvar[ZP_LEVEL_UP_MESSAGE] = register_cvar("zp_level_up_message", "1"); pCvar[ZP_LEVEL_UP_TEXT] = register_cvar("zp_level_up_text", ""); pCvar[ZP_HUD_ENABLE] = register_cvar("zp_hud_enable", "1"); pCvar[ZP_HUD_RGB_COLOR] = register_cvar("zp_hud_rgb_color", "0 196 255"); pCvar[ZP_HUD_POS_X] = register_cvar("zp_hud_pos_x", "0.17"); pCvar[ZP_HUD_POS_Y] = register_cvar("zp_hud_pos_y", "0.20"); } public plugin_cfg() { server_cmd("exec %s/%s", g_szCfgDir, CFG_FILE_PATH); #if defined SAVE_TYPE_NVAULT new isznVaultDbName[64]; get_pcvar_string(pCvar[ZP_NVAULT_DATABASE], isznVaultDbName, charsmax(isznVaultDbName)); g_nVaultID = nvault_open(isznVaultDbName); #else get_pcvar_string(pCvar[ZP_SQL_TABLENAME], g_iszTableName, charsmax(g_iszTableName)); SQL_LoadDebug(); #endif static pString[16], iszColorParse[3][4]; get_pcvar_string(pCvar[ZP_HUD_RGB_COLOR], pString, charsmax(pString)); parse(pString, iszColorParse[0], charsmax(iszColorParse[]), iszColorParse[1], charsmax(iszColorParse[]), iszColorParse[2], charsmax(iszColorParse[])); g_iColorRgb[0] = str_to_num(iszColorParse[0]); g_iColorRgb[1] = str_to_num(iszColorParse[1]); g_iColorRgb[2] = str_to_num(iszColorParse[2]); } public plugin_end() { #if defined SAVE_TYPE_NVAULT new szBuffer[128]; for(new pPlayer = 1; pPlayer <= g_iMaxPlayers; pPlayer++) { if(!is_user_connected(pPlayer)) continue; if(is_user_steamid(g_szUserSteamID[pPlayer])) { formatex(szBuffer, charsmax(szBuffer), "%d %d %d %d", g_iLevel[pPlayer][0], g_iExp[pPlayer][0], g_iLevel[pPlayer][1], g_iExp[pPlayer][1]); nvault_pset(g_nVaultID, g_szUserSteamID[pPlayer], szBuffer); } } nvault_close(g_nVaultID); #else if(g_hDBTuple) SQL_FreeHandle(g_hDBTuple); if(g_hConnect) SQL_FreeHandle(g_hConnect); #endif return; } public HamHook_PlayerKilled_Pre(iVictim, iKiller) { if(!is_user_connected(iVictim) || !is_user_connected(iKiller) || iVictim == iKiller) return; if(!get_pcvar_num(pCvar[ZP_SPECIAL_ROUND_WORKED])) { if(zp_is_survivor_round() || zp_is_nemesis_round()) return; } if(!zp_get_user_zombie(iKiller)) { if(zp_get_user_first_zombie(iVictim)) g_iExp[iKiller][0] += get_pcvar_num(pCvar[ZP_KILLED_FIRST_ZOMBIE_EXP]); if(zp_get_user_last_zombie(iVictim) && !zp_get_user_first_zombie(iVictim)) g_iExp[iKiller][0] += get_pcvar_num(pCvar[ZP_KILLED_LAST_ZOMBIE_EXP]); if(zp_get_user_zombie(iVictim) && !zp_get_user_nemesis(iVictim) && !zp_get_user_last_zombie(iVictim) && !zp_get_user_first_zombie(iVictim)) g_iExp[iKiller][0] += get_pcvar_num(pCvar[ZP_KILLED_ZOMBIE_EXP]); if(zp_get_user_nemesis(iVictim)) g_iExp[iKiller][0] += get_pcvar_num(pCvar[ZP_KILLED_NEMESIS_EXP]); } else { if(zp_get_user_last_human(iVictim)) g_iExp[iKiller][1] += get_pcvar_num(pCvar[ZP_KILLED_LAST_HUMAN_EXP]); if(!zp_get_user_zombie(iVictim) && !zp_get_user_survivor(iVictim) && !zp_get_user_last_human(iVictim)) g_iExp[iKiller][1] += get_pcvar_num(pCvar[ZP_KILLED_HUMAN_EXP]); if(zp_get_user_survivor(iVictim)) g_iExp[iKiller][1] += get_pcvar_num(pCvar[ZP_KILLED_SURVIVOR_EXP]); } zp_check_user_level(iKiller, zp_get_user_zombie(iKiller) ? 1 : 0); } public zp_user_infected_post(iPlayer, iInfector, iNemesis) { if(!is_user_alive(iPlayer) || !is_user_alive(iInfector)) return; g_iExp[iInfector][1] += get_pcvar_num(pCvar[ZP_INFECTED_HUMAN_EXP]); zp_check_user_level(iInfector, 1); } public zp_check_user_level(pPlayer, iTeam) { while(g_iExp[pPlayer][iTeam] >= ArrayGetCell(iTeam ? g_aZombieExp : g_aHumanExp, g_iLevel[pPlayer][iTeam])) { if(g_iLevel[pPlayer][iTeam] >= ArraySize(iTeam ? g_aZombieExp : g_aHumanExp) - 1) { g_iLevel[pPlayer][iTeam] = (ArraySize(iTeam ? g_aZombieExp : g_aHumanExp) - 1); g_iExp[pPlayer][iTeam] = (ArrayGetCell(iTeam ? g_aZombieExp : g_aHumanExp, g_iLevel[pPlayer][iTeam])); break; } else { g_iLevel[pPlayer][iTeam]++; if(get_pcvar_num(pCvar[ZP_EXPERIENCE_RESET])) g_iExp[pPlayer][iTeam] = 0; if(get_pcvar_num(pCvar[ZP_LEVEL_UP_MESSAGE])) { static szMessage[128]; get_pcvar_string(pCvar[ZP_LEVEL_UP_TEXT], szMessage, charsmax(szMessage)); UTIL_SayText(pPlayer, szMessage); } } } } // [ SQL ] #if !defined SAVE_TYPE_NVAULT public SQL_LoadDebug() { new szError[512]; new iErrorCode; new iszSqlData[4][64]; get_pcvar_string(pCvar[ZP_SQL_HOST], iszSqlData[0], charsmax(iszSqlData[])); get_pcvar_string(pCvar[ZP_SQL_USER], iszSqlData[1], charsmax(iszSqlData[])); get_pcvar_string(pCvar[ZP_SQL_PASSWORD], iszSqlData[2], charsmax(iszSqlData[])); get_pcvar_string(pCvar[ZP_SQL_DATABASE], iszSqlData[3], charsmax(iszSqlData[])); g_hDBTuple = SQL_MakeDbTuple(iszSqlData[0], iszSqlData[1], iszSqlData[2], iszSqlData[3]); g_hConnect = SQL_Connect(g_hDBTuple, iErrorCode, szError, charsmax(szError)); if(g_hConnect == Empty_Handle) set_fail_state(szError); if(!SQL_TableExists(g_hConnect, g_iszTableName)) { new Handle: hQueries; new szQuery[512]; formatex(szQuery, charsmax(szQuery), "CREATE TABLE IF NOT EXISTS `%s` (SteamID varchar( 32 ) CHARACTER SET cp1250 COLLATE cp1250_general_ci NOT NULL, Human_Level INT NOT NULL, Human_Exp INT NOT NULL, Zombie_Level INT NOT NULL, Zombie_Exp INT NOT NULL, PRIMARY KEY (SteamID))", g_iszTableName); hQueries = SQL_PrepareQuery(g_hConnect, szQuery); if(!SQL_Execute(hQueries)) { SQL_QueryError(hQueries, szError, charsmax(szError)); set_fail_state(szError); } SQL_FreeHandle(hQueries); } g_iSqlConnected = 1; SQL_QueryAndIgnore(g_hConnect, "SET NAMES utf8"); } public SQL_QueryConnection(iState, Handle: hQuery, szError[], iErrorCode, iParams[], iParamsSize) { switch(iState) { case TQUERY_CONNECT_FAILED: log_amx("Load - Could not connect to SQL database. [%d] %s", iErrorCode, szError); case TQUERY_QUERY_FAILED: log_amx("Load Query failed. [%d] %s", iErrorCode, szError); } new iPlayer = iParams[0]; if(SQL_NumResults(hQuery) < 1) { if(equal(g_szUserSteamID[iPlayer], "ID_PENDING")) return PLUGIN_HANDLED; g_iLevel[iPlayer][0] = 1; g_iExp[iPlayer][0] = 0; g_iLevel[iPlayer][1] = 1; g_iExp[iPlayer][1] = 0; formatex(g_szQuery, charsmax(g_szQuery), "INSERT INTO `%s` (`SteamID`, `Human_Level`, `Human_Exp`, `Zombie_Level`, `Zombie_Exp`) VALUES ('%s', '%d', '%d', '%d', '%d');", g_iszTableName, g_szUserSteamID[iPlayer], g_iLevel[iPlayer][0], g_iExp[iPlayer][0], g_iLevel[iPlayer][1], g_iExp[iPlayer][1]); SQL_ThreadQuery(g_hDBTuple, "SQL_ThreadQueryHandler", g_szQuery); return PLUGIN_HANDLED; } else { g_iLevel[iPlayer][0] = SQL_ReadResult(hQuery, 1); g_iExp[iPlayer][0] = SQL_ReadResult(hQuery, 2); g_iLevel[iPlayer][1] = SQL_ReadResult(hQuery, 3); g_iExp[iPlayer][1] = SQL_ReadResult(hQuery, 4); } return PLUGIN_HANDLED; } public SQL_ThreadQueryHandler( iState, Handle: hQuery, szError[ ], iErrorCode, iParams[ ], iParamsSize ) { if( iState == 0 ) return; log_amx( "SQL Error: %d (%s)", iErrorCode, szError ); } #endif // // [ Other ] public plugin_natives() { register_native("zp_set_user_level", "Native_SetUserLevel", 1); register_native("zp_set_user_exp", "Native_GiveUserExperience", 1); register_native("zp_get_user_level", "Native_GetUserLevel", 1); register_native("zp_get_user_max_level", "Native_GetUserMaxLevel", 1); register_native("zp_get_user_exp", "Native_GetUserExperience", 1); register_native("zp_get_user_next_exp", "Native_GetUserNextExperience", 1); register_native("zp_get_user_rankname", "Native_GetUserRankName", 1); } public Native_SetUserLevel(pPlayer, iTeam, iLevel) { if(g_iLevel[pPlayer][iTeam] > ArraySize(iTeam ? g_aZombieExp : g_aHumanExp) - 1) g_iLevel[pPlayer][iTeam] = (ArraySize(iTeam ? g_aZombieExp : g_aHumanExp) - 1); else if(ArrayGetCell(iTeam ? g_aZombieExp : g_aHumanExp, iLevel) < g_iExp[pPlayer][iTeam]) { g_iExp[pPlayer][iTeam] = 0; g_iLevel[pPlayer][iTeam] = iLevel; } else g_iLevel[pPlayer][iTeam] = iLevel; } public Native_GiveUserExperience(pPlayer, iTeam, iExperience) { g_iExp[pPlayer][iTeam] = iExperience; zp_check_user_level(pPlayer, iTeam); } public Native_GetUserLevel(pPlayer, iTeam) return g_iLevel[pPlayer][iTeam]; public Native_GetUserMaxLevel(pPlayer, iTeam) return (ArraySize(iTeam ? g_aZombieExp : g_aHumanExp) - 1); public Native_GetUserExperience(pPlayer, iTeam) return g_iExp[pPlayer][iTeam]; public Native_GetUserNextExperience(pPlayer, iTeam) return ArrayGetCell(iTeam ? g_aZombieExp : g_aHumanExp, g_iLevel[pPlayer][iTeam]); public Native_GetUserRankName(pPlayer, iTeam, szRankName[], iLen) { param_convert(3); ArrayGetString(iTeam ? g_aZombieRanks : g_aHumanRanks, g_iLevel[pPlayer][iTeam], szRankName, iLen); return 1; } public Event_RoundStart() { for(new pPlayer = 1; pPlayer <= g_iMaxPlayers; pPlayer++) { if(!is_user_connected(pPlayer)) continue; #if defined SAVE_TYPE_NVAULT new szBuffer[128]; formatex(szBuffer, charsmax(szBuffer), "%d %d %d %d", g_iLevel[pPlayer][0], g_iExp[pPlayer][0], g_iLevel[pPlayer][1], g_iExp[pPlayer][1]); nvault_pset(g_nVaultID, g_szUserSteamID[pPlayer], szBuffer); #else if(!g_iSqlConnected) return; formatex(g_szQuery, charsmax(g_szQuery), "UPDATE `%s` SET `Human_Level` = '%d', `Human_Exp` = '%d', `Zombie_Level` = '%d', `Zombie_Exp` = '%d' WHERE `%s`.`SteamID` = '%s';", g_iszTableName, g_iLevel[pPlayer][0], g_iExp[pPlayer][0], g_iLevel[pPlayer][1], g_iExp[pPlayer][1], g_iszTableName, g_szUserSteamID[pPlayer]); SQL_ThreadQuery(g_hDBTuple, "SQL_ThreadQueryHandler", g_szQuery); #endif } } public client_putinserver(iPlayer) { if(get_pcvar_num(pCvar[ZP_HUD_ENABLE])) set_task(1.0, "Task_HudMessage", iPlayer + TASK_SHOW_HUD, _, _, "b"); get_user_authid(iPlayer, g_szUserSteamID[iPlayer], charsmax(g_szUserSteamID[])); #if defined SAVE_TYPE_NVAULT new szBuffer[128]; formatex(szBuffer, charsmax(szBuffer), "%d %d %d %d", g_iLevel[iPlayer][0], g_iExp[iPlayer][0], g_iLevel[iPlayer][1], g_iExp[iPlayer][1]); if(is_user_steamid(g_szUserSteamID[iPlayer])) { if(nvault_get(g_nVaultID, g_szUserSteamID[iPlayer], szBuffer, charsmax(szBuffer))) { new iData[4][8]; parse(szBuffer, iData[0], charsmax(iData[]), iData[1], charsmax(iData[]), iData[2], charsmax(iData[]), iData[3], charsmax(iData[])); g_iLevel[iPlayer][0] = str_to_num(iData[0]); g_iExp[iPlayer][0] = str_to_num(iData[1]); g_iLevel[iPlayer][1] = str_to_num(iData[2]); g_iExp[iPlayer][1] = str_to_num(iData[3]); } else { g_iLevel[iPlayer][0] = 1; g_iExp[iPlayer][0] = 0; g_iLevel[iPlayer][1] = 1; g_iExp[iPlayer][1] = 0; } } #else if(!g_iSqlConnected) return; new iParams[1]; iParams[0] = iPlayer; formatex(g_szQuery, charsmax(g_szQuery), "SELECT * FROM `%s` WHERE ( `%s`.`SteamID` = '%s' )", g_iszTableName, g_iszTableName, g_szUserSteamID[iPlayer]); SQL_ThreadQuery(g_hDBTuple, "SQL_QueryConnection", g_szQuery, iParams, sizeof iParams); #endif } public client_disconnect(iPlayer) { remove_task(iPlayer + TASK_SHOW_HUD); #if defined SAVE_TYPE_NVAULT new szBuffer[128]; formatex(szBuffer, charsmax(szBuffer), "%d %d %d %d", g_iLevel[iPlayer][0], g_iExp[iPlayer][0], g_iLevel[iPlayer][1], g_iExp[iPlayer][1]); nvault_pset(g_nVaultID, g_szUserSteamID[iPlayer], szBuffer); #else if(!g_iSqlConnected) return; formatex(g_szQuery, charsmax(g_szQuery), "UPDATE `%s` SET `Human_Level` = '%d', `Human_Exp` = '%d', `Zombie_Level` = '%d', `Zombie_Exp` = '%d' WHERE `%s`.`SteamID` = '%s';", g_iszTableName, g_iLevel[iPlayer][0], g_iExp[iPlayer][0], g_iLevel[iPlayer][1], g_iExp[iPlayer][1], g_iszTableName, g_szUserSteamID[iPlayer]); SQL_ThreadQuery(g_hDBTuple, "SQL_ThreadQueryHandler", g_szQuery); #endif } public Task_HudMessage(pPlayer) { pPlayer -= TASK_SHOW_HUD; new iTeam, szRankName[64]; iTeam = zp_get_user_zombie(pPlayer) ? 1 : 0; ArrayGetString(iTeam ? g_aZombieRanks : g_aHumanRanks, g_iLevel[pPlayer][iTeam], szRankName, charsmax(szRankName)); set_hudmessage(g_iColorRgb[0], g_iColorRgb[1], g_iColorRgb[2], get_pcvar_float(pCvar[ZP_HUD_POS_X]), get_pcvar_float(pCvar[ZP_HUD_POS_Y]), 0, 0.0, 0.8, 0.2, 0.2, -1); show_hudmessage(pPlayer, "Уровень: %d^nОпыт: %d/%d^nРанк: %s", g_iLevel[pPlayer][iTeam], g_iExp[pPlayer][iTeam], ArrayGetCell(iTeam ? g_aZombieExp : g_aHumanExp, g_iLevel[pPlayer][iTeam]), szRankName); } // // [ Stock ] #if defined SAVE_TYPE_NVAULT stock is_user_steamid(const szSteamID[]) { if(contain(szSteamID,"ID_LAN") != -1 || contain(szSteamID,"BOT") != -1 || contain(szSteamID,"HLTV") != -1 || equal(szSteamID, "")) return 0; return 1; } #else stock bool: SQL_TableExists(Handle: hDataBase, const szTable[]) { new Handle: hQuery = SQL_PrepareQuery(hDataBase, "SELECT * FROM information_schema.tables WHERE table_name = '%s' LIMIT 1;", szTable); new szError[512]; if(!SQL_Execute(hQuery)) { SQL_QueryError(hQuery, szError, charsmax(szError)); set_fail_state(szError); } else if(!SQL_NumResults(hQuery)) { SQL_FreeHandle(hQuery); return false; } SQL_FreeHandle(hQuery); return true; } #endif stock UTIL_SayText(pPlayer, const szMessage[], any:...) { new szBuffer[190]; if(numargs() > 2) vformat(szBuffer, charsmax(szBuffer), szMessage, 3); else copy(szBuffer, charsmax(szBuffer), szMessage); while(replace(szBuffer, charsmax(szBuffer), "!y", "^1")) {} while(replace(szBuffer, charsmax(szBuffer), "!t", "^3")) {} while(replace(szBuffer, charsmax(szBuffer), "!g", "^4")) {} switch(pPlayer) { case 0: { for(new iPlayer = 1; iPlayer <= g_iMaxPlayers; iPlayer++) { if(!is_user_connected(iPlayer)) continue; engfunc(EngFunc_MessageBegin, MSG_ONE_UNRELIABLE, 76, {0.0, 0.0, 0.0}, iPlayer); write_byte(iPlayer); write_string(szBuffer); message_end(); } } default: { engfunc(EngFunc_MessageBegin, MSG_ONE_UNRELIABLE, 76, {0.0, 0.0, 0.0}, pPlayer); write_byte(pPlayer); write_string(szBuffer); message_end(); } } } //
Отправить
Загрузил
FliNe
2021-01-29 17:50:17
0
322
Установить на сервер
Скачать
Нет оплаченых серверов
Купить сервер CS 1.6
Купить сервер CS:GO
Купить сервер CSS v34
Подключить свой VDS к панели
Данная иконка означает, что плагин был проверен администрацией хостинга на тестовом сервере, и проблем с ним не было выявлено. Рекомендуем ставить исключительно проверенные плагины.
Плагин загружен на сервер, но проверка еще не была проведена.
CSHOST.COM.UA 2012-2024 Хостинг игровых серверов