AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   Dynamic Items in Menu and Plugin API (https://forums.alliedmods.net/showthread.php?t=123445)

AfteR. 04-17-2010 23:58

Re: Dynamic Items in Menu and Plugin API
 
Great tutorial. Thanks.

Alucard^ 04-18-2010 03:16

Re: Dynamic Items in Menu and Plugin API
 
Exolent, you repeated the tutorial 2 times.

Btw, nice job.

Exolent[jNr] 04-18-2010 03:21

Re: Dynamic Items in Menu and Plugin API
 
Quote:

Originally Posted by Alucard^ (Post 1153709)
Exolent, you repeated the tutorial 2 times.

No I didn't.

Quote:

Originally Posted by Exolent[jNr] (Post 1150303)
Added specific callback function example.


FiFiX 04-18-2010 05:03

Re: Dynamic Items in Menu and Plugin API
 
Quote:

Originally Posted by wrecked_ (Post 1153513)
Pages:
  • First Page
    • 9 - More
    • 0 - Exit
  • Middle Pages
    • 9 - More
    • 0 - Back
  • Last Page
    • 0 - Back

About your second question; yes, that'd work if you were able to manually have clients connect like that, but I'm pretty sure Valve patched that. Not sure, though.

  • First Page
    • 1 - g_serwer[1]
    • 2 - g_serwer[2]
    • 3 - g_serwer[3]
    • 4 - g_serwer[4]
    • 6 - g_serwer[5]
    • 7 - g_serwer[6]
    • 8 - g_serwer[7]
    • 9 - More
    • 0 - Exit
  • Second Pages
    • 1 - g_serwer[8]
    • 2 - g_serwer[9]
    • 3 - g_serwer[10]
    • 4 - g_serwer[11]
    • 6 - g_serwer[12]
    • 7 - g_serwer[13]
    • 8 - g_serwer[14]
    • 9 - More
    • 0 - Back
  • Last Page
    • 1 - g_serwer[15]
    • 2 - g_serwer[16]
    • 3 - g_serwer[17]
    • 4 - g_serwer[18]
    • 6 - g_serwer[19] <-- If I'll chose this
    • 7 - g_serwer[20]
    • 8 - g_serwer[21]
    • 0 - Back

It will connect with g_ip[19] according to my second question?

wrecked_ 04-18-2010 11:30

Re: Dynamic Items in Menu and Plugin API
 
Array indices begin at 0. So if you pick 7, you should get g_serwer[6]. It all depends on your for loop. If you're starting from 1, you won't get the first server from the array.

FiFiX 04-18-2010 11:57

Re: Dynamic Items in Menu and Plugin API
 
Anyway, if there is on third page 7. g_serwer[18]
and I'll make new key = str_to_num(szNum)
and use g_ip[key] key will be = 18?

wrecked_ 04-18-2010 12:01

Re: Dynamic Items in Menu and Plugin API
 
What? If you want the key to correspond with the server indice, just do client_cmd( id, "Connect %s", serwer[key-1] )

FiFiX 04-18-2010 12:19

Re: Dynamic Items in Menu and Plugin API
 
But it will be working fine on page higher than one? I'm not sure if szKey is number which someone pressed, or number of item in menu(including or not including 9. Back and 0. Exit)

wrecked_ 04-18-2010 13:18

Re: Dynamic Items in Menu and Plugin API
 
Don't worry about the back and next items, they don't count when you get the data (menu_item_getinfo), so your key will be the same as what you added in the menu_additem.

Exolent[jNr] 04-18-2010 13:29

Re: Dynamic Items in Menu and Plugin API
 
You are getting off topic. Make another thread in Scripting Help.


All times are GMT -4. The time now is 14:54.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.