Raised This Month: $32 Target: $400
 8% 

Solved messagemode in menu doesn't work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Akka3223
Member
Join Date: Oct 2016
Old 08-18-2019 , 16:00   messagemode in menu doesn't work
Reply With Quote #1

Hello there,


somehow i don't understand why doesn't this work, could someone help me with this?
in console i can't see anything from ''public mmXp(id) ''


this is what i use in a menu
Quote:
client_cmd(id ,"messagemode cmdaddxp")
server_print("Bugs bugs bugs its raining bugs#2")


this is my messagemode functions
Quote:
}
public set_messagemode_cmds()
{
register_clcmd("say /setgoldcmd", "cmdaddxp")
register_clcmd("mmXpMain", "mmXp")
}
public cmdaddxp(id)
{
client_cmd(id, "messagemode mmXpMain")
}
public mmXp(id)
{
server_print("Bugs check#3")
new szTemp[64]
read_args(szTemp, charsmax(szTemp))
remove_quotes(szTemp);
new gold_amount = str_to_num(szTemp);
g_PlayerXp[SelectedPlayerIDD[id]][g_CurrentChar[SelectedPlayerIDD[id]]] += gold_amount;
client_print(SelectedPlayerIDD[id], print_chat, "Your XP has been increased by %d!",
gold_amount);
}

Last edited by Akka3223; 08-20-2019 at 11:09.
Akka3223 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-18-2019 , 16:09   Re: messagemode in menu doesn't work
Reply With Quote #2

The two parts of code that you posted don't appear to go together. It does not look like there is any client command registered called "cmdaddxp".

It would be easiest if you attach your entire plugin. If you don't want to do that, create a test plugin with just the functionality that you are struggling with that reproduces the issue.
__________________
fysiks is offline
Akka3223
Member
Join Date: Oct 2016
Old 08-18-2019 , 16:19   Re: messagemode in menu doesn't work
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
The two parts of code that you posted don't appear to go together. It does not look like there is any client command registered called "cmdaddxp".

It would be easiest if you attach your entire plugin. If you don't want to do that, create a test plugin with just the functionality that you are struggling with that reproduces the issue.
okay ill attach its not a plugin its a d2lod addon or something not sure how its calld


EDIT*
i changed it from inl to ini because i couldn't attach

Last edited by Akka3223; 08-18-2019 at 16:20.
Akka3223 is offline
Akka3223
Member
Join Date: Oct 2016
Old 08-18-2019 , 16:29   Re: messagemode in menu doesn't work
Reply With Quote #4

and btw i mean its an admin menu,while i try to make a selection to add xp with selected value.

i tryed using that too
client_cmd(id ,"messagemode mmXp")
it doesn't shows anything or gives anything from public mmXp(id)
Akka3223 is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 08-18-2019 , 17:33   Re: messagemode in menu doesn't work
Reply With Quote #5

messagemode mmxp cant be called but messagemode mmxpmain will
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
Akka3223
Member
Join Date: Oct 2016
Old 08-18-2019 , 18:25   Re: messagemode in menu doesn't work
Reply With Quote #6

Quote:
Originally Posted by JocAnis View Post
messagemode mmxp cant be called but messagemode mmxpmain will
i tryed already it doesn't give me xp

its opens a messagemode when i type in something it doesnt give me xp thats what i try to fix.

Last edited by Akka3223; 08-18-2019 at 18:28.
Akka3223 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-18-2019 , 19:19   Re: messagemode in menu doesn't work
Reply With Quote #7

You'll have to debug it. Is the function actually being called? What is the contents of the szTemp string in mmXp()?
__________________
fysiks is offline
Akka3223
Member
Join Date: Oct 2016
Old 08-19-2019 , 08:41   Re: messagemode in menu doesn't work
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
You'll have to debug it. Is the function actually being called? What is the contents of the szTemp string in mmXp()?
exactly i tryed to debug it doesn't show me anything.

i don't know how to explain it,
PHP Code:
            client_cmd(id ,"messagemode mmXpMain"
            
server_print("Bugs bugs bugs its raining bugs#2"
This thing opens an messagemode for me but when i type an amount there how much xp i want its just doesn't use the fuction at all somewhy

PHP Code:
public mmXp(id

    
server_print("Bugs bugs bugs its raining bugs#3")
    new 
szTemp[64
    
read_args(szTempcharsmax(szTemp))
    
remove_quotes(szTemp);    
    new 
gold_amount str_to_num(szTemp);
    
server_print("Bugs bugs bugs its raining bugs#4")
    
g_PlayerXp[SelectedPlayerIDD[id]][g_CurrentChar[SelectedPlayerIDD[id]]] += gold_amount;
    
client_print(SelectedPlayerIDD[id], print_chat"Your XP has been increased by %d!"gold_amount);

Akka3223 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-19-2019 , 23:25   Re: messagemode in menu doesn't work
Reply With Quote #9

This is why I also said that you should create a test plugin to make sure that you understand the logic required to implement the feature you are trying to implement in your plugin. I do this all the time. Create a simple plugin that does just that one feature to make sure that I know that what I'm doing it working in it's simplest form. See here:

Code:
#include <amxmodx>

public plugin_init()
{
	register_clcmd("say test", "cmdSayTest")
	register_clcmd("_testmm", "cmdTestMM")
}


public cmdSayTest(id)
{
	client_print(id, print_chat, "say test happened")
	client_cmd(id, "messagemode _testmm")
}

public cmdTestMM(id)
{
	new szString[32]
	read_args(szString, charsmax(szString))
	
	client_print(id, print_chat, "TestMM String:  %s", szString)
}
they "test" in chat and you should get the messagemode command and then type something. When you hit enter, it will display that text in chat. This shows that it's working. Then, you can compare that to what you're doing in your plugin.
__________________
fysiks is offline
Akka3223
Member
Join Date: Oct 2016
Old 08-20-2019 , 09:19   Re: messagemode in menu doesn't work
Reply With Quote #10

Quote:
Originally Posted by fysiks View Post
This is why I also said that you should create a test plugin to make sure that you understand the logic required to implement the feature you are trying to implement in your plugin. I do this all the time. Create a simple plugin that does just that one feature to make sure that I know that what I'm doing it working in it's simplest form. See here:

Code:
#include <amxmodx>

public plugin_init()
{
	register_clcmd("say test", "cmdSayTest")
	register_clcmd("_testmm", "cmdTestMM")
}


public cmdSayTest(id)
{
	client_print(id, print_chat, "say test happened")
	client_cmd(id, "messagemode _testmm")
}

public cmdTestMM(id)
{
	new szString[32]
	read_args(szString, charsmax(szString))
	
	client_print(id, print_chat, "TestMM String:  %s", szString)
}
they "test" in chat and you should get the messagemode command and then type something. When you hit enter, it will display that text in chat. This shows that it's working. Then, you can compare that to what you're doing in your plugin.
ok so, i tryed making different plugin for messagemode and that one worked when i tryed to implement it to the diablo2lod mod it doesn't work again mhm

*EDIT*
thanks i fixed it.

Last edited by Akka3223; 08-20-2019 at 10:01.
Akka3223 is offline
Reply


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 19:12.


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