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

Script won't compile


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 03-15-2009 , 20:03   Script won't compile
Reply With Quote #1

Hello, i maded a scripts wich shows a menu like the old buy menu's style but due some reason i can't compile it, i dont get any errors the compiler just hangs also the online compiler here can't handle it.

I use the same scripts for some other ingame menu's wich works flawlesly, here the code which doesn't compile.

PHP Code:
include <amxmodx
#include <cstrike> 
#include <amxmisc>

#define KeysMenu5 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)

public plugin_init() {
    
register_plugin("Custom Menu's","1.0",""

    
register_clcmd"rules","ShowMenu5"0"open menu")
    
register_clcmd"say rules","ShowMenu5"0"open menu")
    
register_clcmd"say_team rules","ShowMenu5"0"open menu")

    
register_menucmd(register_menuid("Menu5"), KeysMenu5"PressedMenu5")


public 
ShowMenu5(id,level,cid) {
    if (!
cmd_access(id,level,cid,1))
    return 
PLUGIN_HANDLED
    show_menu
(idKeysMenu5"\yServer Rules^n^n\w1. No cheating^nNo hacking or using any other file wich give you an advatage on other players.^n^n2. Decent language^nNo respectless, offending/insulting, accusing, threatening, sicknesses, advertising,^nracism, nazism, rationally and non English/Dutch language.^n^n3. Decent nickname^nNo respectless, offending/insulting, accusing, threatening, sicknesses, advertising,^nracism, nazism, rationally and copying nicknames.^n^n4. No spam^nNo spamming with chat, radio and voicecom features.^n^n5. Decent gameplay^nNo intentional teamblocking, -attacking, -killing, not completing your mission.^nOur public servers are meant for the common players, extreme noobs/pro's might be^nremoved to guarantee a playable gameplay for the common player. ^n^n0. I agree         9. I disagree^n^n\yCopyright 2009 Dutchgamers.nl^nLast changed 15-3-2009", -1"Menu5")
    return 
PLUGIN_HANDLED
}

public 
PressedMenu5(idkey) {

    switch (
key) {
        case 
0client_cmd(id,"")
        case 
1client_cmd(id,"")
        case 
2client_cmd(id,"")
        case 
3client_cmd(id,"")
        case 
4client_cmd(id,"")
        case 
5client_cmd(id,"")
        case 
6client_cmd(id,"")
        case 
7client_cmd(id,"")
        case 
8client_cmd(id,"disconnect")
    }
    return 
PLUGIN_HANDLED

__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 03-15-2009 , 20:16   Re: Script won't compile
Reply With Quote #2

PHP Code:
#include <amxmodx> 
?

Others include are un nesesary.

PHP Code:
register_menuid("\yServer Rules"
__________________

Last edited by AntiBots; 03-15-2009 at 20:20.
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 03-15-2009 , 20:22   Re: Script won't compile
Reply With Quote #3

Look at this

https://forums.alliedmods.net/showthread.php?t=46364
__________________
alan_el_more is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 03-15-2009 , 21:25   Re: Script won't compile
Reply With Quote #4

Quote:
Originally Posted by AntiBots View Post
PHP Code:
#include <amxmodx> 
?

Others include are un nesesary.
Thanks for the tip althought #include <amxmisc> is required otherwise i get an error message related with cmd_acces.

Quote:
Originally Posted by AntiBots View Post
PHP Code:
register_menuid("\yServer Rules"
What do you mean wtih this? Do i have to add it?

The basic script works perfect only when i add the rules it won't compile anymore without any error messges, the compiler just crash. Is it because the rules are to long or to long lines? Without all the rule text the script compiles fine see the below script.

PHP Code:
#include <amxmodx> 
#include <amxmisc>

#define KeysMenu5 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)

public plugin_init() {
    
register_plugin("Custom Menu's","1.0",""

    
register_clcmd"rules","ShowMenu5"0"open menu")
    
register_clcmd"say rules","ShowMenu5"0"open menu")
    
register_clcmd"say_team rules","ShowMenu5"0"open menu")

    
register_menucmd(register_menuid("Menu5"), KeysMenu5"PressedMenu5")


public 
ShowMenu5(id,level,cid) {
    if (!
cmd_access(id,level,cid,1))
    return 
PLUGIN_HANDLED
    show_menu
(idKeysMenu5"\yServer Rules^n^nw1. ^n2. ^n3. ^n4. ^n5. ^n6. ^n7. ^n8. ^n9. ^n^n0. ", -1"Menu5")
    return 
PLUGIN_HANDLED
}

public 
PressedMenu5(idkey) {

    switch (
key) {
        case 
0client_cmd(id,"")
        case 
1client_cmd(id,"")
        case 
2client_cmd(id,"")
        case 
3client_cmd(id,"")
        case 
4client_cmd(id,"")
        case 
5client_cmd(id,"")
        case 
6client_cmd(id,"")
        case 
7client_cmd(id,"")
        case 
8client_cmd(id,"disconnect")
    }
    return 
PLUGIN_HANDLED

__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 03-15-2009 , 21:28   Re: Script won't compile
Reply With Quote #5

You dont need this. because access is 0

PHP Code:
    if (!cmd_access(id,level,cid,1))
    return 
PLUGIN_HANDLED 
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-16-2009 , 06:01   Re: Script won't compile
Reply With Quote #6

It doesn't compile because your line is toooooo long and the compiler doesn't like that. Just cut it using by example severals #define then formating all #define into one string. But even with that there are too much text. You should reduce.

Last edited by Arkshine; 03-16-2009 at 06:04.
Arkshine is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 03-16-2009 , 21:13   Re: Script won't compile
Reply With Quote #7

Quote:
Originally Posted by AntiBots View Post
You dont need this. because access is 0

PHP Code:
    if (!cmd_access(id,level,cid,1))
    return 
PLUGIN_HANDLED 
Thats indeed correct, the reason why i added it is because i use the same scripts for some other ingame menu's only then are only admins allowed to open them. For the public menu's i will remove it because it is useless.

Quote:
Originally Posted by arkshine View Post
It doesn't compile because your line is toooooo long and the compiler doesn't like that. Just cut it using by example severals #define then formating all #define into one string. But even with that there are too much text. You should reduce.
Thanks telling me wats was wrong. I noticed some other plugins wich have MultiLanguage can have some long messages. When i add ML to this plugin can i write the actualy rules in the .txt file and get it to work afterall?
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-17-2009 , 04:43   Re: Script won't compile
Reply With Quote #8

It should work.
Arkshine is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 03-17-2009 , 21:30   Re: Script won't compile
Reply With Quote #9

I tried to add ML but it is harder as i thought, meaybe someone can help me a bit. I think i only need to add this id, "MESSAGE" somewhere in the line between the // signs and create a costom_menu.txt file in the lang folder with this text:
[en]
MESSAGE = rules

I tried some places to add id, "MESSAGE" but i get compile errors wich means i'm doing it wrong.

PHP Code:
#include <amxmodx> 
#include <amxmisc>

#define KeysMenu5 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)

public plugin_init() {
    
register_plugin("Custom Menu's","1.0",""
    
register_dictionary("custom_menu.txt")

    
register_clcmd"rules","ShowMenu5"0"open menu")
    
register_clcmd"say rules","ShowMenu5"0"open menu")
    
register_clcmd"say_team rules","ShowMenu5"0"open menu")

    
register_menucmd(register_menuid("Menu5"), KeysMenu5"PressedMenu5")


public 
ShowMenu5(id,level,cid) {
    if (!
cmd_access(id,level,cid,1))
    return 
PLUGIN_HANDLED
//  show_menu(id, KeysMenu5, "the menu text", -1, "Menu5")
//
    
show_menu(idKeysMenu5"%L", -1"Menu5")
//
    
return PLUGIN_HANDLED
}

public 
PressedMenu5(idkey) {

    switch (
key) {
        case 
0client_cmd(id,"")
        case 
1client_cmd(id,"")
        case 
2client_cmd(id,"")
        case 
3client_cmd(id,"")
        case 
4client_cmd(id,"")
        case 
5client_cmd(id,"")
        case 
6client_cmd(id,"")
        case 
7client_cmd(id,"")
        case 
8client_cmd(id,"disconnect")
    }
    return 
PLUGIN_HANDLED

__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.

Last edited by Maurice; 03-17-2009 at 21:35.
Maurice is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-17-2009 , 21:38   Re: Script won't compile
Reply With Quote #10

PHP Code:
    new menu[128];
    
formatex(menusizeof(menu) - 1"%L"id"MESSAGE");
    
show_menu(idKeysMenu5menu, -1"Menu5"
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 19:30.


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