AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Request menu (https://forums.alliedmods.net/showthread.php?t=114004)

One 01-01-2010 08:06

Request menu
 
hi,

i'm working on my mp3 player plugin ( http://www.youtube.com/watch?v=pIb-kGtAGEs ) and want to add a new item for request albums/tracks.

now i have no idea how to add a item like :

1. request your track/album

after pressing 1, player has to say/write the message. after this, i want to send this in console. like plugins menu in admin menu, when u want to change a Cvar.
the output of say must be anything like :

console = request "text".
and not say: request "text".

the problem : i'm using new menu system :(

Xellath 01-01-2010 09:27

Re: Request menu
 
That's quite simple actually, just put them in messagemode when they press the button.

Something like this:

Code:
public plugin_init( ) {     register_clcmd( "requestsong", "MessageMode_Request" ); } public MenuHandler( iClient, hMenu, iItem ) {     if( iItem == ITEM_EXIT )     {         return PLUGIN_HANDLED;     }         new szInfo[ 3 ];     new iAccess, iCallback;     menu_item_getinfo( hMenu, iItem, iAccess, szInfo, 2, _, _, iCallback );         switch( str_to_num( szInfo ) )     {         case 1: client_cmd( iClient, "messagemode requestsong" );     }         return PLUGIN_HANDLED; } public MessageMode_Request( iClient ) {     new szRequest[ 64 ];     read_args( szRequest, charsmax( szRequest ) );         log_amx( szRequest );         // just as a side note; this can easily be spammed     // so i would suggest you to add a check, or limit the amount     // of requests that can be submitted. }

One 01-01-2010 13:05

Re: Request menu
 
awesome. ty. for sure i limited the amount of requests. ( a player can send next request, first after 60 sec. ) i know its not a good limit but it's ok. then i'll save all requests in a file and i can delete the requests.
ty


All times are GMT -4. The time now is 04:05.

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