Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Wklejka 131720841012053 dodana przez Hiroshima, 28.09.2011 12:13
Typ:


...
131720841012053
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
325.
326.
327.
328.
329.
330.
331.
332.
333.
334.
335.
336.
337.
338.
339.
340.
341.
342.
343.
344.
345.
346.
347.
348.
349.
350.
351.
352.
353.
354.
355.
356.
357.
358.
359.
360.
361.
362.
363.
364.
365.
366.
367.
368.
369.
370.
371.
372.
373.
374.
375.
376.
377.
378.
379.
380.
381.
382.
383.
384.
385.
386.
387.
388.
389.
390.
391.
392.
393.
394.
395.
396.
397.
398.
399.
400.
401.
402.
403.
404.
405.
406.
407.
408.
409.
410.
411.
412.
413.
414.
415.
416.
417.
418.
419.
420.
421.
422.
423.
424.
425.
426.
427.
428.
429.
430.
431.
432.
433.
434.
435.
436.
437.
438.
439.
440.
441.
442.
443.
444.
445.
446.
447.
448.
449.
450.
451.
452.
453.
454.
455.
456.
457.
458.
459.
460.
461.
462.
463.
464.
465.
466.
467.
468.
469.
470.
471.
472.
473.
474.
475.
476.
477.
478.
479.
480.
481.
482.
483.
484.
485.
486.
487.
488.
489.
490.
491.
492.
493.
494.
495.
496.
497.
498.
499.
500.
501.
502.
503.
504.
505.
506.
507.
508.
509.
510.
511.
512.
513.
514.
515.
516.
517.
518.
519.
520.
521.
522.
523.
524.
525.
526.
527.
528.
529.
530.
531.
532.
533.
534.
535.
536.
537.
538.
539.
540.
541.
542.
543.
544.
545.
546.
547.
548.
549.
550.
551.
552.
553.
554.
555.
556.
557.
558.
559.
560.
561.
562.
563.
564.
565.
566.
567.
568.
569.
570.
571.
572.
573.
574.
575.
576.
577.
578.
579.
580.
581.
582.
583.
584.
585.
586.
587.
588.
589.
590.
591.
592.
593.
594.
595.
596.
597.
598.
599.
600.
601.
602.
603.
604.
605.
606.
607.
608.
609.
610.
611.
612.
613.
614.
615.
616.
617.
618.
619.
620.
621.
622.
623.
624.
625.
626.
627.
628.
629.
630.
631.
632.
633.
634.
635.
636.
637.
638.
639.
640.
641.
642.
643.
644.
645.
646.
647.
648.
649.
650.
651.
652.
653.
654.
655.
656.
657.
658.
659.
660.
661.
662.
663.
664.
665.
666.
667.
668.
669.
670.
671.
672.
673.
674.
675.
676.
677.
678.
679.
680.
681.
682.
683.
684.
685.
686.
687.
688.
689.
690.
691.
692.
693.
694.
695.
696.
697.
698.
699.
700.
701.
702.
703.
704.
705.
706.
707.
708.
709.
710.
711.
712.
713.
714.
715.
716.
717.
718.
719.
720.
721.
722.
723.
724.
725.
726.
727.
728.
729.
730.
731.
732.
733.
734.
735.
736.
737.
738.
739.
740.
741.
742.
743.
744.
745.
746.
747.
748.
749.
750.
751.
752.
753.
754.
755.
756.
757.
758.
759.
760.
761.
762.
763.
764.
765.
766.
767.
768.
769.
770.
771.
772.
773.
774.
775.
776.
777.
778.
779.
780.
781.
782.
783.
784.
785.
786.
787.
788.
789.
790.
791.
792.
793.
794.
795.
796.
797.
798.
799.
800.
801.
802.
803.
804.
805.
806.
807.
808.
809.
810.
811.
812.
813.
814.
815.
816.
817.
818.
819.
820.
821.
822.
823.
824.
825.
826.
827.
828.
829.
830.
831.
832.
833.
834.
835.
836.
837.
838.
839.
840.
841.
842.
843.
844.
845.
846.
847.
848.
849.
850.
851.
852.
853.
854.
855.
856.
857.
858.
859.
860.
861.
862.
863.
864.
865.
866.
867.
868.
869.
870.
871.
872.
873.
874.
875.
876.
877.
878.
879.
880.
881.
882.
883.
884.
885.
886.
887.
888.
889.
890.
891.
892.
893.
894.
895.
896.
897.
898.
899.
900.
901.
902.
903.
904.
905.
906.
907.
908.
909.
910.
911.
912.
913.
914.
915.
916.
917.
918.
919.
920.
921.
922.
923.
924.
925.
926.
927.
928.
929.
930.
931.
932.
933.
934.
935.
936.
937.
938.
939.
940.
941.
942.
943.
944.
945.
946.
947.
948.
949.
950.
951.
952.
953.
954.
955.
956.
957.
958.
959.
960.
961.
962.
963.
964.
965.
966.
967.
968.
969.
970.
971.
972.
973.
974.
975.
976.
977.
978.
979.
980.
981.
982.
983.
984.
985.
986.
987.
988.
989.
990.
991.
992.
993.
994.
995.
996.
997.
998.
999.
1000.
1001.
1002.
1003.
1004.
1005.
1006.
1007.
1008.
1009.
1010.
1011.
1012.
1013.
1014.
1015.
1016.
1017.
1018.
1019.
1020.
1021.
1022.
1023.
1024.
1025.
1026.
1027.
1028.
1029.
1030.
1031.
1032.
1033.
1034.
1035.
1036.
1037.
1038.
1039.
1040.
1041.
1042.
1043.
1044.
1045.
1046.
1047.
1048.
1049.
1050.
1051.
1052.
1053.
1054.
1055.
1056.
1057.
1058.
1059.
1060.
1061.
1062.
1063.
1064.
1065.
1066.
1067.
1068.
1069.
1070.
1071.
1072.
1073.
1074.
1075.
1076.
1077.
1078.
1079.
1080.
1081.
1082.
1083.
1084.
1085.
1086.
1087.
1088.
1089.
1090.
1091.
1092.
1093.
1094.
1095.
1096.
1097.
1098.
1099.
1100.
1101.
1102.
1103.
1104.
1105.
1106.
1107.
1108.
1109.
1110.
1111.
1112.
1113.
1114.
1115.
1116.
1117.
1118.
1119.
1120.
1121.
1122.
1123.
1124.
1125.
1126.
1127.
1128.
1129.
1130.
1131.
1132.
1133.
1134.
1135.
1136.
1137.
1138.
1139.
1140.
1141.
1142.
1143.
1144.
1145.
1146.
1147.
1148.
1149.
1150.
1151.
1152.
1153.
1154.
1155.
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#include <zombieplague>
////////// PLUGIN SETTINGS //////////
#define MODE 3
#define CHAT_PREFIX "[VIP]"
// (Only if MODE 1 is turrned OFF. Otherwise set flags in vips.ini.) //
#define VIPACCES ADMIN_LEVEL_H
#define MJACCES ADMIN_LEVEL_H
////////// SETTINGS END //////////
// Flags
#define FLAG_A (1<<0)
#define FLAG_B (1<<1)
#define FLAG_C (1<<2)
#define FLAG_D (1<<3)
#define FLAG_E (1<<4)
#define FLAG_K (1<<10)
#define VERSION "1.6"
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4
const DMG_HEGRENADE = (1<<24)
#if MODE & (1<<0) || MODE & (1<<1)
new amx_password_field_string[31]
#endif
#if MODE & (1<<0)
new g_user_privileges[33]
enum _:database_items
{
auth[50],
password[50],
accessflags,
flags
}
new vips_database[database_items]
new Array:database_holder
#endif
#if MODE & (1<<1)
const ZV_PLUGIN_HANDLED = 97
enum _:items
{
i_name[31],
i_description[31],
i_cost,
i_team
}
new g_register_in_zp_extra
new g_zp_extra_item_number
new g_menu_close
new extra_items[items]
new Array:items_database
new g_registered_items_count
new g_forward_return
new g_extra_item_selected
#endif
#if MODE == 3
new g_vip_buy_time
new g_vip_cost_ammo
new g_vip_buy_flags
new days
new months
new years
#endif
new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }
static const CONTACT[] = ""
new g_jumps, g_armor, g_killammo, g_infectammo, g_infecthealth, g_nemhealth, g_show_vips, g_unlimited_clip, g_damage_reward, g_damage_increase
new g_bit
new maxplayers, g_msgSayText
new jumpnum[33]
new bool:dojump[33]
new Float:g_damage[33]
public plugin_init() {
 
register_plugin("ZM VIP", VERSION, "aaarnas")
RegisterHam(Ham_Spawn, "player", "FwdHamPlayerSpawnPost", 1)
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
register_event("ResetHUD", "HUDReset", "be")
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
maxplayers = get_maxplayers()
g_msgSayText = get_user_msgid("SayText")
 
g_jumps = register_cvar("zp_vip_jumps", "1")
g_bit = get_pcvar_num(register_cvar("zp_vip_allow_jump", "3"))
g_armor = register_cvar("zp_vip_armor", "65")
g_killammo = register_cvar("zp_vip_killammo", "2")
g_infectammo = register_cvar("zp_vip_infectammo", "2")
g_infecthealth = register_cvar("zp_vip_infecthealth", "300")
g_nemhealth = register_cvar("zp_vip_nemextra", "1")
g_show_vips = register_cvar("zp_vip_show", "1")
g_unlimited_clip = register_cvar("zp_vip_unlimited_ammo", "0")
g_damage_reward = register_cvar("zp_vip_damage_reward", "500")
g_damage_increase = register_cvar("zp_vip_damage_increase", "1.5")
register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
register_cvar("zp_vip_version", VERSION, FCVAR_SERVER|FCVAR_SPONLY)
set_cvar_string("zp_vip_version", VERSION)
#if MODE & (1<<0) || MODE & (1<<1)
get_cvar_string("amx_password_field", amx_password_field_string, 30)
register_dictionary("zm_vip.txt")
#endif
#if MODE & (1<<0) && MODE & (1<<1)
g_vip_cost_ammo = register_cvar("zp_vip_cost_ammo", "0")
g_vip_buy_time = register_cvar("zp_vip_buy_time", "7")
g_vip_buy_flags = register_cvar("zp_vip_buy_flags", "abcd")
set_task(5.0,"check_date",0)
#endif
#if MODE & (1<<0)
register_concmd("amx_reloadvips", "reload_vips", ADMIN_CFG)
reload_vips()
#endif
#if MODE & (1<<1)
register_clcmd("say /vm", "menu_open")
g_register_in_zp_extra = register_cvar("zp_vip_register_in_zp_extra", "1")
g_menu_close = register_cvar("zp_vip_menu_close", "1")
items_database = ArrayCreate(items)
 
new temp[31]
formatex(temp, 30, "%L", LANG_PLAYER, "VIP_EXTRA_NAME")
if(get_pcvar_num(g_register_in_zp_extra)) g_zp_extra_item_number = zp_register_extra_item(temp, 0, 0)
g_extra_item_selected = CreateMultiForward("zv_extra_item_selected", ET_CONTINUE, FP_CELL, FP_CELL)
#endif
register_clcmd("say /vips", "print_adminlist")
register_clcmd("say /vip", "ShowMotd")
}
public plugin_cfg()
{
new directory[31]
get_configsdir(directory, 30)
server_cmd("exec %s/zm_vip.cfg", directory)
}
#if MODE & (1<<1) || MODE & (1<<0)
public plugin_natives() {
#if MODE & (1<<1)
register_native("zv_register_extra_item", "native_zv_register_extra_item", 1)
#endif
#if MODE & (1<<0)
register_native("zv_get_user_flags", "native_zv_get_user_flags", 1)
#endif
}
#endif
public FwdHamPlayerSpawnPost(id) {
#if MODE & (1<<0)
if(!(g_user_privileges[id] & FLAG_A))
#else
if(!(get_user_flags(id) & VIPACCES))
#endif
  return PLUGIN_HANDLED;
if(pev(id, pev_armorvalue) < get_pcvar_num(g_armor))
set_pev(id, pev_armorvalue, float(get_pcvar_num(g_armor)))
return HAM_IGNORED;
}
public fw_PlayerKilled(victim, attacker) {
#if MODE & (1<<0)
if(is_user_alive(attacker) && g_user_privileges[attacker] & FLAG_A) {
#else
if(is_user_alive(attacker) && get_user_flags(attacker) & VIPACCES) {
#endif
  if(zp_get_user_zombie(attacker) && !(zp_get_user_nemesis(attacker) && !get_pcvar_num(g_nemhealth))) fm_set_user_health(attacker, (pev(attacker, pev_health) + get_pcvar_num(g_infecthealth)))
  zp_set_user_ammo_packs(attacker, zp_get_user_ammo_packs(attacker) + get_pcvar_num(g_killammo))
}
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) {
 
if(victim == attacker)
  return HAM_IGNORED
 
if(damage_type & DMG_HEGRENADE)
  return HAM_IGNORED
 
if(!is_user_connected(attacker))
  return HAM_IGNORED
 
if(zp_get_user_zombie(attacker) || zp_get_user_survivor(attacker))
  return HAM_IGNORED
 
#if MODE & (1<<0)
if(g_user_privileges[attacker] & FLAG_D) {
#else
if(get_user_flags(attacker) & VIPACCES) {
#endif
  if(get_pcvar_num(g_damage_reward) != 0) {
   g_damage[attacker]+damage
   if(g_damage[attacker] > float(get_pcvar_num(g_damage_reward))) {
    zp_set_user_ammo_packs(attacker, zp_get_user_ammo_packs(attacker)+1)
    g_damage[attacker] -= float(get_pcvar_num(g_damage_reward))
   }
  }
}
#if MODE & (1<<0)
if(g_user_privileges[attacker] & FLAG_D) {
#else
if(get_user_flags(attacker) & VIPACCES) {
#endif
  damage *= get_pcvar_float(g_damage_increase)
  SetHamParamFloat(4, damage)
}
return HAM_IGNORED
 
}
public zp_user_infected_post(id, infector, nemesis) {
 
setVip()
#if MODE & (1<<0)
if(g_user_privileges[infector] & FLAG_A) {
#else
if(get_user_flags(infector) & VIPACCES) {
#endif
  fm_set_user_health(infector, (pev(infector, pev_health) + get_pcvar_num(g_infecthealth)))
  zp_set_user_ammo_packs(infector, zp_get_user_ammo_packs(infector) + get_pcvar_num(g_infectammo))
}
}
public client_connect(id) {
 
jumpnum[id] = 0
g_damage[id] = 0.0
dojump[id] = false
#if MODE & (1<<0)
set_flags(id)
if(get_pcvar_num(g_show_vips) == 1 && g_user_privileges[id] & FLAG_A) {
#else
if(get_pcvar_num(g_show_vips) == 1 && get_user_flags(id) & VIPACCES) {
#endif
  new name[100]
  get_user_name(id, name, 100)
  client_printcolor(0, "/g%L", LANG_PLAYER, "VIP_CONNECTED", name)
}
}
#if MODE & (1<<1)
public zp_extra_item_selected(id, item_id)
if(item_id == g_zp_extra_item_number)
  menu_open(id)
public menu_open(id) {
#if MODE & (1<<0)
if(g_user_privileges[id] & FLAG_E)
  vip_menu(id)
else if(g_user_privileges[id] > 0) client_printcolor(id, "/g%s /y%L", CHAT_PREFIX, id, "OFF")
#else
if(get_user_flags(id) & VIPACCES)
  vip_menu(id)
#endif
#if MODE & (1<<0)
else if(get_pcvar_num(g_vip_cost_ammo) != 0)
  buy_meniu(id)
#endif
else client_printcolor(id, "/g%s /y%L", CHAT_PREFIX, id, "NOT_A_VIP")
return ZP_PLUGIN_HANDLED
}
 
public vip_menu(id)
{
if(g_registered_items_count == 0) {
  client_printcolor(id, "/g%s /y%L", CHAT_PREFIX, id, "OFF")
  return PLUGIN_HANDLED
}
new buttons_string[16], menu_string[31], menu
formatex(menu_string, 30, "\r%L", id, "MENU_TOP")
menu = menu_create(menu_string, "vip_menu_handler")
static i, menu_item[61], team_check, num[3], ammo_packs, check
check = 0
team_check = 0
ammo_packs = zp_get_user_ammo_packs(id)
if(zp_get_user_zombie(id) && !zp_get_user_nemesis(id)) team_check |= FLAG_A
else if(!zp_get_user_zombie(id)) team_check |= FLAG_B
else if(zp_get_user_nemesis(id)) team_check |= FLAG_C
else if(zp_get_user_survivor(id)) team_check |= FLAG_D
for(i=0; i < g_registered_items_count; i++) {
  ArrayGetArray(items_database, i, extra_items)
  if(extra_items[i_team] == 0 || team_check & extra_items[i_team]) {
   formatex(menu_item, 61, "%s \r[%s] %s[%d %L]", extra_items[i_name], extra_items[i_description], ammo_packs < extra_items[i_cost] ? "\r" : "\y", extra_items[i_cost], id, "AMMO")
   formatex(num, 2, "%d", i)
   menu_additem(menu, menu_item, num, 0)
   check++
  }
}
if(check == 0) {
  client_printcolor(id, "/g%s /y%L", CHAT_PREFIX, id, "NO_ITEMS")
  return 1
}
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
formatex(buttons_string, 15, "%L", id, "NEXT")
menu_setprop(menu, MPROP_NEXTNAME, buttons_string)
formatex(buttons_string, 15, "%L", id, "BACK")
menu_setprop(menu, MPROP_BACKNAME, buttons_string)
formatex(buttons_string, 15, "%L", id, "EXIT")
menu_setprop(menu, MPROP_EXITNAME, buttons_string)
menu_display(id, menu, 0)
 
return 1
}
 
public vip_menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
  menu_destroy(menu)
  return PLUGIN_HANDLED
}
new data[6], iName[64], item_id, ammo_packs
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
item_id = str_to_num(data)
ammo_packs = zp_get_user_ammo_packs(id)
ArrayGetArray(items_database, item_id, extra_items)
if(ammo_packs >= extra_items[i_cost]) zp_set_user_ammo_packs(id, ammo_packs - extra_items[i_cost])
else {
  client_printcolor(id, "/g%s %L", CHAT_PREFIX, id, "MISSING_AMMO", extra_items[i_cost]-ammo_packs)
  if(g_menu_close) menu_destroy(menu)
  else vip_menu(id)
  return PLUGIN_HANDLED
}
item_id++
ExecuteForward(g_extra_item_selected, g_forward_return, id, item_id)
if (g_forward_return >= ZV_PLUGIN_HANDLED)
  zp_set_user_ammo_packs(id, ammo_packs)
 
if(g_menu_close) menu_destroy(menu)
else vip_menu(id)
return PLUGIN_HANDLED
}
#endif
#if MODE & (1<<0) && MODE & (1<<1)
public buy_meniu(id)
{
new buttons_string[16], menu_string[101], menu_item[31], menu
formatex(menu_string, 100, "\r%L", id, "BUY_MENU_TOP", get_pcvar_num(g_vip_cost_ammo), get_pcvar_num(g_vip_buy_time))
menu = menu_create(menu_string, "buy_menu_handler")
 
formatex(menu_item, 30, "%L", id, "BUY_MENU_TYPE1")
menu_additem(menu, menu_item, "1", 0)
formatex(menu_item, 30, "%L", id, "BUY_MENU_TYPE2")
menu_additem(menu, menu_item, "2", 0)
formatex(menu_item, 30, "%L", id, "BUY_MENU_TYPE3")
menu_additem(menu, menu_item, "3", 0)
 
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
formatex(buttons_string, 15, "%L", id, "EXIT")
menu_setprop(menu, MPROP_EXITNAME, buttons_string)
menu_display(id, menu, 0)
}
 
public buy_menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
  menu_destroy(menu)
  return PLUGIN_HANDLED
}
new data[6], iName[64], key, ammo_packs
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
key = str_to_num(data)
ammo_packs = zp_get_user_ammo_packs(id)
if(key > 1) {
  if(ammo_packs >= get_pcvar_num(g_vip_cost_ammo)) {
   amx_tempadmin(id, key)
   zp_set_user_ammo_packs(id, ammo_packs - get_pcvar_num(g_vip_cost_ammo))
   client_printcolor(id, "/g%s /y%L", CHAT_PREFIX, id, "BOUGHT_VIP", get_pcvar_num(g_vip_buy_time))
 
  }
  else client_printcolor(id, "/g%s /y%L", CHAT_PREFIX, id, "MISSING_AMMO", get_pcvar_num(g_vip_cost_ammo)-ammo_packs)
}
else {
  nick_buy_meniu(id)
  return PLUGIN_HANDLED
}
 
menu_destroy(menu)
return PLUGIN_HANDLED
}
public nick_buy_meniu(id)
{
new buttons_string[16], menu_string[151], menu_item[81], menu, client_password[21]
get_user_info(id, amx_password_field_string, client_password, 20)
formatex(menu_string, 150, "\r%L", id, "NICK_BUY_MENU_TOP", client_password)
menu = menu_create(menu_string, "nick_buy_menu_handler")
 
formatex(menu_item, 80, "%L", id, "NICK_BUY_MENU_TYPE1")
menu_additem(menu, menu_item, "1", 0)
formatex(menu_item, 80, "%L", id, "NICK_BUY_MENU_TYPE2")
menu_additem(menu, menu_item, "2", 0)
formatex(menu_item, 80, "%L", id, "NICK_BUY_MENU_TYPE3", get_pcvar_num(g_vip_cost_ammo) ,get_pcvar_num(g_vip_buy_time))
menu_additem(menu, menu_item, "3", 0)
 
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
formatex(buttons_string, 15, "%L", id, "BACK")
menu_setprop(menu, MPROP_EXITNAME, buttons_string)
menu_display(id, menu, 0)
 
}
 
public nick_buy_menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
  buy_meniu(id)
  return PLUGIN_HANDLED
}
new data[6], iName[64]
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)
switch(key) {
  case 1: {
   generate_password(id)
   nick_buy_meniu(id)
  }
  case 2: nick_buy_meniu_sec(id)
  case 3: {
   amx_tempadmin(id, 1)
   menu_destroy(menu)
   return PLUGIN_HANDLED
  }
}
return PLUGIN_HANDLED
}
public nick_buy_meniu_sec(id)
{
new menu_string[151], menu_item[51], menu
formatex(menu_string, 150, "\r%L", id, "NICK_BUY_MENU_SEC_TOP")
menu = menu_create(menu_string, "nick_buy_menu_sec_handler")
 
formatex(menu_item, 50, "%L", id, "EXIT")
menu_additem(menu, menu_item, "1", 0)
 
menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER)
menu_display(id, menu, 0)
}
 
public nick_buy_menu_sec_handler(id, menu, item)
{
nick_buy_meniu(id)
}
#endif
public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
if (!get_pcvar_num(g_unlimited_clip)) return
#if MODE & (1<<0)
if (!(g_user_privileges[msg_entity] & FLAG_C)) return
#else
if (!(get_user_flags(msg_entity) & VIPACCES)) return
#endif
if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1) return
 
static weapon, clip
weapon = get_msg_arg_int(2)
clip = get_msg_arg_int(3)
 
if (MAXCLIP[weapon] > 2)
{
  set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon])
 
  if (clip < 2)
  {
   static wname[32], weapon_ent
   get_weaponname(weapon, wname, sizeof wname - 1)
   weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
   fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
  }
}
}
public HUDReset()
setVip()
 
public setVip()
{
new players[32], pNum
get_players(players, pNum, "a")
for (new i = 0; i < pNum; i++)
{
  new id = players[i]
#if MODE & (1<<0)
  if (g_user_privileges[id] & FLAG_A)
#else
  if (get_user_flags(id) & VIPACCES)
#endif
  {
   message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"))
   write_byte(id)
   write_byte(4)
   message_end()
  }
}
return PLUGIN_HANDLED
}
public print_adminlist(user)
{
new adminnames[33][32]
new message[256]
new contactinfo[256], contact[112]
new id, count, x, len
 
for(id = 1 ; id <= maxplayers ; id++)
  if(is_user_connected(id))
#if MODE & (1<<0)
   if(g_user_privileges[id] & FLAG_A)
#else
   if(get_user_flags(id) & VIPACCES)
#endif
    get_user_name(id, adminnames[count++], 31)
len = format(message, 255, "%L ", id, "VIP_STATUS")
if(count > 0) {
  for(x = 0 ; x < count ; x++) {
   len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
   if(len > 96 ) {
    client_printcolor(user, "/g%s", message)
    len = format(message, 255, "")
   }
  }
  client_printcolor(user, "/g%s", message)
}
else {
  len += format(message[len], 255-len, "%L ", id, "VIP_STATUS_N")
  client_printcolor(user, "/g%s", message)
}
 
get_cvar_string("amx_contactinfo", contact, 63)
if(contact[0])  {
  format(contactinfo, 111, "%L ", id, "VIP_STATUS_CON", contact)
  client_printcolor(user, "/g%s", contactinfo)
}
 
}
public client_disconnect(id)
{
jumpnum[id] = 0
g_damage[id] = 0.0
dojump[id] = false
}
public client_PreThink(id)
{
#if MODE & (1<<0)
if(!is_user_alive(id) || !g_jumps || (!(g_user_privileges[id] & FLAG_B))) return PLUGIN_CONTINUE
#else
if(!is_user_alive(id) || !g_jumps || (!(get_user_flags(id) & MJACCES))) return PLUGIN_CONTINUE
#endif
new nbut = get_user_button(id)
new obut = get_user_oldbutton(id)
if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
{
  if(jumpnum[id] < get_pcvar_num(g_jumps) &&
  ((g_bit & FLAG_D && zp_get_user_nemesis(id)) ||
  (g_bit & FLAG_C && zp_get_user_survivor(id)) ||
  (g_bit & FLAG_A && !zp_get_user_zombie(id)) ||
  (g_bit & FLAG_B && zp_get_user_zombie(id) && !zp_get_user_nemesis(id))))
  {
   dojump[id] = true
   jumpnum[id]++
   return PLUGIN_CONTINUE
  }
}
if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
  jumpnum[id] = 0
  return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public client_PostThink(id)
{
#if MODE & (1<<0)
if(!is_user_alive(id) || !get_pcvar_num(g_jumps) || (!(g_user_privileges[id] & FLAG_B))) return PLUGIN_CONTINUE
#else
if(!is_user_alive(id) || !get_pcvar_num(g_jumps) || (!(get_user_flags(id) & MJACCES))) return PLUGIN_CONTINUE
#endif
if(dojump[id] == true)
{
  new Float:velocity[3]
  entity_get_vector(id,EV_VEC_velocity,velocity)
  velocity[2] = random_float(265.0,285.0)
  entity_set_vector(id,EV_VEC_velocity,velocity)
  dojump[id] = false
  return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public ShowMotd(id)
show_motd(id, "vip.txt")
#if MODE & (1<<0)
public reload_vips() {
 
if(database_holder) ArrayDestroy(database_holder)
database_holder = ArrayCreate(database_items)
new configsDir[64]
get_configsdir(configsDir, 63)
format(configsDir, 63, "%s/vips.ini", configsDir)
 
new File=fopen(configsDir,"r");
 
if (File)
{
  static Text[512], Flags[32], AuthData[50], Privileges_Flags[32], Password[50]
  while (!feof(File))
  {
   fgets(File,Text,sizeof(Text)-1);
 
   trim(Text);
 
   // comment
   if (Text[0]==';')
   {
    continue;
   }
 
   Flags[0]=0;
   AuthData[0]=0;
   Privileges_Flags[0]=0;
   Password[0]=0;
 
   // not enough parameters
   if (parse(Text,AuthData,sizeof(AuthData)-1,Password,sizeof(Password)-1,Privileges_Flags,sizeof(Privileges_Flags)-1,Flags,sizeof(Flags)-1) < 2)
   {
    continue;
   }
   vips_database[auth] = AuthData
   vips_database[password] = Password
   vips_database[accessflags] = read_flags(Privileges_Flags)
   vips_database[flags] = read_flags(Flags)
   ArrayPushArray(database_holder, vips_database)
  }
 
  fclose(File);
}
else log_amx("Error: vips.ini file doesn't exist")
}
#endif
#if MODE & (1<<0) && MODE & (1<<1)
public check_date()
{
new todaysmonth[32]
new todaysday[32]
new todaysyear[32]
get_time("%m",todaysmonth,31)
get_time("%d",todaysday,31)
get_time("%Y",todaysyear,31)
new todaysdaynum = str_to_num(todaysday)
new todaysmonthnum = str_to_num(todaysmonth)
new todaysyearnum = str_to_num(todaysyear)
new alltogether[200]
format(alltogether,199,"m%dd%dy%d",todaysmonthnum,todaysdaynum,todaysyearnum)
new configdir[200]
get_configsdir(configdir,199)
new configfile1[200]
format(configfile1,199,"%s/vips.ini",configdir)
 
new text[512], len
new pnum = file_size(configfile1,1)
for(new i = 1; i < pnum; i++)
{
  read_file(configfile1, i, text, 511, len)
  if ( contain(text, alltogether) != -1 )
  {
   DeleteLine(configfile1, i)
  }
}
return PLUGIN_HANDLED
}
public amx_tempadmin(id, type)
{
new authid[31], ip[31], name[51], client_password[21], p_flags[21]
get_pcvar_string(g_vip_buy_flags, p_flags, 20)
get_user_authid(id, authid, 30)
get_user_ip(id, ip, 30, 1)
get_user_name(id, name, 50)
get_user_info(id, amx_password_field_string, client_password, 20)
new todaysmonth[32]
new todaysday[32]
new todaysyear[32]
get_time("%m",todaysmonth,31)
get_time("%d",todaysday,31)
get_time("%Y",todaysyear,31)
new day = str_to_num(todaysday)
months = str_to_num(todaysmonth)
years = str_to_num(todaysyear)
days = day + get_pcvar_num(g_vip_buy_time)
 
if(get_pcvar_num(g_vip_buy_time) == 0 || get_pcvar_num(g_vip_buy_time)>=900)
{
  new instertintovips[200]
  switch(type) {
   case 1: formatex(instertintovips,199,"^"%s^" ^"%s^" ^"%s^" ^"b^"",name,client_password,p_flags)
   case 2: formatex(instertintovips,199,"^"%s^" ^"^" ^"%s^" ^"ce^"",authid,p_flags)
   case 3: formatex(instertintovips,199,"^"%s^" ^"^" ^"%s^" ^"de^"",ip,p_flags)
  }
  new configdir[200]
  get_configsdir(configdir,199)
  new configfile1[200]
  format(configfile1,199,"%s/vips.ini",configdir)
  write_file(configfile1,instertintovips,-1)
  server_cmd("amx_reloadvips")
  set_task(1.0, "set_flags", id)
  return PLUGIN_HANDLED
}
switch(months) {
  case 1: {
   if(days>31)
   {
    thirtyone(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 2: {
   if(days>28)
   {
    february(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 3: {
   if(days>31)
   {
    thirtyone(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 4: {
   if(days>30)
   {
    thirty(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 5: {
   if(days>31)
   {
    thirtyone(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 6: {
   if(days>30)
   {
    thirty(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 7: {
   if(days>31)
   {
    thirtyone(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 8: {
   if(days>31)
   {
    thirtyone(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 9: {
   if(days>30)
   {
    thirty(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 10: {
   if(days>31)
   {
    thirtyone(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 11: {
   if(days>30)
   {
    thirty(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 12: {
   if(days>31)
   {
    december(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
}
return PLUGIN_HANDLED
}
public makenewdate(id, type)
{
new alltogether[200], authid[31], ip[31], name[51], client_password[21], p_flags[21]
get_pcvar_string(g_vip_buy_flags, p_flags, 20)
get_user_authid(id, authid, 30)
get_user_ip(id, ip, 30, 1)
get_user_name(id, name, 50)
get_user_info(id, amx_password_field_string, client_password, 20)
format(alltogether,199,"m%dd%dy%d",months,days,years)
new instertintovips[200]
switch(type) {
  case 1: formatex(instertintovips,199,"^"%s^" ^"%s^" ^"%s^" ^"b^"; Exp: %s",name,client_password,p_flags,alltogether)
  case 2: formatex(instertintovips,199,"^"%s^" ^"^" ^"%s^" ^"ce^"; Exp: %s",authid,p_flags,alltogether)
  case 3: formatex(instertintovips,199,"^"%s^" ^"^" ^"%s^" ^"de^"; Exp: %s",ip,p_flags,alltogether)
}
new configdir[200]
get_configsdir(configdir,199)
new configfile1[200]
format(configfile1,199,"%s/vips.ini",configdir)
write_file(configfile1,instertintovips,-1)
server_cmd("amx_reloadvips")
set_task(1.0, "set_flags", id)
return PLUGIN_HANDLED
}
public december(id, type)
{
if(days>31)
{
  days = days - 31
  months = 1
  years = years + 1
  select_days(id, type)
}
else
{
  makenewdate(id, type)
}
return PLUGIN_HANDLED
}
public thirtyone(id, type)
{
if(days>31)
{
  days = days - 31
  months = months + 1
  select_days(id, type)
}
else
{
  makenewdate(id, type)
}
return PLUGIN_HANDLED
}
public thirty(id, type)
{
if(days>30)
{
  days = days - 30
  months = months + 1
  select_days(id, type)
}
else
{
  makenewdate(id, type)
}
return PLUGIN_HANDLED
}
public february(id, type)
{
if(days>28)
{
  days = days - 28
  months = 3
  select_days(id, type)
}
else
{
  makenewdate(id, type)
}
return PLUGIN_HANDLED
}
public newyear(id, type)
{
if(days>31)
{
  days = days - 31
  years = years + 1
  months = 1
  select_days(id, type)
}
else
{
  makenewdate(id, type)
}
return PLUGIN_HANDLED
}
public select_days(id, type)
{
switch(months) {
  case 1, 4, 5, 7, 8, 10: thirtyone(id, type)
  case 2: february(id, type)
  case 3, 6, 9, 11: thirty(id, type)
  case 12: newyear(id, type)
}
return PLUGIN_HANDLED
}
DeleteLine( const szFilename[ ], const iLine )
{
new iFile = fopen( szFilename, "rt" );
if( !iFile )
{
  return;
}
static const szTempFilename[ ] = "delete_line.txt";
new iTempFile = fopen( szTempFilename, "wt" );
 
new szData[ 256 ], iLineCount, bool:bReplaced = false;
while( !feof( iFile ) )
{
  fgets( iFile, szData, 255 );
 
  if( iLineCount++ == iLine )
  {
   bReplaced = true;
  }
  else
  {
   fputs( iTempFile, szData );
  }
}
 
fclose( iFile );
fclose( iTempFile );
 
if( bReplaced )
{
  delete_file( szFilename );
 
  while( !rename_file( szTempFilename, szFilename, 1 ) ) { }
}
else
{
  delete_file( szTempFilename );
}
}
#endif
stock fm_set_user_health(id, health)
{
(health > 0) ? set_pev(id, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, id);
}
stock client_printcolor(const id, const input[], any:...)
{
 
new iCount = 1, iPlayers[32]
 
static szMsg[191]
vformat(szMsg, charsmax(szMsg), input, 3)
 
replace_all(szMsg, 190, "/g", "^4") // green txt
replace_all(szMsg, 190, "/y", "^1") // orange txt
replace_all(szMsg, 190, "/ctr", "^3") // team txt
replace_all(szMsg, 190, "/w", "^0") // team txt
 
if(id) iPlayers[0] = id
else get_players(iPlayers, iCount, "ch")
 
for (new i = 0; i < iCount; i++)
{
  if (is_user_connected(iPlayers[i]))
  {
   message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
   write_byte(iPlayers[i])
   write_string(szMsg)
   message_end()
  }
}
}
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}
 
return entity;
}
stock fm_set_weapon_ammo(entity, amount)
{
set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
}
#if MODE & (1<<0)
public set_flags(id) {
 
static authid[31], ip[31], name[51], index, client_password[31], size, log_flags[11]
get_user_authid(id, authid, 30)
get_user_ip(id, ip, 30, 1)
get_user_name(id, name, 50)
get_user_info(id, amx_password_field_string, client_password, 30)
 
g_user_privileges[id] = 0
size = ArraySize(database_holder)
for(index=0; index < size ; index++) {
  ArrayGetArray(database_holder, index, vips_database)
  if(vips_database[flags] & FLAG_D) {
   if(equal(ip, vips_database[auth])) {
    if(!(vips_database[flags] & FLAG_E)) {
         if(equal(client_password, vips_database[password]))
          g_user_privileges[id] = vips_database[accessflags]
         else if(vips_database[flags] & FLAG_A) {
          server_cmd("kick #%d ^"%L^"", get_user_userid(id), id, "INV_PAS")
          break
         }
    }
    else g_user_privileges[id] = vips_database[accessflags]
    get_flags(vips_database[accessflags], log_flags, 10)
    log_amx("%L",LANG_PLAYER, "AUTHORISED", name, authid, ip, log_flags)
    break
   }
  }
  else if(vips_database[flags] & FLAG_C) {
   if(equal(authid, vips_database[auth])) {
    if(!(vips_database[flags] & FLAG_E)) {
         if(equal(client_password, vips_database[password]))
          g_user_privileges[id] = vips_database[accessflags]
         else if(vips_database[flags] & FLAG_A) {
          server_cmd("kick #%d ^"%L^"", get_user_userid(id), id, "INV_PAS")
          break
         }
    }
    else g_user_privileges[id] = vips_database[accessflags]
    get_flags(vips_database[accessflags], log_flags, 10)
    log_amx("%L",LANG_PLAYER, "AUTHORISED", name, authid, ip, log_flags)
    break
   }
  }
  else {
   if(vips_database[flags] & FLAG_K) {
    if((vips_database[flags] & FLAG_B && contain(name, vips_database[auth]) != -1) || equal(name, vips_database[auth])) {
         if(!(vips_database[flags] & FLAG_E)) {
          if(equal(client_password, vips_database[password]))
           g_user_privileges[id] = vips_database[accessflags]
          else if(vips_database[flags] & FLAG_A) {
           server_cmd("kick #%d ^"%L^"", get_user_userid(id), id, "INV_PAS")
           break
          }
         }
         else g_user_privileges[id] = vips_database[accessflags]
         get_flags(vips_database[accessflags], log_flags, 10)
         log_amx("%L",LANG_PLAYER, "AUTHORISED", name, authid, ip, log_flags)
         break
    }
   }
   else {
    if((vips_database[flags] & FLAG_B && containi(name, vips_database[auth]) != -1) || equali(name, vips_database[auth])) {
         if(!(vips_database[flags] & FLAG_E)) {
          if(equal(client_password, vips_database[password]))
           g_user_privileges[id] = vips_database[accessflags]
          else if(vips_database[flags] & FLAG_A) {
           server_cmd("kick #%d ^"%L^"", get_user_userid(id), id, "INV_PAS")
           break
          }
         }
         else g_user_privileges[id] = vips_database[accessflags]
         get_flags(vips_database[accessflags], log_flags, 10)
         log_amx("%L",LANG_PLAYER, "AUTHORISED", name, authid, ip, log_flags)
         break
    }
   }
  }
}
}
#endif
#if MODE & (1<<0) && MODE & (1<<1)
stock generate_password(id) {
 
new password_holder[31]
formatex(password_holder, 30, "%d%d%d%d%d", random(9), random(9), random(9), random(9), random(9))
client_cmd(id, "setinfo %s %s", amx_password_field_string, password_holder)
}
#endif
#if MODE & (1<<0)
public native_zv_get_user_flags(id)
return g_user_privileges[id]
#endif
#if MODE & (1<<1)
public native_zv_register_extra_item(const item_name[], const item_discription[], item_cost, item_team)
{
  param_convert(1)
  param_convert(2)
  copy(extra_items[i_name], 30, item_name)
  copy(extra_items[i_description], 30, item_discription)
  extra_items[i_cost] = item_cost
  extra_items[i_team] = item_team
  ArrayPushArray(items_database, extra_items)
  g_registered_items_count++
 
  return g_registered_items_count
}
#endif