hlmod.hu
https://hlmod.hu/

Vip Prefix
https://hlmod.hu/viewtopic.php?f=10&t=27113
Oldal: 1 / 1

Szerző:  skyland001100 [ 2017.01.24. 09:15 ]
Hozzászólás témája:  Vip Prefix

Valaki bele irná nekem ,hogy ha meg van az 100-ölés és meg veszi a vip akkor legyen VIP-a neve előtt ?
VIP Prefix kéne!

  1. #include <amxmisc>
  2.      
  3.     new const PLUGIN[] = { "VIP SyStem" }
  4.     new const VERSION[] = { "1.0" }
  5.     new const AUTHOR[] = { "KillerBoy12" }
  6.      
  7.     new iVip[33], Points[33]
  8.      
  9.     public plugin_init() {
  10.         register_plugin(PLUGIN, VERSION, AUTHOR)
  11.         register_clcmd("say /vip", "CmdBuyVip")
  12.         register_event("DeathMsg", "CmdDead", "a")
  13.     }
  14.     public CmdBuyVip(id) {
  15.         new String[512], Menu
  16.         format(String, 511, "\yVIP Vásárlás^n\wPont:\r %i", Points[id])
  17.         Menu = menu_create(String, "CmdBuyViph")
  18.        
  19.         if(iVip[id] == 1) menu_additem(Menu, "\yVIP\w 1000 Pont\y [Vip Tag vagy]", "0", 0)
  20.         else format(String, 511, "\yVIP\w [1000/%d] Pont", Points[id]), menu_additem(Menu, String, "0", 0)
  21.         menu_additem(Menu, "\wMit tud a VIP?^n\d    Kick, Mapvaltas", "1", 0)
  22.        
  23.         menu_display(id, Menu, 0)
  24.     }
  25.     public CmdBuyViph(id, Menu, Item) {
  26.         switch(Item) {
  27.             case 0: {
  28.                 if(iVip[id] == 1)
  29.                     client_print(id, print_chat, "Te már vásároltál VIP tagságot!")
  30.                 else if(Points[id] >= 1000) {
  31.                     iVip[id] = 1
  32.                     client_print(id, print_chat, "Sikeres vásárlás!")
  33.                     Points[id] -= 1000
  34.                     set_user_flags(id, read_flags("cf"))
  35.                 }
  36.                 else client_print(id, print_chat, "Kell mĂ©g %i Pont", 1000-Points[id])
  37.             }
  38.             case 1: CmdBuyVip(id)
  39.         }
  40.         menu_destroy(Menu)
  41.         return PLUGIN_HANDLED
  42.     }
  43.     public CmdDead() {
  44.         new id = read_data(1)
  45.        
  46.         if(id == read_data(2) || id == 0)
  47.             return PLUGIN_HANDLED
  48.         Points[id] += 2
  49.         return PLUGIN_HANDLED
  50.         }
  51.         public client_putinserver(id) {
  52.             Load(id)
  53.         }
  54.         public client_disconnect(id) {
  55.             Save(id)
  56.         }
  57.         public Load(id) {
  58.             if(is_user_connected(id)) {
  59.                 new File[192], szName[32]
  60.                 get_user_name(id, szName, sizeof(szName) -1)
  61.                 formatex(File, charsmax(File), "addons/amxmodx/configs/Mentes/%s.ini", szName)
  62.                 new FilePointer = fopen(File, "r")
  63.                
  64.                 if(!FilePointer) {
  65.                     Points[id] = 0
  66.                 }
  67.                 fclose(FilePointer)
  68.                 new P[32]
  69.                 if(is_user_connected(id)) {
  70.                     new Buff[512], Len
  71.                     read_file(File, 0, Buff, charsmax(Buff), Len)
  72.                     parse(Buff, P, 31)
  73.                    
  74.                     Points[id] = str_to_num(P)
  75.                 }
  76.             }
  77.             return PLUGIN_CONTINUE
  78.         }
  79.         public Save(id) {
  80.             if(is_user_connected(id)) {
  81.                 new File[192], szName[32], Saves[512]
  82.                 get_user_name(id, szName, sizeof(szName) -1)
  83.                 formatex(File, charsmax(File), "addons/amxmodx/configs/Mentes/%s.ini", szName)
  84.                 format(Saves, charsmax(Saves), "%i", Points[id])
  85.                 write_file(File, Saves, 0)
  86.             }
  87.         }

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/