Raised This Month: $51 Target: $400
 12% 

[CSGO] Vip Plugin help!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Krotis
Senior Member
Join Date: Aug 2012
Old 06-26-2015 , 10:24   [CSGO] Vip Plugin help!
Reply With Quote #1

Hello! Im looking for some help with my VIP menu.
When I choose something from the menu it doesnt execute the command and nothing shows up

PHP Code:
    public Plugin:myinfo 
    {
        
name "vipmenu",
        
author "GameOnline.nu",
    }

public 
OnPluginStart()
{
    
RegAdminCmd("sm_vip"Panel_VipADMFLAG_CUSTOM2"Opens the VIP Menu");
    
RegAdminCmd("sm_vipmenu"Panel_VipADMFLAG_CUSTOM2"Opens the VIP Menu");
}
 
public 
MenuHandler(Handle:menuMenuAction:actionparam1param2) {
    if (
action == MenuAction_Select)
       { if(
param2 == 1) {
            
FakeClientCommand(param1"say /trails");
        } else if(
param2 == 2) {
            
FakeClientCommand(param1"sm_hats");
        } else if(
param2 == 3) {
            
FakeClientCommand(param1"say !ws");
        } else if(
param2 == 4) {
            
FakeClientCommand(param1"sm_knife");
        } else if(
action == MenuAction_Cancel) {
        
CloseHandle(menu);
        }
    }
}

public 
Action:Panel_Vip(clientargs) {
    new 
Handle:menu CreateMenu(MenuHandler);
    
SetMenuTitle(menu"VIP Menu");
    
AddMenuItem(menu"trails""Trails");
    
AddMenuItem(menu"hats""Hats");
    
AddMenuItem(menu"skins""Skins");
    
AddMenuItem(menu"knife""Knife");
    
SetMenuExitButton(menutrue);
    
DisplayMenu(menuclient20);
    
    
CloseHandle(menu);
    
    return 
Plugin_Handled;


Last edited by Krotis; 06-26-2015 at 10:30.
Krotis is offline
lechoo
Member
Join Date: Jul 2010
Location: Poland
Old 06-26-2015 , 13:05   Re: [CSGO] Vip Plugin help!
Reply With Quote #2

Use strcmp with "trails" instead of "if(param2 == 1)", and so on.
__________________
Sorry for my bad English
lechoo is offline
Send a message via Skype™ to lechoo
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 06-26-2015 , 13:34   Re: [CSGO] Vip Plugin help!
Reply With Quote #3

How does this work?
PHP Code:
public OnPluginStart()
{
    
RegAdminCmd("sm_vip"Panel_VipADMFLAG_CUSTOM2"Opens the VIP Menu");
    
RegAdminCmd("sm_vipmenu"Panel_VipADMFLAG_CUSTOM2"Opens the VIP Menu");
}
 
public 
MenuHandler(Handle:menuMenuAction:actionparam1param2) {
    switch (
action) {
        case 
MenuAction_Select: {
            new 
String:info[64];
            
GetMenuItem(menuparam2infosizeof(info));
            
            if (
StrEqual(info"trails")) {
                
FakeClientCommand(param1"say /trails");
            } else if (
StrEqual(info"hats")) {
                
FakeClientCommand(param1"sm_hats");
            } else if (
StrEqual(info"skins")) {
                
FakeClientCommand(param1"say !ws");
            } else if (
StrEqual(info"knife")) {
                
FakeClientCommand(param1"sm_knife");
            }
        }
        case 
MenuAction_Cancel: {
            
CloseHandle(menu);
        }
    }
}

public 
Action:Panel_Vip(clientargs) {
    new 
Handle:menu CreateMenu(MenuHandler);
    
SetMenuTitle(menu"VIP Menu");
    
AddMenuItem(menu"trails""Trails");
    
AddMenuItem(menu"hats""Hats");
    
AddMenuItem(menu"skins""Skins");
    
AddMenuItem(menu"knife""Knife");
    
SetMenuExitButton(menutrue);
    
DisplayMenu(menuclient20);
    
    return 
Plugin_Handled;

KissLick is offline
Krotis
Senior Member
Join Date: Aug 2012
Old 06-26-2015 , 14:16   Re: [CSGO] Vip Plugin help!
Reply With Quote #4

Quote:
Originally Posted by lechoo View Post
Use strcmp with "trails" instead of "if(param2 == 1)", and so on.
Can you show me an exempel
Just started some basic scripting

Last edited by Krotis; 06-26-2015 at 15:17.
Krotis is offline
Darkness_
Veteran Member
Join Date: Nov 2014
Old 06-26-2015 , 15:56   Re: [CSGO] Vip Plugin help!
Reply With Quote #5

Why not just store the command you want them to run in the menu buttons itself?

Example:
PHP Code:
AddMenuItem(menu"sm_trails""Trails");
AddMenuItem(menu"sm_ws""Weapon Skins"); 
By doing this you can just get the info from the menu and run fake client command on that.
PHP Code:
//Check to make sure the action was MenuAction_Select.
char info[64];
GetMenuItem(menuparam2infosizeof(info));
FakeClientCommand(param1info); 

Last edited by Darkness_; 06-26-2015 at 15:57.
Darkness_ is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 06-26-2015 , 16:12   Re: [CSGO] Vip Plugin help!
Reply With Quote #6

Quote:
Originally Posted by Darkness_ View Post
Why not just store the command you want them to run in the menu buttons itself?

Example:
PHP Code:
AddMenuItem(menu"sm_trails""Trails");
AddMenuItem(menu"sm_ws""Weapon Skins"); 
By doing this you can just get the info from the menu and run fake client command on that.
PHP Code:
//Check to make sure the action was MenuAction_Select.
char info[64];
GetMenuItem(menuparam2infosizeof(info));
FakeClientCommand(param1info); 
Wouldn't work if the plugin scan chat for the !command message (not a registred command).

So
PHP Code:
AddMenuItem(menu"say /trails""Trails");
AddMenuItem(menu"say !ws""Weapon Skins"); 

Last edited by KissLick; 06-26-2015 at 16:40.
KissLick is offline
Krotis
Senior Member
Join Date: Aug 2012
Old 06-26-2015 , 16:35   Re: [CSGO] Vip Plugin help!
Reply With Quote #7

Quote:
Originally Posted by Darkness_ View Post
Why not just store the command you want them to run in the menu buttons itself?

Example:
PHP Code:
AddMenuItem(menu"sm_trails""Trails");
AddMenuItem(menu"sm_ws""Weapon Skins"); 
By doing this you can just get the info from the menu and run fake client command on that.
PHP Code:
//Check to make sure the action was MenuAction_Select.
char info[64];
GetMenuItem(menuparam2infosizeof(info));
FakeClientCommand(param1info); 
Tryed it before, But I need to use some chat functions to.
Krotis is offline
Krotis
Senior Member
Join Date: Aug 2012
Old 06-26-2015 , 18:48   Re: [CSGO] Vip Plugin help!
Reply With Quote #8

No one that can help me?
Please if possible post the full code!
Krotis is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 06-26-2015 , 19:26   Re: [CSGO] Vip Plugin help!
Reply With Quote #9

lol
Miu is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 06-27-2015 , 15:34   Re: [CSGO] Vip Plugin help!
Reply With Quote #10

Quote:
Originally Posted by Krotis View Post
No one that can help me?
Please if possible post the full code!
This is a forum where others help you with your scripting issue.

It is not a "code giveaway"-section where you will be spoon-fed with solutions.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
Reply



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 08:54.


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