AMXX Mod begginer problem.
Hey, I've been learning PASCAL for the last three years, and I decided it's about time I'll made some plugins I've always wanted to see for the HL-Engine.
So, i read almost all of the doc on the site, and started scripting. I ran into a problem with the menu tutorial, infact not a problem, I just don't understand some of the code there. Let me show you what i mean.. (The link if you want to take a look at the whoel tutorial: http://www.amxmodx.org/doc/source/sc...nced.htm#menus ) Code:
//The clcmd function will just give us the player idnew menu[192]: What does this Variable do ? Why 192 ? It wasn't explained in the tutorial. format(menu, 191, "Which Weapon?^n^n1. AK47^n2. M4A1^n3. AWP"): menu, and 191, why ? What does menu do here ? Why 191 ? And I'd be glad if you could explain the whole format function for me, however that's not very important. show_menu(id, keys, menu): Why does he call that function ? I see it nowhere in the program, if it's a core function (probably is) care to explain what "menu" has to do with it ? public giveWeapon(id, key): How is it called ? I see it called nowhere.. And if its called and i somehow missed that, how does it get its id and key ? Thanks alot, wnn. |
I couldn't seem to edit my post, sorry for double posting.
I realised my first two questions (oh boy i feel dumb ;) ): Quote:
Edit: I seem to be able to edit now.. |
show_menu(id, keys, menu)
Actually shows the menu. id is the id of the player. keys is a bitmask of the keys he can press. menu is the menu body, which the plugin has constructed in the format() line. I'd bet that in public plugin_init(), the plugin uses a register_menu command and passes "giveWeapon" as one of the parameter. As the menu body he passes to show_menu contains the other parameter the author gave register_menu, that function will be called when the player presses a key. |
| All times are GMT -4. The time now is 09:52. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.