Raised This Month: $60 Target: $400
 15% 

[REQ] Vipmenu Help


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 05-31-2013 , 16:10   [REQ] Vipmenu Help
#1

Hi, i have problem vipmenu 4 error.

warning 217: loose indentation
error 029: invalid expression, assumed zero
error 017: undefined symbol "menu_handler"
error 017: undefined symbol "item"
fatal error 107: too many error messages on one line

Compilation aborted.
4 Errors.

Code:
Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>

#define ACCESSFLAG_MAX_LENGTH 2

// Settings file
new bool:has_used[33] 

// Access flags
new g_access_vip[ACCESSFLAG_MAX_LENGTH] = "t"

public plugin_init()
{
register_plugin("[HNS] VIP", "1.0", "FY E1")

register_clcmd( "say /vipmenu", "VIPMenu");
register_clcmd( "say_team /vipmenu", "VIPMenu");

register_logevent("event_new_round", 2, "1=Round_Start")
}

public VIPMenu( id ) 
{ 
if(!has_used[id]) 
{ 
{ 
new vip_menu = menu_create( "Vipmenu:", "menu_handler" ); 
menu_additem( vip_menu, "Health", "1", 0 ); 
menu_additem( vip_menu, "Weapon", "2", 0 ); 
menu_additem( vip_menu, "Granade", "3", 0); 

menu_setprop( vip_menu, MPROP_EXIT, MEXIT_ALL ); 
menu_display( id, vip_menu, 0 ); 
} 
} 

public menu_handler( id, menu, item ) 
{ 
if( item == MENU_EXIT ) 
{ 
menu_destroy( menu ); 
return PLUGIN_HANDLED; 
} 
new data[6], iName[64]; 
new access, callback; 

menu_item_getinfo( menu, item, access, data,5, iName, 63, callback ); 
new key = str_to_num( data ); 
switch( key ) 
{ 
case 1: 
{ 
if (!(get_user_flags(id) & read_flags(g_access_vip)))
return;

set_user_health( id, 150 );
} 
case 2: 
{ 
if (!(get_user_flags(id) & read_flags(g_access_vip)))
return;

give_item( id, "weapon_usp" )
} 
case 3: 
{ 
if (!(get_user_flags(id) & read_flags(g_access_vip)))
return;

give_item( id, "weapon_hegrenade" )
give_item( id, "weapon_flashbang" )
give_item( id, "weapon_smokegrenade" )
}

has_used[id] = true; 
menu_destroy( menu ); 
return PLUGIN_HANDLED; 
} 

public event_new_round() 
arrayset(has_used, false, 33)

Last edited by YamiKaitou; 06-03-2013 at 14:35.
Kellan123 is offline
Blizzard_87
AlliedModders Donor
Join Date: Oct 2012
Old 05-31-2013 , 19:02   Re: [REQ] Vipmenu Help
#2

Code:
public VIPMenu( id ) {     if(!has_used[id])     {         {         new vip_menu = menu_create( "Vipmenu:", "menu_handler" );         menu_additem( vip_menu, "Health", "1", 0 );         menu_additem( vip_menu, "Weapon", "2", 0 );         menu_additem( vip_menu, "Granade", "3", 0);           menu_setprop( vip_menu, MPROP_EXIT, MEXIT_ALL );         menu_display( id, vip_menu, 0 );         } }

change to

Code:
public VIPMenu( id ) {     if(!has_used[id])     {         {         new vip_menu = menu_create( "Vipmenu:", "menu_handler" );         menu_additem( vip_menu, "Health", "1", 0 );         menu_additem( vip_menu, "Weapon", "2", 0 );         menu_additem( vip_menu, "Granade", "3", 0);           menu_setprop( vip_menu, MPROP_EXIT, MEXIT_ALL );         menu_display( id, vip_menu, 0 );         }     } }
__________________
Blizzard_87 is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 05-31-2013 , 19:26   Re: [REQ] Vipmenu Help
#3

Quote:
Originally Posted by Blizzard_87 View Post
Code:
public VIPMenu( id )
{
if(!has_used[id])
{ {
new vip_menu = menu_create( "Vipmenu:", "menu_handler" );
menu_additem( vip_menu, "Health", "1", 0 );
menu_additem( vip_menu, "Weapon", "2", 0 );
menu_additem( vip_menu, "Granade", "3", 0);

menu_setprop( vip_menu, MPROP_EXIT, MEXIT_ALL );
menu_display( id, vip_menu, 0 );
}
}


change to

Code:
public VIPMenu( id )
{
if(!has_used[id])
{ {
new vip_menu = menu_create( "Vipmenu:", "menu_handler" );
menu_additem( vip_menu, "Health", "1", 0 );
menu_additem( vip_menu, "Weapon", "2", 0 );
menu_additem( vip_menu, "Granade", "3", 0);

menu_setprop( vip_menu, MPROP_EXIT, MEXIT_ALL );
menu_display( id, vip_menu, 0 );
}
}
}

warning 217: loose indentation
warning 209: function "menu_handler" should return a value
warning 209: function "menu_handler" should return a value
warning 209: function "menu_handler" should return a value
error 002: only a single statement (or expression) can follow each "case"
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
fatal error 107: too many error messages on one line

Compilation aborted.
4 Errors.

Last edited by YamiKaitou; 06-03-2013 at 14:35.
Kellan123 is offline
Blizzard_87
AlliedModders Donor
Join Date: Oct 2012
Old 05-31-2013 , 19:43   Re: [REQ] Vipmenu Help
#4

sorry im at work and completely missed lol

Code:
public VIPMenu( id ) {     if(!has_used[id])     {         new vip_menu = menu_create( "Vipmenu:", "menu_handler" );         menu_additem( vip_menu, "Health", "1", 0 );         menu_additem( vip_menu, "Weapon", "2", 0 );         menu_additem( vip_menu, "Granade", "3", 0);           menu_setprop( vip_menu, MPROP_EXIT, MEXIT_ALL );         menu_display( id, vip_menu, 0 );     } }
__________________
Blizzard_87 is offline
Cheezpuff
BANNED
Join Date: Oct 2012
Location: City of the Dead
Old 05-31-2013 , 22:56   Re: [REQ] Vipmenu Help
#5

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
 
#define ACCESSFLAG_MAX_LENGTH 2
 
// Settings file
new bool:has_used[33]   
 
// Access flags
new g_access_vip[ACCESSFLAG_MAX_LENGTH] = "t"
 
public plugin_init()
{
       
register_plugin("[HNS] VIP""1.0""FY E1")
 
       
register_clcmd"say /vipmenu""VIPMenu");
       
register_clcmd"say_team /vipmenu""VIPMenu");
 
       
register_logevent("event_new_round"2"1=Round_Start")
}
 
public 
VIPMenuid ) { 
    if(!
has_used[id]) 
    { 
        new 
vip_menu menu_create"Vipmenu:""menu_handler" ); 
        
menu_additemvip_menu"Health""1"); 
        
menu_additemvip_menu"Weapon""2"); 
        
menu_additemvip_menu"Granade""3"0); 
 
        
menu_setpropvip_menuMPROP_EXITMEXIT_ALL ); 
        
menu_displayidvip_menu);
    
        return 
PLUGIN_HANDLED;     
    }
}
 
public 
menu_handler(idmenuitem)
{
        if( 
item == MENU_EXIT )
        {
                
menu_destroy(menu);
                return 
PLUGIN_HANDLED;
        }
        new 
data[12], iName[64];
        new 
accesscallback;
        
menu_item_getinfo(menuitemaccessdata,5iName63callback);
       
        new 
key str_to_num(data);
       
        switch(
key)
        {
          case 
1
        { 
        if (!(
get_user_flags(id) & read_flags(g_access_vip)))
        return;
 
        
set_user_healthid150 );
        } 
          case 
2
        { 
        if (!(
get_user_flags(id) & read_flags(g_access_vip)))
        return;
 
        
give_itemid"weapon_usp" )
        } 
          case 
3
        { 
        if (!(
get_user_flags(id) & read_flags(g_access_vip)))
        return;
 
        
give_itemid"weapon_hegrenade" )
        
give_itemid"weapon_flashbang" )
        
give_itemid"weapon_smokegrenade" )
        }
    }
}      
 
public 
event_new_round() 
        
arrayset(has_usedfalse33
Cheezpuff is offline
Send a message via Skype™ to Cheezpuff
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 06-01-2013 , 06:10   Re: [REQ] Vipmenu Help
#6

Quote:
Originally Posted by Blizzard_87 View Post
sorry im at work and completely missed lol


Code:
Code:
public VIPMenu( id ) { 
 if(!has_used[id]) 
 { new vip_menu = menu_create( "Vipmenu:", "menu_handler" ); 
 menu_additem( vip_menu, "Health", "1", 0 ); 
 menu_additem( vip_menu, "Weapon", "2", 0 ); 
 menu_additem( vip_menu, "Granade", "3", 0); 

 menu_setprop( vip_menu, MPROP_EXIT, MEXIT_ALL ); 
 menu_display( id, vip_menu, 0 ); 
 }
}
/home/groups/alliedmodders/forums/files/1/9/0/4/1/5/120609.attach(44) : warning 217: loose indentation
/home/groups/alliedmodders/forums/files/1/9/0/4/1/5/120609.attach(54) : warning 209: function "menu_handler" should return a value
/home/groups/alliedmodders/forums/files/1/9/0/4/1/5/120609.attach(61) : warning 209: function "menu_handler" should return a value
/home/groups/alliedmodders/forums/files/1/9/0/4/1/5/120609.attach(6 : warning 209: function "menu_handler" should return a value
/home/groups/alliedmodders/forums/files/1/9/0/4/1/5/120609.attach(75) : error 002: only a single statement (or expression) can follow each "case"
/home/groups/alliedmodders/forums/files/1/9/0/4/1/5/120609.attach(75) : error 029: invalid expression, assumed zero
/home/groups/alliedmodders/forums/files/1/9/0/4/1/5/120609.attach(75) : warning 215: expression has no effect
/home/groups/alliedmodders/forums/files/1/9/0/4/1/5/120609.attach(75) : error 001: expected token: ";", but found "]"
/home/groups/alliedmodders/forums/files/1/9/0/4/1/5/120609.attach(75) : fatal error 107: too many error messages on one line

Compilation aborted. 4 Errors.

Quote:
Originally Posted by Cheezpuff View Post
Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>

#define ACCESSFLAG_MAX_LENGTH 2

// Settings file
new bool:has_used[33] 

// Access flags
new g_access_vip[ACCESSFLAG_MAX_LENGTH] = "t"

public plugin_init()
{
register_plugin("[HNS] VIP", "1.0", "FY E1")

register_clcmd( "say /vipmenu", "VIPMenu");
register_clcmd( "say_team /vipmenu", "VIPMenu");

register_logevent("event_new_round", 2, "1=Round_Start")
}

public VIPMenu( id ) { 
if(!has_used[id]) 
{ 
new vip_menu = menu_create( "Vipmenu:", "menu_handler" ); 
menu_additem( vip_menu, "Health", "1", 0 ); 
menu_additem( vip_menu, "Weapon", "2", 0 ); 
menu_additem( vip_menu, "Granade", "3", 0); 

menu_setprop( vip_menu, MPROP_EXIT, MEXIT_ALL ); 
menu_display( id, vip_menu, 0 );

return PLUGIN_HANDLED; 
}
}

public menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[12], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

new key = str_to_num(data);

switch(key)
{
case 1: 
{ 
if (!(get_user_flags(id) & read_flags(g_access_vip)))
return;

set_user_health( id, 150 );
} 
case 2: 
{ 
if (!(get_user_flags(id) & read_flags(g_access_vip)))
return;

give_item( id, "weapon_usp" )
} 
case 3: 
{ 
if (!(get_user_flags(id) & read_flags(g_access_vip)))
return;

give_item( id, "weapon_hegrenade" )
give_item( id, "weapon_flashbang" )
give_item( id, "weapon_smokegrenade" )
}
}
} 

public event_new_round() 
arrayset(has_used, false, 33)
5 error and cant open /vipmenu

Last edited by YamiKaitou; 06-03-2013 at 14:35.
Kellan123 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-01-2013 , 06:28   Re: [REQ] Vipmenu Help
#7

Fixed:
Code:
#include <amxmodx> #include <fun> // Settings var new bool:has_used[33]    // Access flags #define ADMIN_VIP   ADMIN_LEVEL_H new g_iMenu; public plugin_init() {     register_plugin("[HNS] VIP", "1.0", "Some New Author ;)")         register_clcmd( "say /vipmenu", "VIPMenu");     register_clcmd( "say_team /vipmenu", "VIPMenu");         register_logevent("event_new_round", 2, "1=Round_Start");         g_iMenu = menu_create( "Vipmenu:", "menu_handler" );         menu_additem( g_iMenu, "Health" );     menu_additem( g_iMenu, "Weapon" );     menu_additem( g_iMenu, "Grenade" )} public VIPMenu( id ) {     if( !has_used[ id ] && get_user_flags( id ) & ADMIN_VIP )         menu_display( id, g_iMenu ); } public menu_handler( id, menu, item ) {     if( item != MENU_EXIT )     {                 switch( item )         {             case 0:             {                 set_user_health( id, 150 );             }                         case 1:             {                 give_item( id, "weapon_usp" )             }                         case 2:             {                 give_item( id, "weapon_hegrenade" )                 give_item( id, "weapon_flashbang" )                 give_item( id, "weapon_smokegrenade" )             }         }                 has_used[id] = true;     } }     public event_new_round()     arrayset( has_used, false, sizeof has_used );
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 06-01-2013 at 06:29.
hornet is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 06-01-2013 , 07:41   Re: [REQ] Vipmenu Help
#8

hornet i don't like this code ...

Last edited by Kellan123; 06-01-2013 at 07:44.
Kellan123 is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 06-01-2013 , 08:45   Re: [REQ] Vipmenu Help
#9

Quote:
Originally Posted by Kellan123 View Post
hornet i don't like this code ...
why dont you like it?
EpicMonkey is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 06-01-2013 , 11:06   Re: [REQ] Vipmenu Help
#10

old code fix.
Kellan123 is offline
Closed Thread


Thread Tools
Display Modes

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 04:33.


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