Menuitems from ini
Hi. I want a plugin, that makes a menu with items from an ini file. So I have an ini file like this:
PHP Code:
I've tried to make it, but i've an error: PHP Code:
PHP Code:
Than i have another error: PHP Code:
PHP Code:
Edit: realised that the 3rd param needs a string, but will this solve the second error too? :/ |
Re: Menuitems from ini
Last param is a callback , search the Emp's menu tuto.
|
Re: Menuitems from ini
Don't use read_file(). Use fopen(), fgets(), and fclose(). See a file tutorial.
You can't use a variable as a case. It must be a constant. To me, it looks like you don't even need a switch. If you just pass the sound name as the "data" parameter in the add menu item function then you can just use that for the command to play the sound. |
Re: Menuitems from ini
Thanks both. Fysiks can you give me a file tutorial and can you show me an example of playing music from menu by a list of menuitems from ini file? :)
Thank you. |
Re: Menuitems from ini
Quote:
I already told you how to do the menu part but maybe it might help to know that in the documentation for menu_additem() the "command" argument is the argument to which I am refering when I say "data". EDIT: I thought there was a tutorial for files but I see there is isn't a good one so for using the file functions you can look at plugins that use it already. A simple example is my Bot Apology plugin (in my signature). |
Re: Menuitems from ini
No. I don't want to write me the whole plugin. I want to write it by myself. I just don't know wat exactly is "pass the sound name as data". If you explain it, i will be able to write it :D
|
Re: Menuitems from ini
Are you searching a menu that has music from an ini?
|
Re: Menuitems from ini
yes
|
Re: Menuitems from ini
Spoiler
I do this some time ago , and the ini config : PHP Code:
|
Re: Menuitems from ini
Thanks a lot :)
|
| All times are GMT -4. The time now is 15:15. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.