Raised This Month: $ Target: $400
 0% 

How to add commands ? :D


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
cofisx
Junior Member
Join Date: Oct 2012
Old 10-23-2012 , 14:27   How to add commands ? :D
Reply With Quote #1

Hello ! Im newbie in scripting
So i need pros help

I made this (somehove its works)

Code:
public OnPluginStart()
{
    RegAdminCmd("mix",
        Command_mix,
        ADMFLAG_ROOT,
        "Mix meniu");
}
 
public PanelHandler1(Handle:menu, MenuAction:action, param1, param2)
{
    if (action == MenuAction_Select)
    {
        PrintToConsole(param1, "You selected item: %d", param2);
    } else if (action == MenuAction_Cancel) {
        PrintToServer("Client %d's menu was cancelled.  Reason: %d", param1, param2);
    }
}
 
public Action:Command_mix(client, args)
{
    new Handle:panel = CreatePanel();
    SetPanelTitle(panel, "Mix Menu");
    DrawPanelItem(panel, "Yes");
    DrawPanelItem(panel, "No");
 
    SendPanelToClient(panel, client, PanelHandler1, 20);
 
    CloseHandle(panel);
 
    return Plugin_Handled;
}
So what i want is commands if you can see its from wiki

So i whant to add commands but i dont know how.

When i write !mix in chat the menu shows up and there is 2 choises "Yes" and "No"

How to add commands like "Restart" "Live" and more ?

(Sorry for bad english)
cofisx is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:56.


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