Пользователь
pataychlenix
community of gen unknown
- Сообщения
- 43
- Реакции
- 3
- Помог
- 1 раз(а)
- Ошибка
-
когда открываю меню через /dmg, вместо "0. выход" пишется "0. exit"
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.10.0.5461
- Билд
-
ReHLDS version: 3.12.0.780-dev
- ReGamedll
-
ReGameDLL version: 5.21.0.575-dev
- Версия Metamod
-
Metamod-r v1.3.0.131
- Список метамодулей
-
[ 1] AMX Mod X RUN - amxmodx_mm_i386.so v1.10.0.5461 ini Start ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] Rechecker RUN - rechecker_mm_i386.so v2.7 ini Chlvl ANY
[ 5] Revoice RUN - revoice_mm_i386.so v0.1.0.34 ini Start Never
[ 6] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 7] WHBlocker RUN - whblocker_mm_i386.so v1.5.697 ini Chlvl ANY
[ 8] MySQL RUN - mysql_amxx_i386.so v1.10.0.5461 pl1 ANY ANY
[ 9] SQLite RUN - sqlite_amxx_i386.so v1.10.0.5461 pl1 ANY ANY
[10] ReAPI RUN - reapi_amxx_i386.so v5.22.0.254-dev pl1 ANY Never
[11] FakeMeta RUN - fakemeta_amxx_i386.so v1.10.0.5461 pl1 ANY ANY
[12] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl1 ANY Never
[13] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.10.0.5461 pl1 ANY ANY
[14] Engine RUN - engine_amxx_i386.so v1.10.0.5461 pl1 ANY ANY
[15] CStrike RUN - cstrike_amxx_i386.so v1.10.0.5461 pl1 ANY ANY
[16] Fun RUN - fun_amxx_i386.so v1.10.0.5461 pl1 ANY ANY
[17] CSX RUN - csx_amxx_i386.so v1.10.0.5461 pl1 ANY ANY
- Список плагинов
-
[ 1] 0 Admin Base 1.10.0.546 AMXX Dev Team admin.amxx running
[ 2] 1 unreal esp sound 1337 community of gen unknown espsound.am running
[ 3] 2 Admin Commands 1.10.0.546 AMXX Dev Team admincmd.am running
[ 4] 3 Admin Help 1.10.0.546 AMXX Dev Team adminhelp.a running
[ 5] 4 Slots Reservation 1.10.0.546 AMXX Dev Team adminslots. running
[ 6] 5 Multi-Lingual System 1.10.0.546 AMXX Dev Team multilingua running
[ 7] 6 Menus Front-End 1.10.0.546 AMXX Dev Team menufront.a running
[ 8] 7 Commands Menu 1.10.0.546 AMXX Dev Team cmdmenu.amx running
[ 9] 8 Players Menu 1.10.0.546 AMXX Dev Team plmenu.amxx running
[ 10] 9 Maps Menu 1.10.0.546 AMXX Dev Team mapsmenu.am running
[ 11] 10 Plugin Menu 1.10.0.546 AMXX Dev Team pluginmenu. running
[ 12] 11 Admin Chat 1.10.0.546 AMXX Dev Team adminchat.a running
[ 13] 12 Anti Flood 1.10.0.546 AMXX Dev Team antiflood.a running
[ 14] 13 Scrolling Message 1.10.0.546 AMXX Dev Team scrollmsg.a running
[ 15] 14 Info. Messages 1.10.0.546 AMXX Dev Team imessage.am running
[ 16] 15 Admin Votes 1.10.0.546 AMXX Dev Team adminvote.a running
[ 17] 16 Pause Plugins 1.10.0.546 AMXX Dev Team pausecfg.am running
[ 18] 17 Stats Configuration 1.10.0.546 AMXX Dev Team statscfg.am running
[ 19] 18 rechecker logging 1337 community of gen unknown rechecker.a running
[ 20] 19 reaimdetector 0.2.2 community of gen unknown reaimdetect running
[ 21] 20 game name 1337 community of gen unknown gamename.am running
[ 22] 21 drop granade 1337 community of gen unknown dropgrenade running
[ 23] 22 custom smoke 1337 community of gen unknown customsmoke running
[ 24] 23 hint blocker 1337 community of gen unknown hintblocker running
[ 25] 24 balance map 1337 community of gen unknown balancemap. running
[ 26] 25 steam prefix 1337 community of gen unknown steampref.a running
[ 27] 26 snow hats 1337 community of gen unknown snowhats.am running
[ 28] 27 admin esp 1337 community of gen unknown adminesp.am running
[ 29] 28 players respawn 1337 community of gen unknown playersresp running
[ 30] 29 players team menu 1337 community of gen unknown teammenu.am running
[ 31] 30 regen hp ap 1337 community of gen unknown regenhpap.a running
[ 32] 31 tab text 1337 community of gen unknown tab.amxx running
[ 33] 32 advanced assists 1337 community of gen unknown kd.amxx running
[ 34] 33 bots 1337 community of gen unknown bots.amxx running
[ 35] 34 audio connect 1337 community of gen unknown audio.amxx running
[ 36] 35 awp limit 1337 community of gen unknown awplimit.am running
[ 37] 36 map manager 1337 community of gen unknown mapmanager. running
[ 38] 37 messages 1337 community of gen unknown messages.am running
[ 39] 38 damage 1337 community of gen unknown damage.amxx running
- Автор плагина
- iPlague
- Версия плагина
- 2.0.0
- Исходный код
-
#include <amxmodx>
#include <nvault>
#if AMXX_VERSION_NUM < 183
#include <dhudmessage>
#define MAX_PLAYERS 32
new MaxClients;
#define client_disconnected client_disconnect
#endif
#pragma semicolon 1
#define H_FLAG ADMIN_LEVEL_H
enum _:g_data{gVault, g_1, g_2, bool:firstkill}
enum _:p_data{bool:CONN,bool:ALIVE,ONOFF,bool:TYPE,SIZE,bool:INFO,bool:DMGIN,bool:SAVED,bool:VIP,DMG_CLR}
new pl_data[33][p_data],gl_data[g_data], DMG[MAX_PLAYERS+1][MAX_PLAYERS+1],Float:DMG_TIME[MAX_PLAYERS+1][MAX_PLAYERS+1], AuthID[MAX_PLAYERS+1][35];
new CMD[] = {"say dmg","say /dmg","say damage","say /damage","damage","dmg"};
public plugin_init(){
register_plugin("Advanced Damager", "2.0.0", "iPlague");
for(new i = 0; i < sizeof(CMD); i ++) register_clcmd(CMD[i],"dmg_settings",_,"Открыть меню настроек");
register_event("Damage", "eventDamage", "b", "2!0");
register_event("DeathMsg", "eDeathMsg", "a", "1>0");
register_event( "HLTV", "EVENT_NewRound", "a", "1=0","2=0");
register_dictionary("damager.txt");
gl_data[g_1] = CreateHudSyncObj();
gl_data[g_2] = CreateHudSyncObj();
#if AMXX_VERSION_NUM < 183
MaxClients = get_maxplayers();
#endif
register_srvcmd("aes_lockmap","Check_LockMap");
}
public plugin_cfg(){
gl_data[gVault] = nvault_open("DamagerSettings");
if (gl_data[gVault] == INVALID_HANDLE)set_fail_state("Error opening nVault!");
}
public plugin_end() nvault_close(gl_data[gVault]);
public EVENT_NewRound()gl_data[firstkill] = true;
public client_disconnected(id)pl_data[id][CONN]= false;
public client_putinserver(id){
pl_data[id][CONN] = true;
if(get_user_flags(id) & H_FLAG) pl_data[id][VIP] = pl_data[id][SAVED] = true;
LoadData(id);
}
public dmg_settings(id)
{
new szMenuMulti[256],szType[64],szColour[64],szSize[64];
formatex(szType, 63, "TYPE_%d", pl_data[id][ONOFF]);
formatex(szColour, 63, "COLOUR_%d", pl_data[id][DMG_CLR]);
formatex(szSize, 63, "SIZE_%d", pl_data[id][SIZE]);
formatex(szMenuMulti,255,"%L",id, "MSGMAIN");
new menu = menu_create(szMenuMulti,"menu_damager");
formatex(szMenuMulti,255,"%L %L",id,"MSG2",id,szType); // // дамагер ON/OFF
menu_additem(menu,szMenuMulti,"1",0);
formatex(szMenuMulti,255,pl_data[id][TYPE] ? "%L \y[ON]" : "%L \r[OFF]",id,"MSG3" ); // Накопительный урон ON/OFF
menu_additem(menu,szMenuMulti,"2",ADMIN_LEVEL_H);
formatex(szMenuMulti,255,"%L %L",id,"MSG4",id,szSize); // DHUD урон ON/OFF
menu_additem(menu,szMenuMulti,"3",ADMIN_LEVEL_H);
formatex(szMenuMulti,255,pl_data[id][INFO] ? "%L \y[ON]" : "%L \r[OFF]",id,"MSG5" ); // FIRSTKILL info ON/OFF
menu_additem(menu,szMenuMulti,"4",0);
formatex(szMenuMulti,255,"%L %L",id,"MSG1",id,szColour); // "Цвет дамагера [цвет]"
menu_additem(menu,szMenuMulti,"5",0);
formatex(szMenuMulti,255,pl_data[id][DMGIN] ? "%L \y[ON]" : "%L \r[OFF]",id,"MSG6" ); // Входящий урон ON/OFF
menu_additem(menu,szMenuMulti,"6",0);
if(pl_data[id][VIP] && !pl_data[id][SAVED])
{
formatex(szMenuMulti,255,"%L",id,"MSG7"); // Сохранить
menu_additem(menu,szMenuMulti,"7");
}
menu_setprop(menu, MPROP_NUMBER_COLOR,"\y");
menu_setprop(menu,MPROP_EXIT,"Выход");
menu_display(id,menu,0);
}
public menu_damager(id,menu,item)
{
if (item==MENU_EXIT){
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new s_Data[6], s_Name[64], i_Access, i_Callback;
menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback);
new i_Key = str_to_num(s_Data);
switch(i_Key)
{
case 1:
{
if(pl_data[id][VIP])
{
pl_data[id][ONOFF] = (pl_data[id][ONOFF] +1) % 3;
}
else pl_data[id][ONOFF] = (pl_data[id][ONOFF] +1) % 2;
}
case 2: pl_data[id][TYPE] = !pl_data[id][TYPE];
case 3: pl_data[id][SIZE] = (pl_data[id][SIZE] +1) % 2;
case 4: pl_data[id][INFO] = !pl_data[id][INFO];
case 5: pl_data[id][DMG_CLR] = (pl_data[id][DMG_CLR] +1) % 9;
case 6: pl_data[id][DMGIN] = !pl_data[id][DMGIN];
case 7: SaveData(id);
}
if(pl_data[id][VIP])pl_data[id][SAVED] = false;
dmg_settings(id);
return PLUGIN_HANDLED;
}
public eDeathMsg()
{
if(!gl_data[firstkill]) return;
if(read_data(1) == read_data(2))return;
new hudmsg[128], vname[32], aname[32];
new iHS = read_data(3);
get_user_name(read_data(2),vname,31);
get_user_name(read_data(1),aname,31);
switch(random_num(1,8)) //случайные 8 сообщений о первом убийстве.
{
case 1: formatex(hudmsg,charsmax(hudmsg),"FIRSTBLOOD! %s умер первым!",vname );
case 2: formatex(hudmsg,charsmax(hudmsg),"ПЕРВАЯ КРОВЬ! %s убит!",vname );
case 3: formatex(hudmsg,charsmax(hudmsg),"%s отличился и умер первым!",vname );
case 4: formatex(hudmsg,charsmax(hudmsg),"%s первая жертва!",vname );
case 5: formatex(hudmsg,charsmax(hudmsg),"%s is DEAD!",vname );
case 6: formatex(hudmsg,charsmax(hudmsg),"%s убил %s!",aname,vname );
case 7: formatex(hudmsg,charsmax(hudmsg),"%s почувствувал вкус первой крови !",aname);
case 8: formatex(hudmsg,charsmax(hudmsg),"%s пролил первую кровь!",aname);
}
new players[32], numplayers;
get_players( players, numplayers,"ch");
for (new i = 0; i < numplayers; i++)
{
if(pl_data[players[i]][INFO])
{
set_dhudmessage(random_num(0,255),random_num(0,255),random_num(0,255),random_float(0.1,0.7),random_float(0.1,0.25),0,0.0,6.0,0.0,2.0);
show_dhudmessage( players[i], iHS ? "HEADSHOT! %s" : "%s", hudmsg);
}
}
gl_data[firstkill] = false;
}
public eventDamage (v)
{
static a, iPart;
a = get_user_attacker(v,"",iPart);
if(!v || a > MaxClients) return;
if(!a || a > MaxClients) return;
if(v == a) return;
static iDmg,Float:GAME_TIME, R,G,B;
iDmg = read_data(2);
if(pl_data[a][ONOFF] > 0)
{
switch(pl_data[a][DMG_CLR])
{
case 0:R=0, G=0, B=240; //синий
case 1:R=0, G=240, B=240; //голубой
case 2:R=255, G=255, B=0; //желтый
case 3:R=255, G=0, B=0; //краный
case 4:R=255, G=255, B=255; //белый
case 5:R=208, G=32, B=144; //розовый
case 6:R=0, G=255, B=0; //зелёный
case 7:R=(random_num(0,255)), G=(random_num(0,255)), B=(random_num(0,255)); //случайный цвет, каждый выстрел новым цветом
case 8:R=244, G=222, B=204; // =)))))
}
if(pl_data[a][INFO] && iPart == HIT_HEAD)
{
set_dhudmessage(R,G,B, random_float(0.35,0.4), random_float(0.4,0.45), 0, 0.0, 1.0, 0.1, 0.2 );
show_dhudmessage( a, "HEADSHOT!");
}
if(pl_data[a][TYPE]) // если включён накопительный урон, то тут его суммируем
{
GAME_TIME = get_gametime();
if(GAME_TIME > DMG_TIME[a][v]) DMG[a][v] = 0;
DMG_TIME[a][v] = GAME_TIME + 3.5;
DMG[a][v] += iDmg;
}
switch(pl_data[a][SIZE]) // переключалка HUD / DHUD
{
case 1:
{
set_dhudmessage(R,G,B, 0.53, 0.52, 0, 0.0, 0.5, 0.0, 0.1);
show_dhudmessage( a,(pl_data[a][ONOFF]==2) ? "%d" : "*", pl_data[a][TYPE] ? DMG[a][v] : iDmg); //выводим нанесённый урон обычный/накопительный
}
case 0:
{
set_hudmessage(R,G,B, _, 0.55, _, _, 1.0, _, 0.0, -1);
ShowSyncHudMsg( a, gl_data[g_1], (pl_data[a][ONOFF]==2) ? "%d" : "*", pl_data[a][TYPE] ? DMG[a][v] : iDmg); //выводим нанесённый урон обычный/накопительный
}
}
}
if(pl_data[v][DMGIN] && pl_data[v][ONOFF] > 0)
{
switch(pl_data[v][SIZE])
{
case 1:
{
set_dhudmessage(255, 0, 0, 0.47, 0.52, 0, 0.0, 0.5, 0.0, 0.1);
show_dhudmessage( v, (pl_data[a][ONOFF]==2) ? "%d" : "*", iDmg);
}
case 0:
{
set_hudmessage(255, 0, _, 0.45, -1.0, _, _, 1.0, _, 0.0, -1);
ShowSyncHudMsg( v, gl_data[g_2], (pl_data[a][ONOFF]==2) ? "%d" : "*", iDmg);
}
}
}
}
public SaveData(id) // сохраняем настройки в vault
{
new s_Key[40], s_data[256];
new s_TYPE,s_INFO,s_DMGIN;
s_TYPE = _:pl_data[id][TYPE];
s_INFO = _:pl_data[id][INFO];
s_DMGIN = _:pl_data[id][DMGIN];
format(s_data,charsmax(s_data),"%i#%i#%i#%i#%i#%i#", pl_data[id][ONOFF],s_TYPE,pl_data[id][SIZE],s_INFO,pl_data[id][DMG_CLR],s_DMGIN);
format(s_Key, charsmax(s_Key), "%s", AuthID[id]);
nvault_pset(gl_data[gVault], s_Key, s_data);
pl_data[id][SAVED] = true;
client_print(id,print_console,"%s",s_data); // тестовое сообщение
}
public LoadData(id)
{
if(pl_data[id][VIP]) // если игрок ВИП то пробуем загрузить настройки
{
get_user_authid(id, AuthID[id], charsmax(AuthID[]));
pl_data[id][SAVED] = true;
new s_Key[40], s_data[256],i_DataExists,iTimestamp;
i_DataExists = nvault_lookup(gl_data[gVault],AuthID[id], s_data, charsmax(s_data),iTimestamp);
if (i_DataExists)
{
new st_ONOFF[10],st_TYPE[10],st_SIZE[10],st_INFO[10],st_DMG_CLR[10],st_DMGIN[10];
format(s_Key,charsmax(s_Key),"%s",AuthID[id]);
nvault_get(gl_data[gVault],s_Key,s_data,charsmax(s_data));
replace_all(s_data, 255, "#", " ");
parse(s_data, st_ONOFF,charsmax(st_ONOFF), st_TYPE, charsmax(st_TYPE),st_SIZE, charsmax(st_SIZE),st_INFO,charsmax(st_INFO), st_DMG_CLR,charsmax(st_DMG_CLR),st_DMGIN,charsmax(st_DMGIN));
pl_data[id][DMG_CLR]= str_to_num(st_DMG_CLR);
pl_data[id][SIZE] = str_to_num(st_SIZE);
pl_data[id][ONOFF] = str_to_num(st_ONOFF);
pl_data[id][TYPE] = bool:str_to_num(st_TYPE); // получаем boolean
pl_data[id][INFO] = bool:str_to_num(st_INFO); //получаем boolean
pl_data[id][DMGIN] = bool:str_to_num(st_DMGIN); // получаем boolean
return;
}
}
pl_data[id][DMGIN]= pl_data[id][INFO]= true;
pl_data[id][TYPE] =false;
pl_data[id][SIZE] = 0;
pl_data[id][DMG_CLR] =1;
pl_data[id][ONOFF]= pl_data[id][VIP] ? 2 : 1;
}
мужики, помогите пожалуйста, раньше видел на форуме данную тему и вроде там был ответ, тему так и не нашел
у меня узкий кругозор мышления в плагинах, пожалуйста без токса
у меня узкий кругозор мышления в плагинах, пожалуйста без токса
В этой теме было размещено решение! Перейти к решению.
Вложения
-
66.1 KB Просмотры: 83
Последнее редактирование: