hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.06.17. 01:38



Jelenlévő felhasználók

Jelenleg 438 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 437 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: Google [Bot] az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: kirugási indok
HozzászólásElküldve: 2014.08.12. 17:22 
Offline
Senior Tag

Csatlakozott: 2013.07.29. 13:15
Hozzászólások: 233
Megköszönt másnak: 125 alkalommal
Üdv. Nekem egy olyan plugin kellene amivel ha valakit kickelni akarok akkor megkell adni az okot. (van fen egy kirugási indok menü de az nem jó mert menüs nekem olyan kell amivel olyan okot adok amilyet akarok)


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: kirugási indok
HozzászólásElküldve: 2014.08.12. 22:45 
Offline
Beavatott
Avatar

Csatlakozott: 2014.04.14. 21:21
Hozzászólások: 88
Megköszönt másnak: 6 alkalommal
Megköszönték neki: 4 alkalommal
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4.  
  5. #define PLUGIN "Reason_Kicker"
  6. #define AUTHOR "Tramp"
  7. #define VERSION "0.1"
  8.  
  9. new g_menuPosition[33];
  10. new g_menuPlayers[33][32];
  11. new g_menuPlayersNum[33];
  12. new g_coloredMenus;
  13. new g_kickReasons[7][128];
  14. new g_lastCustom[33][128];
  15. new g_inCustomReason[33];
  16. new g_kickedPlayer;
  17.  
  18. #define MAXSLOTS 32
  19.  
  20. enum Color
  21. {
  22. YELLOW = 1, // Yellow
  23. GREEN, // Green Color
  24. TEAM_COLOR, // Red, grey, blue
  25. GREY, // grey
  26. RED, // Red
  27. BLUE, // Blue
  28. }
  29.  
  30. new TeamInfo;
  31. new SayText;
  32. new MaxSlots;
  33.  
  34. new TeamName[][] =
  35. {
  36. "",
  37. "TERRORIST",
  38. "CT",
  39. "SPECTATOR"
  40. }
  41.  
  42. new bool:IsConnected[MAXSLOTS + 1];
  43.  
  44.  
  45. public plugin_init()
  46. {
  47. register_dictionary("common.txt")
  48. register_dictionary("admincmd.txt")
  49. register_dictionary("plmenu.txt")
  50. register_plugin(PLUGIN, VERSION, AUTHOR)
  51. register_cvar(PLUGIN, VERSION, FCVAR_SERVER|FCVAR_SPONLY);
  52. register_clcmd("amx_kickmenu", "cmdKickMenu", ADMIN_KICK, "- displays kick menu")
  53. register_clcmd("amx_customkickreason", "setCustomKickReason", ADMIN_KICK, "- configures custom ban message")
  54. register_menucmd(register_menuid("Kirugas Menu"), 1023, "actionKickMenu")
  55. register_menucmd(register_menuid("Kirugas Indok Menu"), 1023, "actionKickMenuReason")
  56.  
  57. register_cvar("amx_kick_r1","");
  58. register_cvar("amx_kick_r2","");
  59. register_cvar("amx_kick_r3","");
  60. register_cvar("amx_kick_r4","");
  61. register_cvar("amx_kick_r5","");
  62. register_cvar("amx_kick_r6","");
  63. register_cvar("amx_kick_r7","");
  64.  
  65. new k1[32], k2[32], k3[32], k4[32], k5[32], k6[32], k7[32];
  66.  
  67. get_cvar_string("amx_kick_r1",k1, 31);
  68. get_cvar_string("amx_kick_r2",k2, 31);
  69. get_cvar_string("amx_kick_r3",k3, 31);
  70. get_cvar_string("amx_kick_r4",k4, 31);
  71. get_cvar_string("amx_kick_r5",k5, 31);
  72. get_cvar_string("amx_kick_r6",k6, 31);
  73. get_cvar_string("amx_kick_r7",k7, 31);
  74.  
  75. set_task(320.0, "ads", 7777, "", 0, "b");
  76.  
  77. g_kickReasons[0] = k1
  78. g_kickReasons[1] = k2
  79. g_kickReasons[2] = k3
  80. g_kickReasons[3] = k4
  81. g_kickReasons[4] = k5
  82. g_kickReasons[5] = k6
  83. g_kickReasons[6] = k7
  84.  
  85. TeamInfo = get_user_msgid("TeamInfo");
  86. SayText = get_user_msgid("SayText");
  87. MaxSlots = get_maxplayers();
  88. }
  89.  
  90. public cmdKickMenu(id, level, cid)
  91. {
  92. if (cmd_access(id, level, cid, 1))
  93. displayKickMenu(id, g_menuPosition[id] = 0)
  94.  
  95. return PLUGIN_HANDLED
  96. }
  97.  
  98. public ads()
  99. {
  100.  
  101. for (new i = 1; i <= 32; i++)
  102. {
  103. if (is_user_connected(i))
  104. {
  105. ColorChat(i, GREY, " ");
  106. ColorChat(i, GREY, " ");
  107. }
  108. }
  109.  
  110.  
  111. }
  112.  
  113. displayKickMenu(id, pos)
  114. {
  115. if (pos < 0)
  116. return
  117.  
  118. get_players(g_menuPlayers[id], g_menuPlayersNum[id])
  119.  
  120. new menuBody[512]
  121. new b = 0
  122. new i
  123. new name[32]
  124. new start = pos * 8
  125.  
  126. if (start >= g_menuPlayersNum[id])
  127. start = pos = g_menuPosition[id] = 0
  128.  
  129. new len = format(menuBody, 511, g_coloredMenus ? "\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n", id, "KICK_MENU", pos + 1, (g_menuPlayersNum[id] / 8 + ((g_menuPlayersNum[id] % 8) ? 1 : 0)))
  130. new end = start + 8
  131. new keys = MENU_KEY_0
  132.  
  133. if (end > g_menuPlayersNum[id])
  134. end = g_menuPlayersNum[id]
  135.  
  136. for (new a = start; a < end; ++a)
  137. {
  138. i = g_menuPlayers[id][a]
  139. get_user_name(i, name, 31)
  140.  
  141. if (access(i, ADMIN_IMMUNITY))
  142. {
  143. ++b
  144.  
  145. if (g_coloredMenus)
  146. len += format(menuBody[len], 511-len, "\d%d. %s^n\w", b, name)
  147. else
  148. len += format(menuBody[len], 511-len, "#. %s^n", name)
  149. } else {
  150. keys |= (1<<b)
  151.  
  152. if (is_user_admin(i))
  153. len += format(menuBody[len], 511-len, g_coloredMenus ? "%d. %s \r*^n\w" : "%d. %s *^n", ++b, name)
  154. else
  155. len += format(menuBody[len], 511-len, "%d. %s^n", ++b, name)
  156. }
  157. }
  158.  
  159. if (end != g_menuPlayersNum[id])
  160. {
  161. format(menuBody[len], 511-len, "^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
  162. keys |= MENU_KEY_9
  163. }
  164. else
  165. format(menuBody[len], 511-len, "^n0. %L", id, pos ? "BACK" : "EXIT")
  166.  
  167. show_menu(id, keys, menuBody, -1, "Kirugas Menu")
  168. }
  169.  
  170. public actionKickMenu(id, key)
  171. {
  172. switch (key)
  173. {
  174. case 8: displayKickMenu(id, ++g_menuPosition[id])
  175. case 9: displayKickMenu(id, --g_menuPosition[id])
  176. default:
  177. {
  178. /* new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key]
  179. new authid[32], authid2[32], name[32], name2[32]
  180.  
  181. get_user_authid(id, authid, 31)
  182. get_user_authid(player, authid2, 31)
  183. get_user_name(id, name, 31)
  184. get_user_name(player, name2, 31)
  185.  
  186. new userid2 = get_user_userid(player)
  187.  
  188. log_amx("Kick: ^"%s<%d><%s><>^" kirugva ^"%s<%d><%s><>^"", name, get_user_userid(id), authid, name2, userid2, authid2)
  189.  
  190. show_activity_key("ADMIN_KICK_1", "ADMIN_KICK_2", name, name2);
  191.  
  192.  
  193. server_cmd("kick #%d", userid2)
  194. server_exec() */
  195.  
  196. g_kickedPlayer = g_menuPlayers[id][g_menuPosition[id] * 8 + key]
  197.  
  198. displayKickMenuReason(id)
  199. }
  200. }
  201.  
  202. return PLUGIN_HANDLED
  203. }
  204.  
  205. displayKickMenuReason(id)
  206. {
  207. new menuBody[1024]
  208. new len = format(menuBody,1023, g_coloredMenus ? "\y%s\R^n\w^n" : "%s^n^n", "Reason")
  209. new i = 0;
  210.  
  211. while (i < 7)
  212. {
  213. if (strlen(g_kickReasons[i]))
  214. len+=format(menuBody[len],1023-len,"%d. %s^n",i+1,g_kickReasons[i])
  215.  
  216. i++
  217. }
  218.  
  219. len+=format(menuBody[len],1023-len,"^n8. Szokas^n")
  220. if (g_lastCustom[id][0]!='^0')
  221. len+=format(menuBody[len],1023-len,"^n9. %s^n",g_lastCustom[id])
  222.  
  223. len+=format(menuBody[len],1023-len,"^n0. %L^n",id,"EXIT")
  224.  
  225. len+=format(menuBody[len],1023-len, g_coloredMenus ? "^n\yKirugas Indoklo Menu: %s^n" : "^nKirugas Indoklo Menu: %s\w^n", VERSION)
  226.  
  227. new keys = MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_5 | MENU_KEY_6 | MENU_KEY_7 | MENU_KEY_8 | MENU_KEY_0
  228.  
  229. if (g_lastCustom[id][0]!='^0')
  230. keys |= MENU_KEY_9
  231.  
  232. show_menu(id,keys,menuBody,-1,"Kirugas Indok Menu")
  233. }
  234.  
  235. public actionKickMenuReason(id,key)
  236. {
  237. switch (key)
  238. {
  239. case 9:
  240. {
  241. displayKickMenu(id,g_menuPosition[id])
  242. }
  243.  
  244. case 7:
  245. {
  246. g_inCustomReason[id]=1
  247. client_cmd(id,"messagemode amx_customkickreason")
  248.  
  249. return PLUGIN_HANDLED
  250. }
  251.  
  252. case 8:
  253. {
  254. kickUser(id,g_lastCustom[id])
  255. }
  256.  
  257. default:
  258. {
  259. kickUser(id,g_kickReasons[key])
  260. }
  261. }
  262. displayKickMenu(id,g_menuPosition[id] = 0)
  263.  
  264. return PLUGIN_HANDLED
  265. }
  266.  
  267. public setCustomKickReason(id,level,cid)
  268. {
  269. if (!cmd_access(id,level,cid,1))
  270. {
  271. return PLUGIN_HANDLED
  272. }
  273.  
  274. new szReason[128]
  275. read_argv(1,szReason,127)
  276. copy(g_lastCustom[id],127,szReason)
  277.  
  278. if (g_inCustomReason[id])
  279. {
  280. g_inCustomReason[id]=0
  281. kickUser(id,g_lastCustom[id])
  282. }
  283.  
  284. return PLUGIN_HANDLED
  285. }
  286.  
  287. kickUser(id,kickReason[])
  288. {
  289. new player = g_kickedPlayer;
  290.  
  291. new name[32], name2[32], authid[32],authid2[32]
  292. get_user_name(player,name2,31)
  293. get_user_authid(player,authid2,31)
  294. get_user_authid(id,authid,31)
  295. get_user_name(id,name,31)
  296.  
  297.  
  298. new userid2 = get_user_userid(player);
  299. client_print(0,print_chat,"Te ID-d: %d ", userid2);
  300.  
  301. log_amx("Kick: ^"%s<%d><%s><>^" kirugva ^"%s<%d><%s><>Indok: %s^"", name, get_user_userid(id), authid, name2, userid2, authid2, kickReason)
  302.  
  303. set_hudmessage(0, 255, 0, 0.05, 0.35, 0, 6.0, 5.0, 0.5, 0.15, 7);
  304. show_hudmessage(0, "Jatekos %s -t ^nKirugtak: %s -t ^nIndok: %s", name2, name, kickReason);
  305. client_print(0,print_chat,"Jatekos %s -t ^nKirugta admin by: %s ^nIndok: %s", name2, name, kickReason);
  306.  
  307. server_cmd("kick #%d ^"%s^"",userid2,kickReason)
  308.  
  309.  
  310. }
  311.  
  312. public client_putinserver(player)
  313. {
  314. IsConnected[player] = true;
  315. }
  316.  
  317. public client_disconnect(player)
  318. {
  319. IsConnected[player] = false;
  320. }
  321.  
  322. public ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
  323. {
  324. static message[256];
  325.  
  326. switch(type)
  327. {
  328. case YELLOW: // Yellow
  329. {
  330. message[0] = 0x01;
  331. }
  332. case GREEN: // Green
  333. {
  334. message[0] = 0x04;
  335. }
  336. default: // White, Red, Blue
  337. {
  338. message[0] = 0x03;
  339. }
  340. }
  341.  
  342. vformat(message[1], 251, msg, 4);
  343.  
  344. // Make sure message is not longer than 192 character. Will crash the server.
  345. message[192] = '^0';
  346.  
  347. new team, ColorChange, index, MSG_Type;
  348.  
  349. if(!id)
  350. {
  351. index = FindPlayer();
  352. MSG_Type = MSG_ALL;
  353.  
  354. } else {
  355. MSG_Type = MSG_ONE;
  356. index = id;
  357. }
  358.  
  359. team = get_user_team(index);
  360. ColorChange = ColorSelection(index, MSG_Type, type);
  361.  
  362. ShowColorMessage(index, MSG_Type, message);
  363.  
  364. if(ColorChange)
  365. {
  366. Team_Info(index, MSG_Type, TeamName[team]);
  367. }
  368. }
  369.  
  370. ShowColorMessage(id, type, message[])
  371. {
  372. message_begin(type, SayText, _, id);
  373. write_byte(id)
  374. write_string(message);
  375. message_end();
  376. }
  377.  
  378. Team_Info(id, type, team[])
  379. {
  380. message_begin(type, TeamInfo, _, id);
  381. write_byte(id);
  382. write_string(team);
  383. message_end();
  384.  
  385. return 1;
  386. }
  387.  
  388. ColorSelection(index, type, Color:Type)
  389. {
  390. switch(Type)
  391. {
  392. case RED:
  393. {
  394. return Team_Info(index, type, TeamName[1]);
  395. }
  396. case BLUE:
  397. {
  398. return Team_Info(index, type, TeamName[2]);
  399. }
  400. case GREY:
  401. {
  402. return Team_Info(index, type, TeamName[0]);
  403. }
  404. }
  405.  
  406. return 0;
  407. }
  408.  
  409. FindPlayer()
  410. {
  411. new i = -1;
  412.  
  413. while(i <= MaxSlots)
  414. {
  415. if(IsConnected[++i])
  416. {
  417. return i;
  418. }
  419. }
  420.  
  421. return -1;
  422. }


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 2 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 98 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole