AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error copiler (https://forums.alliedmods.net/showthread.php?t=313983)

Dragos 01-30-2019 10:36

Error copiler
 
hi i need help to these idk what i do wrong =]

PHP Code:

// Generated with v3x's AMXX Menu Generator

#include <amxmodx>

public plugin_init()
{
    
register_plugin("My Menu""1.0""Me");
    
register_clcmd("say /menu""ShowMenu"_"Brings up menu");
}

public 
ShowMenu(id)
{
    new 
menu menu_create("Menu Weapons""Menu Weapons");

    
menu_additem(menu"AWP"""0); // case 0
    
menu_additem(menu"AK47"""0); // case 1
    
menu_additem(menu"DEAGLE"""0); // case 2
    
menu_additem(menu""""0); // case 3

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_setprop(menuMPROP_BACKNAME"INAPOI");
    
menu_setprop(menuMPROP_NEXTNAME"INAINTE");
    
menu_setprop(menuMPROP_EXITNAME"AFARA");

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED;
}

public 
Menu Weapons(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);

    switch(
item)
    {
        case 
0client_print(idprint_chat"You have selected AWP");
        case 
1client_print(idprint_chat"You have selected AK47");
        case 
2client_print(idprint_chat"You have selected DEAGLE");
        case 
3client_print(idprint_chat"You have selected ");
    }

    
menu_destroy(menu);

    return 
PLUGIN_HANDLED;



Vaggelis 01-30-2019 11:25

Re: Error copiler
 
Here you are:
PHP Code:

// Generated with v3x's AMXX Menu Generator 

#include <amxmodx> 

public plugin_init() 

    
register_plugin("My Menu""1.0""Me"); 
    
register_clcmd("say /menu""ShowMenu"_"Brings up menu"); 


public 
ShowMenu(id

    new 
menu menu_create("Menu Weapons""MenuWeaponsHandler"); 

    
menu_additem(menu"AWP"""0); // case 0 
    
menu_additem(menu"AK47"""0); // case 1 
    
menu_additem(menu"DEAGLE"""0); // case 2 
    
menu_additem(menu""""0); // case 3 

    
menu_setprop(menuMPROP_EXITMEXIT_ALL); 
    
menu_setprop(menuMPROP_BACKNAME"INAPOI"); 
    
menu_setprop(menuMPROP_NEXTNAME"INAINTE"); 
    
menu_setprop(menuMPROP_EXITNAME"AFARA"); 

    
menu_display(idmenu0); 

    return 
PLUGIN_HANDLED


public 
MenuWeaponsHandler(idmenuitem

    if(
item == MENU_EXIT
    { 
        
menu_cancel(id); 
        return 
PLUGIN_HANDLED
    } 

    new 
command[6], name[64], accesscallback

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback); 

    switch(
item
    { 
        case 
0client_print(idprint_chat"You have selected AWP"); 
        case 
1client_print(idprint_chat"You have selected AK47"); 
        case 
2client_print(idprint_chat"You have selected DEAGLE"); 
        case 
3client_print(idprint_chat"You have selected "); 
    } 

    
menu_destroy(menu); 

    return 
PLUGIN_HANDLED



DarkDeviL 01-30-2019 11:29

Re: Error copiler
 
Quote:

Originally Posted by Dragos (Post 2637264)
hi i need help to these idk what i do wrong =]

PHP Code:

// Generated with v3x's AMXX Menu Generator 


In that case, please consider helping yourself to get helped by posting in the right place.

I have moved your thread from SourceMod to AMX sections.

OciXCrom 01-30-2019 14:32

Re: Error copiler
 
If there is an error, why didn't you post it?

Nutu_ 01-30-2019 15:17

Re: Error copiler
 
you're headler isn't finished, if you chose 1 it wont give you AWP, only the print chat
you must do smth like
PHP Code:

case 0: {
    
give_item(id,"weapon_awp");
    
cs_set_user_bpammo(idCSW_AWP,30);
    
client_print(idprint_chat"You have selected AWP");  


then it will work, also you must strip weapons before, giving items


All times are GMT -4. The time now is 07:33.

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