[ZE] Admin Coins Menu

Gameplay Addons
User avatar
Muhammet20
Veteran Member
Veteran Member
Syria
Posts: 401
Joined: 1 Year Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 13
Contact:

Re: [ZE] Admin Coins Menu

#11

Post by Muhammet20 » 3 Months Ago

@Luxurious, idk why he facing that problem, working fine
Last edited by Muhammet20 on 30 Jul 2019, 12:59, edited 1 time in total.
.::Kaya Gaming || Never Give Up || Zombie Escape::. [Server is Under The Work]
https://kaya-gaming.ga/

I just believe in two things, First thing is who i see in the mirror, second thing is who i don't see in the sky.

User avatar
tmv
Member
Member
Russia
Posts: 31
Joined: 3 Months Ago
Has thanked: 2 times
Been thanked: 0
Age: 19
Contact:

#12

Post by tmv » 3 Months Ago

Wait until Raheem is checking.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#13

Post by Raheem » 3 Months Ago

You can use client_print_color() as @tmv said because our Mod works only on AMXMODX 1.9

@tmv, try this:


  1. #include <zombie_escape>
  2. #include <colorchat>
  3.  
  4. enum _:PlayerData
  5. {
  6.     g_szName[32],
  7.     g_szSteamID[32],
  8.     g_iOption,
  9.     g_iPlayer,
  10.     g_iChoosen
  11. }
  12.  
  13. new g_PlayerInfo[33][PlayerData] /* [0 - 32], [0 - 4]*/
  14.  
  15. new const g_szCoinsMenuItems[][] =
  16. {
  17.     "\yGive Coins",
  18.     "\yTake Coins",
  19.     "\ySet Coins^n",
  20.     "\yReload Coins"
  21. }
  22.  
  23. public plugin_init()
  24. {
  25.     register_plugin("Admin Menu", "1.0", "Luxurious")
  26.  
  27.     register_concmd("say /ecmenu", "CoinsMenu", ADMIN_PASSWORD)
  28.     register_concmd("ecmenu", "CoinsMenu", ADMIN_PASSWORD)
  29.  
  30.     register_concmd("ENTER_Coins_NUMBER", "CoinsEntered")
  31.  
  32.     register_concmd("ENTER_Coins_Reset", "CoinsReset")
  33. }
  34.  
  35. public client_authorized(id)
  36. {
  37.     get_user_name(id, g_PlayerInfo[id][g_szName], charsmax(g_PlayerInfo[][g_szName]))
  38.     get_user_authid(id, g_PlayerInfo[id][g_szSteamID], charsmax(g_PlayerInfo[][g_szSteamID]))
  39. }
  40.  
  41. public plugin_natives()
  42. {
  43.     register_native("CoinsMenu","native_CoinsMenu",1)
  44. }
  45.  
  46. public native_CoinsMenu(id)
  47. {
  48.     CoinsMenu(id)
  49. }
  50.  
  51. public CoinsMenu(id)
  52. {
  53.     new iMenuID = menu_create("\rCoins Menu \w:", "CoinsMenuHandle")
  54.  
  55.     for(new i=0; i<sizeof(g_szCoinsMenuItems); i++) menu_additem(iMenuID, g_szCoinsMenuItems[i])
  56.  
  57.     menu_display(id, iMenuID)
  58. }
  59.  
  60. public CoinsMenuHandle(id, iMenuID, iItem)
  61. {
  62.     switch(iItem)
  63.     {
  64.         case 0, 1, 2:
  65.         {
  66.             g_PlayerInfo[id][g_iOption] = iItem+1
  67.             ChooseCoinsPlayer(id)
  68.         }
  69.         case 3:
  70.         {
  71.             client_cmd(id, "messagemode ENTER_COINS_Reset")
  72.         }
  73.  
  74.     }
  75.  
  76.     menu_destroy(iMenuID)
  77.    
  78.     return 0
  79. }
  80.  
  81. public ChooseCoinsPlayer(id)
  82. {
  83.     new szItem[64], szName[33], iMenuID = menu_create("\rChoose Target \w:", "ChooseCoinsPlayerHandle")
  84.  
  85.     for(new i=0, n=0; i<=32; i++)
  86.     {
  87.         if(!is_user_connected(i)) continue
  88.  
  89.         g_PlayerInfo[n++][g_iPlayer] = i
  90.  
  91.         get_user_name(i, szName, charsmax(szName))
  92.  
  93.         formatex(szItem, charsmax(szItem), "\y%s - \d[\r%d\d]", szName, ze_get_escape_coins(i))
  94.  
  95.         menu_additem(iMenuID, szItem, "0", 0)
  96.     }
  97.  
  98.     menu_display(id, iMenuID)
  99. }
  100.  
  101. public ChooseCoinsPlayerHandle(id, iMenuID, iItem)
  102. {
  103.     if (!is_user_connected(id))
  104.         return 1
  105.    
  106.     if ((!(iItem >= 0 && iItem <= 32)) || (!(g_iChoosen >= 0 && iItem <= 4)) ||
  107.     (!(g_iPlayer >= 0 && g_iPlayer <= 4)))
  108.     {
  109.         return 1
  110.     }
  111.    
  112.     g_PlayerInfo[id][g_iChoosen] = g_PlayerInfo[iItem][g_iPlayer]
  113.  
  114.     if(!is_user_connected(g_PlayerInfo[id][g_iChoosen]))
  115.     {
  116.  
  117.         ColorChat(id, TEAM_COLOR, "^4[Admin Menu] ^1Target Not Founded In The Server.")
  118.  
  119.         return 1
  120.     }
  121.  
  122.     client_cmd(id, "messagemode ENTER_Coins_NUMBER")
  123.  
  124.     menu_destroy(iMenuID)
  125.  
  126.     return 0
  127. }
  128.  
  129. public CoinsEntered(id)
  130. {
  131.     new szNumber[32], iNumber, g_aName[33]
  132.  
  133.     get_user_name(id, g_aName, 32)
  134.  
  135.     read_argv(1, szNumber, charsmax(szNumber))
  136.  
  137.     iNumber = str_to_num(szNumber)
  138.  
  139.     if(!iNumber) return 1
  140.  
  141.     if(!is_user_connected(g_PlayerInfo[id][g_iChoosen]))
  142.     {
  143.         ColorChat(id, TEAM_COLOR, "^4[Admin Menu] ^1Target Not Founded In The Server.")
  144.  
  145.         return 1
  146.     }
  147.  
  148.     switch(g_PlayerInfo[id][g_iOption])
  149.     {
  150.         case 1:
  151.         {
  152.  
  153.             ze_set_escape_coins(g_PlayerInfo[id][g_iChoosen], ze_get_escape_coins(g_PlayerInfo[id][g_iChoosen]) + iNumber)
  154.  
  155.             ColorChat(0, TEAM_COLOR, "^4[Admin Menu] ^1Admin ^3%s ^1have Gaved ^4%i ^1Escape Coins To ^3%s.", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  156.  
  157.             ze_log("ADMIN %s Gaved %i Coins To %s", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  158.  
  159.         }
  160.         case 2:
  161.         {
  162.             ze_set_escape_coins(g_PlayerInfo[id][g_iChoosen], ze_get_escape_coins(g_PlayerInfo[id][g_iChoosen]) - iNumber)
  163.  
  164.             ColorChat(0, TEAM_COLOR, "^4[Admin Menu] ^1Admin ^3%s ^1have Taked ^4%i ^1Escape Coins From ^3%s.", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  165.  
  166.             ze_log("ADMIN %s Taked %i Coins From %s", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  167.         }
  168.         case 3:
  169.         {
  170.             ze_set_escape_coins(g_PlayerInfo[id][g_iChoosen], iNumber)
  171.  
  172.             ColorChat(0, TEAM_COLOR, "^4[Admin Menu] ^1Admin ^3%s ^1have Set Coins Of ^3%s ^1To ^4%i ^1Escape Coins.", g_aName, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName], iNumber)
  173.  
  174.             ze_log("ADMIN %s Have Set Coins Of %s To %i", g_aName, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName], iNumber)
  175.         }
  176.     }
  177.    
  178.     return 0
  179. }
  180.  
  181. public CoinsReset(id)
  182. {
  183.     new szNumber[32], iNumber, g_aName[33]
  184.    
  185.     get_user_name(id, g_aName, 32)
  186.  
  187.     read_argv(1, szNumber, charsmax(szNumber))
  188.  
  189.     iNumber = str_to_num(szNumber)
  190.  
  191.     if(!iNumber) return 1
  192.  
  193.     new iPlayers[32], iPlayerCount, i, player
  194.  
  195.     get_players(iPlayers, iPlayerCount, "a")
  196.  
  197.     for(i = 0; i < iPlayerCount; i++)
  198.     {
  199.         player = iPlayers[i]
  200.  
  201.         if(ze_get_escape_coins(player) >= iNumber)
  202.  
  203.             continue
  204.  
  205.         ze_set_escape_coins(player, iNumber)
  206.     }
  207.  
  208.     ColorChat(0, TEAM_COLOR, "^4[Admin Menu] ^1Admin ^3%s ^1have Reset Coins To ^3^%i ^4Escape Coins.", g_aName, iNumber)
  209.  
  210.     ze_log("ADMIN %s Have Set Coins To %i Escape Coins", g_aName, iNumber)
  211.  
  212.     return 0
  213. }
  214.  
  215.  
  216.  
  217. stock ze_log(const message_fmt[], any:...)
  218. {
  219.  
  220.     static message[256], filename[32]
  221.  
  222.     vformat(message, charsmax(message), message_fmt, 2)
  223.  
  224.     formatex(filename, charsmax(filename), "ze_Adminmenu.log")
  225.  
  226.     log_to_file(filename, "%s", message)
  227. }
These users thanked the author Raheem for the post:
tmv (3 Months Ago)
You don't know? Learn and you will know.

User avatar
Luxurious
Senior Member
Senior Member
Egypt
Posts: 150
Joined: 1 Year Ago
Location: Egypt
Has thanked: 3 times
Been thanked: 4 times
Contact:

#14

Post by Luxurious » 3 Months Ago

Raheem wrote:
3 Months Ago
You can use client_print_color() as @tmv said because our Mod works only on AMXMODX 1.9

@tmv, try this:


  1. #include <zombie_escape>
  2. #include <colorchat>
  3.  
  4. enum _:PlayerData
  5. {
  6.     g_szName[32],
  7.     g_szSteamID[32],
  8.     g_iOption,
  9.     g_iPlayer,
  10.     g_iChoosen
  11. }
  12.  
  13. new g_PlayerInfo[33][PlayerData] /* [0 - 32], [0 - 4]*/
  14.  
  15. new const g_szCoinsMenuItems[][] =
  16. {
  17.     "\yGive Coins",
  18.     "\yTake Coins",
  19.     "\ySet Coins^n",
  20.     "\yReload Coins"
  21. }
  22.  
  23. public plugin_init()
  24. {
  25.     register_plugin("Admin Menu", "1.0", "Luxurious")
  26.  
  27.     register_concmd("say /ecmenu", "CoinsMenu", ADMIN_PASSWORD)
  28.     register_concmd("ecmenu", "CoinsMenu", ADMIN_PASSWORD)
  29.  
  30.     register_concmd("ENTER_Coins_NUMBER", "CoinsEntered")
  31.  
  32.     register_concmd("ENTER_Coins_Reset", "CoinsReset")
  33. }
  34.  
  35. public client_authorized(id)
  36. {
  37.     get_user_name(id, g_PlayerInfo[id][g_szName], charsmax(g_PlayerInfo[][g_szName]))
  38.     get_user_authid(id, g_PlayerInfo[id][g_szSteamID], charsmax(g_PlayerInfo[][g_szSteamID]))
  39. }
  40.  
  41. public plugin_natives()
  42. {
  43.     register_native("CoinsMenu","native_CoinsMenu",1)
  44. }
  45.  
  46. public native_CoinsMenu(id)
  47. {
  48.     CoinsMenu(id)
  49. }
  50.  
  51. public CoinsMenu(id)
  52. {
  53.     new iMenuID = menu_create("\rCoins Menu \w:", "CoinsMenuHandle")
  54.  
  55.     for(new i=0; i<sizeof(g_szCoinsMenuItems); i++) menu_additem(iMenuID, g_szCoinsMenuItems[i])
  56.  
  57.     menu_display(id, iMenuID)
  58. }
  59.  
  60. public CoinsMenuHandle(id, iMenuID, iItem)
  61. {
  62.     switch(iItem)
  63.     {
  64.         case 0, 1, 2:
  65.         {
  66.             g_PlayerInfo[id][g_iOption] = iItem+1
  67.             ChooseCoinsPlayer(id)
  68.         }
  69.         case 3:
  70.         {
  71.             client_cmd(id, "messagemode ENTER_COINS_Reset")
  72.         }
  73.  
  74.     }
  75.  
  76.     menu_destroy(iMenuID)
  77.    
  78.     return 0
  79. }
  80.  
  81. public ChooseCoinsPlayer(id)
  82. {
  83.     new szItem[64], szName[33], iMenuID = menu_create("\rChoose Target \w:", "ChooseCoinsPlayerHandle")
  84.  
  85.     for(new i=0, n=0; i<=32; i++)
  86.     {
  87.         if(!is_user_connected(i)) continue
  88.  
  89.         g_PlayerInfo[n++][g_iPlayer] = i
  90.  
  91.         get_user_name(i, szName, charsmax(szName))
  92.  
  93.         formatex(szItem, charsmax(szItem), "\y%s - \d[\r%d\d]", szName, ze_get_escape_coins(i))
  94.  
  95.         menu_additem(iMenuID, szItem, "0", 0)
  96.     }
  97.  
  98.     menu_display(id, iMenuID)
  99. }
  100.  
  101. public ChooseCoinsPlayerHandle(id, iMenuID, iItem)
  102. {
  103.     if (!is_user_connected(id))
  104.         return 1
  105.    
  106.     if ((!(iItem >= 0 && iItem <= 32)) || (!(g_iChoosen >= 0 && iItem <= 4)) ||
  107.     (!(g_iPlayer >= 0 && g_iPlayer <= 4)))
  108.     {
  109.         return 1
  110.     }
  111.    
  112.     g_PlayerInfo[id][g_iChoosen] = g_PlayerInfo[iItem][g_iPlayer]
  113.  
  114.     if(!is_user_connected(g_PlayerInfo[id][g_iChoosen]))
  115.     {
  116.  
  117.         ColorChat(id, TEAM_COLOR, "^4[Admin Menu] ^1Target Not Founded In The Server.")
  118.  
  119.         return 1
  120.     }
  121.  
  122.     client_cmd(id, "messagemode ENTER_Coins_NUMBER")
  123.  
  124.     menu_destroy(iMenuID)
  125.  
  126.     return 0
  127. }
  128.  
  129. public CoinsEntered(id)
  130. {
  131.     new szNumber[32], iNumber, g_aName[33]
  132.  
  133.     get_user_name(id, g_aName, 32)
  134.  
  135.     read_argv(1, szNumber, charsmax(szNumber))
  136.  
  137.     iNumber = str_to_num(szNumber)
  138.  
  139.     if(!iNumber) return 1
  140.  
  141.     if(!is_user_connected(g_PlayerInfo[id][g_iChoosen]))
  142.     {
  143.         ColorChat(id, TEAM_COLOR, "^4[Admin Menu] ^1Target Not Founded In The Server.")
  144.  
  145.         return 1
  146.     }
  147.  
  148.     switch(g_PlayerInfo[id][g_iOption])
  149.     {
  150.         case 1:
  151.         {
  152.  
  153.             ze_set_escape_coins(g_PlayerInfo[id][g_iChoosen], ze_get_escape_coins(g_PlayerInfo[id][g_iChoosen]) + iNumber)
  154.  
  155.             ColorChat(0, TEAM_COLOR, "^4[Admin Menu] ^1Admin ^3%s ^1have Gaved ^4%i ^1Escape Coins To ^3%s.", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  156.  
  157.             ze_log("ADMIN %s Gaved %i Coins To %s", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  158.  
  159.         }
  160.         case 2:
  161.         {
  162.             ze_set_escape_coins(g_PlayerInfo[id][g_iChoosen], ze_get_escape_coins(g_PlayerInfo[id][g_iChoosen]) - iNumber)
  163.  
  164.             ColorChat(0, TEAM_COLOR, "^4[Admin Menu] ^1Admin ^3%s ^1have Taked ^4%i ^1Escape Coins From ^3%s.", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  165.  
  166.             ze_log("ADMIN %s Taked %i Coins From %s", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  167.         }
  168.         case 3:
  169.         {
  170.             ze_set_escape_coins(g_PlayerInfo[id][g_iChoosen], iNumber)
  171.  
  172.             ColorChat(0, TEAM_COLOR, "^4[Admin Menu] ^1Admin ^3%s ^1have Set Coins Of ^3%s ^1To ^4%i ^1Escape Coins.", g_aName, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName], iNumber)
  173.  
  174.             ze_log("ADMIN %s Have Set Coins Of %s To %i", g_aName, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName], iNumber)
  175.         }
  176.     }
  177.    
  178.     return 0
  179. }
  180.  
  181. public CoinsReset(id)
  182. {
  183.     new szNumber[32], iNumber, g_aName[33]
  184.    
  185.     get_user_name(id, g_aName, 32)
  186.  
  187.     read_argv(1, szNumber, charsmax(szNumber))
  188.  
  189.     iNumber = str_to_num(szNumber)
  190.  
  191.     if(!iNumber) return 1
  192.  
  193.     new iPlayers[32], iPlayerCount, i, player
  194.  
  195.     get_players(iPlayers, iPlayerCount, "a")
  196.  
  197.     for(i = 0; i < iPlayerCount; i++)
  198.     {
  199.         player = iPlayers[i]
  200.  
  201.         if(ze_get_escape_coins(player) >= iNumber)
  202.  
  203.             continue
  204.  
  205.         ze_set_escape_coins(player, iNumber)
  206.     }
  207.  
  208.     ColorChat(0, TEAM_COLOR, "^4[Admin Menu] ^1Admin ^3%s ^1have Reset Coins To ^3^%i ^4Escape Coins.", g_aName, iNumber)
  209.  
  210.     ze_log("ADMIN %s Have Set Coins To %i Escape Coins", g_aName, iNumber)
  211.  
  212.     return 0
  213. }
  214.  
  215.  
  216.  
  217. stock ze_log(const message_fmt[], any:...)
  218. {
  219.  
  220.     static message[256], filename[32]
  221.  
  222.     vformat(message, charsmax(message), message_fmt, 2)
  223.  
  224.     formatex(filename, charsmax(filename), "ze_Adminmenu.log")
  225.  
  226.     log_to_file(filename, "%s", message)
  227. }
updated !
BeTalk Zombie-Escape V1.4
IP : 51.77.103.159:27015

User avatar
tmv
Member
Member
Russia
Posts: 31
Joined: 3 Months Ago
Has thanked: 2 times
Been thanked: 0
Age: 19
Contact:

#15

Post by tmv » 3 Months Ago

Raheem wrote:
3 Months Ago
You can use client_print_color() as @tmv said because our Mod works only on AMXMODX 1.9

@tmv, try this:


  1. #include <zombie_escape>
  2. #include <colorchat>
  3.  
  4. enum _:PlayerData
  5. {
  6.     g_szName[32],
  7.     g_szSteamID[32],
  8.     g_iOption,
  9.     g_iPlayer,
  10.     g_iChoosen
  11. }
  12.  
  13. new g_PlayerInfo[33][PlayerData] /* [0 - 32], [0 - 4]*/
  14.  
  15. new const g_szCoinsMenuItems[][] =
  16. {
  17.     "\yGive Coins",
  18.     "\yTake Coins",
  19.     "\ySet Coins^n",
  20.     "\yReload Coins"
  21. }
  22.  
  23. public plugin_init()
  24. {
  25.     register_plugin("Admin Menu", "1.0", "Luxurious")
  26.  
  27.     register_concmd("say /ecmenu", "CoinsMenu", ADMIN_PASSWORD)
  28.     register_concmd("ecmenu", "CoinsMenu", ADMIN_PASSWORD)
  29.  
  30.     register_concmd("ENTER_Coins_NUMBER", "CoinsEntered")
  31.  
  32.     register_concmd("ENTER_Coins_Reset", "CoinsReset")
  33. }
  34.  
  35. public client_authorized(id)
  36. {
  37.     get_user_name(id, g_PlayerInfo[id][g_szName], charsmax(g_PlayerInfo[][g_szName]))
  38.     get_user_authid(id, g_PlayerInfo[id][g_szSteamID], charsmax(g_PlayerInfo[][g_szSteamID]))
  39. }
  40.  
  41. public plugin_natives()
  42. {
  43.     register_native("CoinsMenu","native_CoinsMenu",1)
  44. }
  45.  
  46. public native_CoinsMenu(id)
  47. {
  48.     CoinsMenu(id)
  49. }
  50.  
  51. public CoinsMenu(id)
  52. {
  53.     new iMenuID = menu_create("\rCoins Menu \w:", "CoinsMenuHandle")
  54.  
  55.     for(new i=0; i<sizeof(g_szCoinsMenuItems); i++) menu_additem(iMenuID, g_szCoinsMenuItems[i])
  56.  
  57.     menu_display(id, iMenuID)
  58. }
  59.  
  60. public CoinsMenuHandle(id, iMenuID, iItem)
  61. {
  62.     switch(iItem)
  63.     {
  64.         case 0, 1, 2:
  65.         {
  66.             g_PlayerInfo[id][g_iOption] = iItem+1
  67.             ChooseCoinsPlayer(id)
  68.         }
  69.         case 3:
  70.         {
  71.             client_cmd(id, "messagemode ENTER_COINS_Reset")
  72.         }
  73.  
  74.     }
  75.  
  76.     menu_destroy(iMenuID)
  77.    
  78.     return 0
  79. }
  80.  
  81. public ChooseCoinsPlayer(id)
  82. {
  83.     new szItem[64], szName[33], iMenuID = menu_create("\rChoose Target \w:", "ChooseCoinsPlayerHandle")
  84.  
  85.     for(new i=0, n=0; i<=32; i++)
  86.     {
  87.         if(!is_user_connected(i)) continue
  88.  
  89.         g_PlayerInfo[n++][g_iPlayer] = i
  90.  
  91.         get_user_name(i, szName, charsmax(szName))
  92.  
  93.         formatex(szItem, charsmax(szItem), "\y%s - \d[\r%d\d]", szName, ze_get_escape_coins(i))
  94.  
  95.         menu_additem(iMenuID, szItem, "0", 0)
  96.     }
  97.  
  98.     menu_display(id, iMenuID)
  99. }
  100.  
  101. public ChooseCoinsPlayerHandle(id, iMenuID, iItem)
  102. {
  103.     if (!is_user_connected(id))
  104.         return 1
  105.    
  106.     if ((!(iItem >= 0 && iItem <= 32)) || (!(g_iChoosen >= 0 && iItem <= 4)) ||
  107.     (!(g_iPlayer >= 0 && g_iPlayer <= 4)))
  108.     {
  109.         return 1
  110.     }
  111.    
  112.     g_PlayerInfo[id][g_iChoosen] = g_PlayerInfo[iItem][g_iPlayer]
  113.  
  114.     if(!is_user_connected(g_PlayerInfo[id][g_iChoosen]))
  115.     {
  116.  
  117.         ColorChat(id, TEAM_COLOR, "^4[Admin Menu] ^1Target Not Founded In The Server.")
  118.  
  119.         return 1
  120.     }
  121.  
  122.     client_cmd(id, "messagemode ENTER_Coins_NUMBER")
  123.  
  124.     menu_destroy(iMenuID)
  125.  
  126.     return 0
  127. }
  128.  
  129. public CoinsEntered(id)
  130. {
  131.     new szNumber[32], iNumber, g_aName[33]
  132.  
  133.     get_user_name(id, g_aName, 32)
  134.  
  135.     read_argv(1, szNumber, charsmax(szNumber))
  136.  
  137.     iNumber = str_to_num(szNumber)
  138.  
  139.     if(!iNumber) return 1
  140.  
  141.     if(!is_user_connected(g_PlayerInfo[id][g_iChoosen]))
  142.     {
  143.         ColorChat(id, TEAM_COLOR, "^4[Admin Menu] ^1Target Not Founded In The Server.")
  144.  
  145.         return 1
  146.     }
  147.  
  148.     switch(g_PlayerInfo[id][g_iOption])
  149.     {
  150.         case 1:
  151.         {
  152.  
  153.             ze_set_escape_coins(g_PlayerInfo[id][g_iChoosen], ze_get_escape_coins(g_PlayerInfo[id][g_iChoosen]) + iNumber)
  154.  
  155.             ColorChat(0, TEAM_COLOR, "^4[Admin Menu] ^1Admin ^3%s ^1have Gaved ^4%i ^1Escape Coins To ^3%s.", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  156.  
  157.             ze_log("ADMIN %s Gaved %i Coins To %s", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  158.  
  159.         }
  160.         case 2:
  161.         {
  162.             ze_set_escape_coins(g_PlayerInfo[id][g_iChoosen], ze_get_escape_coins(g_PlayerInfo[id][g_iChoosen]) - iNumber)
  163.  
  164.             ColorChat(0, TEAM_COLOR, "^4[Admin Menu] ^1Admin ^3%s ^1have Taked ^4%i ^1Escape Coins From ^3%s.", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  165.  
  166.             ze_log("ADMIN %s Taked %i Coins From %s", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  167.         }
  168.         case 3:
  169.         {
  170.             ze_set_escape_coins(g_PlayerInfo[id][g_iChoosen], iNumber)
  171.  
  172.             ColorChat(0, TEAM_COLOR, "^4[Admin Menu] ^1Admin ^3%s ^1have Set Coins Of ^3%s ^1To ^4%i ^1Escape Coins.", g_aName, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName], iNumber)
  173.  
  174.             ze_log("ADMIN %s Have Set Coins Of %s To %i", g_aName, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName], iNumber)
  175.         }
  176.     }
  177.    
  178.     return 0
  179. }
  180.  
  181. public CoinsReset(id)
  182. {
  183.     new szNumber[32], iNumber, g_aName[33]
  184.    
  185.     get_user_name(id, g_aName, 32)
  186.  
  187.     read_argv(1, szNumber, charsmax(szNumber))
  188.  
  189.     iNumber = str_to_num(szNumber)
  190.  
  191.     if(!iNumber) return 1
  192.  
  193.     new iPlayers[32], iPlayerCount, i, player
  194.  
  195.     get_players(iPlayers, iPlayerCount, "a")
  196.  
  197.     for(i = 0; i < iPlayerCount; i++)
  198.     {
  199.         player = iPlayers[i]
  200.  
  201.         if(ze_get_escape_coins(player) >= iNumber)
  202.  
  203.             continue
  204.  
  205.         ze_set_escape_coins(player, iNumber)
  206.     }
  207.  
  208.     ColorChat(0, TEAM_COLOR, "^4[Admin Menu] ^1Admin ^3%s ^1have Reset Coins To ^3^%i ^4Escape Coins.", g_aName, iNumber)
  209.  
  210.     ze_log("ADMIN %s Have Set Coins To %i Escape Coins", g_aName, iNumber)
  211.  
  212.     return 0
  213. }
  214.  
  215.  
  216.  
  217. stock ze_log(const message_fmt[], any:...)
  218. {
  219.  
  220.     static message[256], filename[32]
  221.  
  222.     vformat(message, charsmax(message), message_fmt, 2)
  223.  
  224.     formatex(filename, charsmax(filename), "ze_Adminmenu.log")
  225.  
  226.     log_to_file(filename, "%s", message)
  227. }
Read the following message.
Last edited by tmv on 30 Jul 2019, 20:54, edited 1 time in total.

User avatar
tmv
Member
Member
Russia
Posts: 31
Joined: 3 Months Ago
Has thanked: 2 times
Been thanked: 0
Age: 19
Contact:

#16

Post by tmv » 3 Months Ago

Run time error 4: index out of bounds Solved But Give Coins - Take Coins - Set Coins Was mixed up and Not working.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#17

Post by Raheem » 3 Months Ago

Because the plugin in fact is badly coded, i didn't fix it, i just make checks to block errors.
You don't know? Learn and you will know.

User avatar
tmv
Member
Member
Russia
Posts: 31
Joined: 3 Months Ago
Has thanked: 2 times
Been thanked: 0
Age: 19
Contact:

#18

Post by tmv » 3 Months Ago

yeah i agree with you

User avatar
lizoumapper
Senior Member
Senior Member
Morocco
Posts: 150
Joined: 10 Months Ago
Location: Morocco
Has thanked: 3 times
Been thanked: 7 times
Age: 17
Contact:

#19

Post by lizoumapper » 3 Months Ago

if you use AMX Mod X v1.9.0
i edit for AMX Mod X v1.9.0
now work without include ColorChat
  1. #include <zombie_escape>
  2.  
  3. enum _:PlayerData
  4. {
  5.     g_szName[32],
  6.     g_szSteamID[32],
  7.     g_iOption,
  8.     g_iPlayer,
  9.     g_iChoosen
  10. }
  11.  
  12. new g_PlayerInfo[33][PlayerData] /* [0 - 32], [0 - 4]*/
  13.  
  14. // Prefix
  15. new Prefix[] = "^4[ZE]^1"
  16.  
  17. new const g_szCoinsMenuItems[][] =
  18. {
  19.     "\yGive Coins",
  20.     "\yTake Coins",
  21.     "\ySet Coins^n",
  22.     "\yReload Coins"
  23. }
  24.  
  25. public plugin_init()
  26. {
  27.     register_plugin("Admin Menu", "1.0", "Luxurious")
  28.  
  29.     register_concmd("say /ecmenu", "CoinsMenu", ADMIN_PASSWORD)
  30.     register_concmd("ecmenu", "CoinsMenu", ADMIN_PASSWORD)
  31.  
  32.     register_concmd("ENTER_Coins_NUMBER", "CoinsEntered")
  33.  
  34.     register_concmd("ENTER_Coins_Reset", "CoinsReset")
  35. }
  36.  
  37. public client_authorized(id)
  38. {
  39.     get_user_name(id, g_PlayerInfo[id][g_szName], charsmax(g_PlayerInfo[][g_szName]))
  40.     get_user_authid(id, g_PlayerInfo[id][g_szSteamID], charsmax(g_PlayerInfo[][g_szSteamID]))
  41. }
  42.  
  43. public plugin_natives()
  44. {
  45.     register_native("CoinsMenu","native_CoinsMenu",1)
  46. }
  47.  
  48. public native_CoinsMenu(id)
  49. {
  50.     CoinsMenu(id)
  51. }
  52.  
  53. public CoinsMenu(id)
  54. {
  55.     new iMenuID = menu_create("\rCoins Menu \w:", "CoinsMenuHandle")
  56.  
  57.     for(new i=0; i<sizeof(g_szCoinsMenuItems); i++) menu_additem(iMenuID, g_szCoinsMenuItems[i])
  58.  
  59.     menu_display(id, iMenuID)
  60. }
  61.  
  62. public CoinsMenuHandle(id, iMenuID, iItem)
  63. {
  64.     switch(iItem)
  65.     {
  66.         case 0, 1, 2:
  67.         {
  68.             g_PlayerInfo[id][g_iOption] = iItem+1
  69.             ChooseCoinsPlayer(id)
  70.         }
  71.         case 3:
  72.         {
  73.             client_cmd(id, "messagemode ENTER_COINS_Reset")
  74.         }
  75.  
  76.     }
  77.  
  78.     menu_destroy(iMenuID)
  79.    
  80.     return 0
  81. }
  82.  
  83. public ChooseCoinsPlayer(id)
  84. {
  85.     new szItem[64], szName[33], iMenuID = menu_create("\rChoose Target \w:", "ChooseCoinsPlayerHandle")
  86.  
  87.     for(new i=0, n=0; i<=32; i++)
  88.     {
  89.         if(!is_user_connected(i)) continue
  90.  
  91.         g_PlayerInfo[n++][g_iPlayer] = i
  92.  
  93.         get_user_name(i, szName, charsmax(szName))
  94.  
  95.         formatex(szItem, charsmax(szItem), "\y%s - \d[\r%d\d]", szName, ze_get_escape_coins(i))
  96.  
  97.         menu_additem(iMenuID, szItem, "0", 0)
  98.     }
  99.  
  100.     menu_display(id, iMenuID)
  101. }
  102.  
  103. public ChooseCoinsPlayerHandle(id, iMenuID, iItem)
  104. {
  105.     if (!is_user_connected(id))
  106.         return 1
  107.    
  108.     if ((!(iItem >= 0 && iItem <= 32)) || (!(g_iChoosen >= 0 && iItem <= 4)) ||
  109.     (!(g_iPlayer >= 0 && g_iPlayer <= 4)))
  110.     {
  111.         return 1
  112.     }
  113.    
  114.     g_PlayerInfo[id][g_iChoosen] = g_PlayerInfo[iItem][g_iPlayer]
  115.  
  116.     if(!is_user_connected(g_PlayerInfo[id][g_iChoosen]))
  117.     {
  118.  
  119.         client_print_color(id, print_chat, "%s Target Not Founded In The Server.", Prefix)
  120.  
  121.         return 1
  122.     }
  123.  
  124.     client_cmd(id, "messagemode ENTER_Coins_NUMBER")
  125.  
  126.     menu_destroy(iMenuID)
  127.  
  128.     return 0
  129. }
  130.  
  131. public CoinsEntered(id)
  132. {
  133.     new szNumber[32], iNumber, g_aName[33]
  134.  
  135.     get_user_name(id, g_aName, 32)
  136.  
  137.     read_argv(1, szNumber, charsmax(szNumber))
  138.  
  139.     iNumber = str_to_num(szNumber)
  140.  
  141.     if(!iNumber) return 1
  142.  
  143.     if(!is_user_connected(g_PlayerInfo[id][g_iChoosen]))
  144.     {
  145.         client_print_color(id, print_chat, "%s Target Not Founded In The Server.", Prefix)
  146.  
  147.         return 1
  148.     }
  149.  
  150.     switch(g_PlayerInfo[id][g_iOption])
  151.     {
  152.         case 1:
  153.         {
  154.  
  155.             ze_set_escape_coins(g_PlayerInfo[id][g_iChoosen], ze_get_escape_coins(g_PlayerInfo[id][g_iChoosen]) + iNumber)
  156.  
  157.             client_print_color(id, print_chat, "%s Admin ^3%s ^1have Gaved ^4%i ^1Escape Coins To ^3%s.", Prefix, g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  158.  
  159.             ze_log("ADMIN %s Gaved %i Coins To %s", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  160.  
  161.         }
  162.         case 2:
  163.         {
  164.             ze_set_escape_coins(g_PlayerInfo[id][g_iChoosen], ze_get_escape_coins(g_PlayerInfo[id][g_iChoosen]) - iNumber)
  165.  
  166.             client_print_color(id, print_chat, "%s Admin ^3%s ^1have Taked ^4%i ^1Escape Coins From ^3%s.", Prefix, g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  167.  
  168.             ze_log("ADMIN %s Taked %i Coins From %s", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  169.         }
  170.         case 3:
  171.         {
  172.             ze_set_escape_coins(g_PlayerInfo[id][g_iChoosen], iNumber)
  173.  
  174.             client_print_color(id, print_chat, "%s Admin ^3%s ^1have Set Coins Of ^3%s ^1To ^4%i ^1Escape Coins.", Prefix, g_aName, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName], iNumber)
  175.  
  176.             ze_log("ADMIN %s Have Set Coins Of %s To %i", g_aName, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName], iNumber)
  177.         }
  178.     }
  179.    
  180.     return 0
  181. }
  182.  
  183. public CoinsReset(id)
  184. {
  185.     new szNumber[32], iNumber, g_aName[33]
  186.    
  187.     get_user_name(id, g_aName, 32)
  188.  
  189.     read_argv(1, szNumber, charsmax(szNumber))
  190.  
  191.     iNumber = str_to_num(szNumber)
  192.  
  193.     if(!iNumber) return 1
  194.  
  195.     new iPlayers[32], iPlayerCount, i, player
  196.  
  197.     get_players(iPlayers, iPlayerCount, "a")
  198.  
  199.     for(i = 0; i < iPlayerCount; i++)
  200.     {
  201.         player = iPlayers[i]
  202.  
  203.         if(ze_get_escape_coins(player) >= iNumber)
  204.  
  205.             continue
  206.  
  207.         ze_set_escape_coins(player, iNumber)
  208.     }
  209.  
  210.     client_print_color(id, print_chat, "%s Admin ^3%s ^1have Reset Coins To ^3^%i ^4Escape Coins.", Prefix, g_aName, iNumber)
  211.  
  212.     ze_log("ADMIN %s Have Set Coins To %i Escape Coins", g_aName, iNumber)
  213.  
  214.     return 0
  215. }
  216.  
  217.  
  218.  
  219. stock ze_log(const message_fmt[], any:...)
  220. {
  221.  
  222.     static message[256], filename[32]
  223.  
  224.     vformat(message, charsmax(message), message_fmt, 2)
  225.  
  226.     formatex(filename, charsmax(filename), "ze_Adminmenu.log")
  227.  
  228.     log_to_file(filename, "%s", message)
  229. }
I Love Learn Languages Programmations

snitch
Member
Member
Turkey
Posts: 23
Joined: 1 Month Ago
Has thanked: 0
Been thanked: 0
Contact:

#20

Post by snitch » 1 Month Ago

lizoumapper wrote:
3 Months Ago
if you use AMX Mod X v1.9.0
i edit for AMX Mod X v1.9.0
now work without include ColorChat
  1. #include <zombie_escape>
  2.  
  3. enum _:PlayerData
  4. {
  5.     g_szName[32],
  6.     g_szSteamID[32],
  7.     g_iOption,
  8.     g_iPlayer,
  9.     g_iChoosen
  10. }
  11.  
  12. new g_PlayerInfo[33][PlayerData] /* [0 - 32], [0 - 4]*/
  13.  
  14. // Prefix
  15. new Prefix[] = "^4[ZE]^1"
  16.  
  17. new const g_szCoinsMenuItems[][] =
  18. {
  19.     "\yGive Coins",
  20.     "\yTake Coins",
  21.     "\ySet Coins^n",
  22.     "\yReload Coins"
  23. }
  24.  
  25. public plugin_init()
  26. {
  27.     register_plugin("Admin Menu", "1.0", "Luxurious")
  28.  
  29.     register_concmd("say /ecmenu", "CoinsMenu", ADMIN_PASSWORD)
  30.     register_concmd("ecmenu", "CoinsMenu", ADMIN_PASSWORD)
  31.  
  32.     register_concmd("ENTER_Coins_NUMBER", "CoinsEntered")
  33.  
  34.     register_concmd("ENTER_Coins_Reset", "CoinsReset")
  35. }
  36.  
  37. public client_authorized(id)
  38. {
  39.     get_user_name(id, g_PlayerInfo[id][g_szName], charsmax(g_PlayerInfo[][g_szName]))
  40.     get_user_authid(id, g_PlayerInfo[id][g_szSteamID], charsmax(g_PlayerInfo[][g_szSteamID]))
  41. }
  42.  
  43. public plugin_natives()
  44. {
  45.     register_native("CoinsMenu","native_CoinsMenu",1)
  46. }
  47.  
  48. public native_CoinsMenu(id)
  49. {
  50.     CoinsMenu(id)
  51. }
  52.  
  53. public CoinsMenu(id)
  54. {
  55.     new iMenuID = menu_create("\rCoins Menu \w:", "CoinsMenuHandle")
  56.  
  57.     for(new i=0; i<sizeof(g_szCoinsMenuItems); i++) menu_additem(iMenuID, g_szCoinsMenuItems[i])
  58.  
  59.     menu_display(id, iMenuID)
  60. }
  61.  
  62. public CoinsMenuHandle(id, iMenuID, iItem)
  63. {
  64.     switch(iItem)
  65.     {
  66.         case 0, 1, 2:
  67.         {
  68.             g_PlayerInfo[id][g_iOption] = iItem+1
  69.             ChooseCoinsPlayer(id)
  70.         }
  71.         case 3:
  72.         {
  73.             client_cmd(id, "messagemode ENTER_COINS_Reset")
  74.         }
  75.  
  76.     }
  77.  
  78.     menu_destroy(iMenuID)
  79.    
  80.     return 0
  81. }
  82.  
  83. public ChooseCoinsPlayer(id)
  84. {
  85.     new szItem[64], szName[33], iMenuID = menu_create("\rChoose Target \w:", "ChooseCoinsPlayerHandle")
  86.  
  87.     for(new i=0, n=0; i<=32; i++)
  88.     {
  89.         if(!is_user_connected(i)) continue
  90.  
  91.         g_PlayerInfo[n++][g_iPlayer] = i
  92.  
  93.         get_user_name(i, szName, charsmax(szName))
  94.  
  95.         formatex(szItem, charsmax(szItem), "\y%s - \d[\r%d\d]", szName, ze_get_escape_coins(i))
  96.  
  97.         menu_additem(iMenuID, szItem, "0", 0)
  98.     }
  99.  
  100.     menu_display(id, iMenuID)
  101. }
  102.  
  103. public ChooseCoinsPlayerHandle(id, iMenuID, iItem)
  104. {
  105.     if (!is_user_connected(id))
  106.         return 1
  107.    
  108.     if ((!(iItem >= 0 && iItem <= 32)) || (!(g_iChoosen >= 0 && iItem <= 4)) ||
  109.     (!(g_iPlayer >= 0 && g_iPlayer <= 4)))
  110.     {
  111.         return 1
  112.     }
  113.    
  114.     g_PlayerInfo[id][g_iChoosen] = g_PlayerInfo[iItem][g_iPlayer]
  115.  
  116.     if(!is_user_connected(g_PlayerInfo[id][g_iChoosen]))
  117.     {
  118.  
  119.         client_print_color(id, print_chat, "%s Target Not Founded In The Server.", Prefix)
  120.  
  121.         return 1
  122.     }
  123.  
  124.     client_cmd(id, "messagemode ENTER_Coins_NUMBER")
  125.  
  126.     menu_destroy(iMenuID)
  127.  
  128.     return 0
  129. }
  130.  
  131. public CoinsEntered(id)
  132. {
  133.     new szNumber[32], iNumber, g_aName[33]
  134.  
  135.     get_user_name(id, g_aName, 32)
  136.  
  137.     read_argv(1, szNumber, charsmax(szNumber))
  138.  
  139.     iNumber = str_to_num(szNumber)
  140.  
  141.     if(!iNumber) return 1
  142.  
  143.     if(!is_user_connected(g_PlayerInfo[id][g_iChoosen]))
  144.     {
  145.         client_print_color(id, print_chat, "%s Target Not Founded In The Server.", Prefix)
  146.  
  147.         return 1
  148.     }
  149.  
  150.     switch(g_PlayerInfo[id][g_iOption])
  151.     {
  152.         case 1:
  153.         {
  154.  
  155.             ze_set_escape_coins(g_PlayerInfo[id][g_iChoosen], ze_get_escape_coins(g_PlayerInfo[id][g_iChoosen]) + iNumber)
  156.  
  157.             client_print_color(id, print_chat, "%s Admin ^3%s ^1have Gaved ^4%i ^1Escape Coins To ^3%s.", Prefix, g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  158.  
  159.             ze_log("ADMIN %s Gaved %i Coins To %s", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  160.  
  161.         }
  162.         case 2:
  163.         {
  164.             ze_set_escape_coins(g_PlayerInfo[id][g_iChoosen], ze_get_escape_coins(g_PlayerInfo[id][g_iChoosen]) - iNumber)
  165.  
  166.             client_print_color(id, print_chat, "%s Admin ^3%s ^1have Taked ^4%i ^1Escape Coins From ^3%s.", Prefix, g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  167.  
  168.             ze_log("ADMIN %s Taked %i Coins From %s", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])
  169.         }
  170.         case 3:
  171.         {
  172.             ze_set_escape_coins(g_PlayerInfo[id][g_iChoosen], iNumber)
  173.  
  174.             client_print_color(id, print_chat, "%s Admin ^3%s ^1have Set Coins Of ^3%s ^1To ^4%i ^1Escape Coins.", Prefix, g_aName, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName], iNumber)
  175.  
  176.             ze_log("ADMIN %s Have Set Coins Of %s To %i", g_aName, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName], iNumber)
  177.         }
  178.     }
  179.    
  180.     return 0
  181. }
  182.  
  183. public CoinsReset(id)
  184. {
  185.     new szNumber[32], iNumber, g_aName[33]
  186.    
  187.     get_user_name(id, g_aName, 32)
  188.  
  189.     read_argv(1, szNumber, charsmax(szNumber))
  190.  
  191.     iNumber = str_to_num(szNumber)
  192.  
  193.     if(!iNumber) return 1
  194.  
  195.     new iPlayers[32], iPlayerCount, i, player
  196.  
  197.     get_players(iPlayers, iPlayerCount, "a")
  198.  
  199.     for(i = 0; i < iPlayerCount; i++)
  200.     {
  201.         player = iPlayers[i]
  202.  
  203.         if(ze_get_escape_coins(player) >= iNumber)
  204.  
  205.             continue
  206.  
  207.         ze_set_escape_coins(player, iNumber)
  208.     }
  209.  
  210.     client_print_color(id, print_chat, "%s Admin ^3%s ^1have Reset Coins To ^3^%i ^4Escape Coins.", Prefix, g_aName, iNumber)
  211.  
  212.     ze_log("ADMIN %s Have Set Coins To %i Escape Coins", g_aName, iNumber)
  213.  
  214.     return 0
  215. }
  216.  
  217.  
  218.  
  219. stock ze_log(const message_fmt[], any:...)
  220. {
  221.  
  222.     static message[256], filename[32]
  223.  
  224.     vformat(message, charsmax(message), message_fmt, 2)
  225.  
  226.     formatex(filename, charsmax(filename), "ze_Adminmenu.log")
  227.  
  228.     log_to_file(filename, "%s", message)
  229. }
can fix it, i click on set and add coins nothing happenes not give coins

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest