Raised This Month: $ Target: $400
 0% 

Errors.. Compile... Menu!!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-07-2009 , 11:32   Errors.. Compile... Menu!!
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <fun>
#include <fakemeta>

#define PLUGIN "ScoutKnifeZ_Manager"
#define VERSION "0.1"
#define AUTHOR "TitANious"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("ScoutKnifeZMenu",    "cmdScoutKnifeZMenu")
    
register_clcmd("say g800",        "cmdGravity800")
    
register_clcmd("say g600",        "cmdGravity600")
    
register_clcmd("say g400",        "cmdGravity400")
    
register_clcmd("say g200",        "cmdGravity200")
    
register_clcmd("say g100",        "cmdGravity100")
    
register_clcmd("say_team g800",        "cmdGravity800")
    
register_clcmd("say_team g600",        "cmdGravity600")
    
register_clcmd("say_team g400",        "cmdGravity400")
    
register_clcmd("say_team g200",        "cmdGravity200")
    
register_clcmd("say_team g100",        "cmdGravity100")            
    
register_clcmd("say /sg550",        "cmdGiveSG550");             
    
register_clcmd("say /g3sg1",        "cmdGiveG3SG1");             
    
register_clcmd("say /awp",            "cmdGiveAWP");                         
    
register_clcmd("say_team /g3sg1",       "cmdGiveG3sg1");
    
register_clcmd("say_team /awp",       "cmdGiveAWP");
    
register_clcmd"say_team /sg550",    "cmdGiveSg550"); 
}
public 
cmdScoutKnifeZMenu(id) {
    new 
menu menu_create ("\rMenu for ScoutKnifeZ_Manager!:""1")
    
menu_additem(cmdScoutKnifeZMenu"\wGravity800""1"1)
    
menu_additem(cmdScoutKnifeZMenu"\wGravity600""2"1)
    
menu_additem(cmdScoutKnifeZMenu"\wGravity400""3"1)
    
menu_additem(cmdScoutKnifeZMenu"\wGravity200""4"1)
    
menu_additem(cmdScoutKnifeZMenu"\wGravity100""5"1)
    
menu_additem(cmdScoutKnifeZMenu"\wGiveSg550""6"1)
    
menu_additem(cmdScoutKnifeZMenu"\wGiveAWP""7"1)
    
menu_additem(cmdScoutKnifeZMenu"\wGiveG3sg1""8"1)
    
menu_setprop(cmdScoutKnifeZMenuMPROP_EXIT)
    
menu_display(idcmdScoutKnifeZMenu1)
    if (
item == MENU_EXIT)
    {
        
menu_destroy(Menu)
        return 
PLUGIN_HANDLED
    
}
    new 
data[6], iName[64]
    new 
accesscallback
    
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)
    
    new 
key str_to_num(data)
    
    switch(
1)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANLED
        
}
    switch(
2)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
}
    switch(
3)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
}
    switch(
4)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
}
    switch(
5)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
}
    switch(
6)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
}
    switch(
7)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
}
    switch(
8)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
}
    switch(
9)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
}
public 
cmdGravity800(id) {
    
set_user_gravity(id1.0)
    
client_print(idprint_chat"You have 800 gravity, isnt that normal?")
}
public 
cmdGravity600(id) {
    
set_user_gravity(id0.75)
    
client_print(idprint_chat"600 gravity, a bit less than 800, nothing less?")
}
public 
cmdGravity400(id) {
    
set_user_gravity(id0.5)
    
client_print(idprint_chat"400, the half of normal!")
}
public 
cmdGravity200(id) {
    
set_user_gravity(id0.125)
    
client_print(idprint_chat"200, the half of 400, you jump high now")
}
public 
cmdGravity100(id) {
    
set_user_gravity(id0.125)
    
client_print(idprint_chat"100, the less in the whole server!")
}
public 
cmdGiveSG550id ) { 
    
client_cmd(id"slot1; drop")                     
    
give_itemid"weapon_sg550" );                  
    
give_itemid"ammo_556nato" );                    
    
give_itemid"ammo_556nato" );                
    
give_itemid"ammo_556nato" );                
    
give_itemid"ammo_556nato" );                    
    
give_itemid"ammo_556nato" );                
    
client_print(idprint_chat"Didnt i deleted SG550?!")        

public 
cmdGiveG3SG1(id ){ 
    
client_cmd(id"slot1; drop")                     
    
give_item(id"weapon_g3sg1");                  
    
give_item(id"ammo_762nato");                    
    
give_item(id"ammo_762nato");                    
    
give_item(id"ammo_762nato");                    
    
give_item(id"ammo_762nato");                    
    
give_item(id"ammo_762nato");                    
    
give_item(id"ammo_762nato");                    
    
client_print(idprint_chat"Did you really buy a G3SG1?!")    

public 
cmdGiveAWPid ) { 
    
client_cmd(id"slot1; drop")                    
    
give_itemid"weapon_awp" );                      
    
give_itemid"ammo_338magnum" );                
    
give_itemid"ammo_338magnum" );                
    
give_itemid"ammo_338magnum" );                
    
give_itemid"ammo_338magnum" );                
    
give_itemid"ammo_338magnum" );                
    
client_print(idprint_chat"Isnt a AWP forbidden?!")        
}  

public 
respawn_player(id)
{
    if(
is_user_connected(id))
    {
    
set_pev(id,pev_deadflag,DEAD_RESPAWNABLE);
        
set_pev(idpev_iuser10);
        
dllfunc(DLLFunc_Think,id)

        
engfunc(EngFunc_SetOrigin,id,Float:{-4800.0,-4800.0,-4800.0})

        
set_task(0.5,"spawnagain",id)
    }
}

public 
spawnagain(id)
{
    if(
is_user_connected(id))
    {
        
spawn(id)
        
dllfunc(DLLFunc_Spawn,id)
    }

Code:
Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Invalid expression, assumed zero on line 31
Warning: Expression has no effect on line 31
Warning: Expression has no effect on line 31
Warning: Expression has no effect on line 31
Error: Expected token: ";", but found ")" on line 31
Error: Invalid expression, assumed zero on line 31
Error: Too many error messages on one line on line 31

Compilation aborted.
4 Errors.
Could not locate output file C:\Users\Jacob\Desktop\ScoutKnifeZ_Manager.amx (compile failed).
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-07-2009 , 11:42   Re: Errors.. Compile... Menu!!
Reply With Quote #2

Menu is not created. You have to use menu_create() which return an identifier and you have to use it in menu_additem(). ( and not the function name cmdScoutKnifeZMenu like you have done )
Arkshine is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-07-2009 , 11:45   Re: Errors.. Compile... Menu!!
Reply With Quote #3

Your switch statement is also totally useless.

A switch should look something like

PHP Code:
switch( key )
{
    case 
1:
    {

    }
    case 
2:
    {

    }
    case 
3:
    {

    }
    case 
4:
    {

    }
    default:
    {

    }

__________________
Bugsy is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-07-2009 , 11:49   Re: Errors.. Compile... Menu!!
Reply With Quote #4

cmdScoutKnifeZMenu menu

PHP Code:
public cmdScoutKnifeZMenu(id) {
    new 
menu menu_create ("\rMenu for ScoutKnifeZ_Manager!:""1");
    
menu_additem(menu"\wGravity800""1"0);
   
// menu_additem(menu, "\wNormal", "1", 0);
    
menu_additem(menu"\wGravity600""2"1)
    
menu_additem(menu"\wGravity400""3"1)
    
menu_additem(menu"\wGravity200""4"1)
    
menu_additem(menu"\wGravity100""5"1)
    
menu_additem(menu"\wGiveSg550""6"1)
    
menu_additem(menu"\wGiveAWP""7"1)
    
menu_additem(menu"\wGiveG3sg1""8"1)
    
menu_display(idmenu0); 
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-07-2009 , 11:51   Re: Errors.. Compile... Menu!!
Reply With Quote #5

Quote:
Originally Posted by Bugsy View Post
Your switch statement is also totally useless.

A switch should look something like

PHP Code:
switch( key )
{
    case 
1:
    {

    }
    case 
2:
    {

    }
    case 
3:
    {

    }
    case 
4:
    {

    }
    default:
    {

    }

@Bugsy: But i only need 1 case?
@YamiKaitou: kk
@Arkshine: Thanks
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-07-2009 , 11:57   Re: Errors.. Compile... Menu!!
Reply With Quote #6

Should it be
PHP Code:
public cmdScoutKnifeZMenu(id) {
    new 
menu menu_create(id) ("\rMenu for ScoutKnifeZ_Manager!:""1")
    
menu_additem(id)(cmdScoutKnifeZMenu"\wGravity800""1"1)
    
menu_additem(id)(cmdScoutKnifeZMenu"\wGravity600""2"1)
    
menu_additem(id)(cmdScoutKnifeZMenu"\wGravity400""3"1)
    
menu_additem(id)(cmdScoutKnifeZMenu"\wGravity200""4"1)
    
menu_additem(id)(cmdScoutKnifeZMenu"\wGravity100""5"1)
    
menu_additem(id)(cmdScoutKnifeZMenu"\wGiveSg550""6"1)
    
menu_additem(id)(cmdScoutKnifeZMenu"\wGiveAWP""7"1)
    
menu_additem(id)(cmdScoutKnifeZMenu"\wGiveG3sg1""8"1)
    
menu_setprop(cmdScoutKnifeZMenuMPROP_EXIT)
    
menu_display(idcmdScoutKnifeZMenu1)
    if (
item == MENU_EXIT)
    {
        
menu_destroy(Menu)
        return 
PLUGIN_HANDLED
    
}
    new 
data[6], iName[64]
    new 
accesscallback
    
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)
    
    new 
key str_to_num(data)
    
    switch(
1)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANLED
        
}
    switch(
2)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
}
    switch(
3)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
}
    switch(
4)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
}
    switch(
5)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
}
    switch(
6)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
}
    switch(
7)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
}
    switch(
8)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
}
    switch(
9)
    {
        case 
1:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED

Then?
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-07-2009 , 12:06   Re: Errors.. Compile... Menu!!
Reply With Quote #7

No. You can't display a menu and handle the menu with the same function.

Also, as Yami and Bugsy said, your switch statement is way wrong.
__________________
fysiks is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-07-2009 , 11:42   Re: Errors.. Compile... Menu!!
Reply With Quote #8

cmdScoutKnifeZMenu is the name of the function, not a variable name. Your switch is incorrect as well.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou 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 02:18.


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