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

Solved read messages from messagemode


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 02-05-2019 , 05:20   read messages from messagemode
Reply With Quote #1

PHP Code:
new authid[80],name[32]
            
get_user_authid(id,authid,charsmax(authid))
            
get_user_name(id,name,charsmax(name))
            new 
content[155]
            
client_cmd(id"messagemode MYTEXT");
            
format(content,charsmax(content),"^"ABC^" ^"%s^" ^"[%s]^" ^"%s^"",authidMYTEXTname)
            
write_file("addons/amxmodx/configs/myfiles.ini",content,-1
how im supposed to add my text from messagemode MYTEXT between "[%s]" on format content?
i tried from some examples but those weren't good
__________________
a simple act of caring creates an endless ripple.

Last edited by Nutu_; 02-05-2019 at 17:35.
Nutu_ is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 02-05-2019 , 05:30   Re: read messages from messagemode
Reply With Quote #2

are you sure you're extracting the text that goes into MYTEXT from messagemode corectly?

Quote:
Originally Posted by fysiks View Post
PHP Code:
#include <amxmodx>
public plugin_init()
{
    
register_clcmd("say /wordhere""cmdWord")
    
register_clcmd("_mm_wordhere""mmWord")
}

public 
cmdWord(id)
{
    
client_cmd(id"messagemode _mm_wordhere")
}

public 
mmWord(id)
{
    new 
szTemp[64]
    
read_args(szTempcharsmax(szTemp))
    
client_print(idprint_chat"You just said: %s"szTemp)


Last edited by DjSoftero; 02-05-2019 at 05:31.
DjSoftero is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 02-05-2019 , 07:28   Re: read messages from messagemode
Reply With Quote #3

messagemode is only to send a command to console via say hud, you need first to create a normal handle for an command, after do this, send to client like client_cmd(id,"messagemode amx_test");
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
eat1k
Senior Member
Join Date: Apr 2018
Old 02-05-2019 , 15:02   Re: read messages from messagemode
Reply With Quote #4

PHP Code:
new authid[80
lol??? See MAX_AUTHID_LENGTH and don't use write_file.
__________________
eat1k is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 02-05-2019 , 16:30   Re: read messages from messagemode
Reply With Quote #5

Quote:
Originally Posted by eat1k View Post
PHP Code:
new authid[80
lol??? See MAX_AUTHID_LENGTH and don't use write_file.
i copied everything from google without even checking that
all i want is after the player gets messagemode MYTEXT
everything he writes to be saved on addons/amxmodx/configs/myfiles.ini
as
"n" "steamid" "MYTEXT(what he writes on messagemode)" ;name
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 02-05-2019 , 18:09   Re: read messages from messagemode
Reply With Quote #6

Try with fvault. With some editionns you can set it to save in an .ini file at amxmodx/configs instead of amxmodx/data/file_vault if that matter to you.

https://forums.alliedmods.net/showthread.php?t=76453
__________________








CrazY. is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 02-05-2019 , 18:38   Re: read messages from messagemode
Reply With Quote #7

Quote:
Originally Posted by CrazY. View Post
Try with fvault. With some editionns you can set it to save in an .ini file at amxmodx/configs instead of amxmodx/data/file_vault if that matter to you.

https://forums.alliedmods.net/showthread.php?t=76453
someone was teaching me how to solve them, i understand now, thanks to everyone that helped
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 02-05-2019 , 20:16   Re: read messages from messagemode
Reply With Quote #8

It can be done using log_amx or someting else, you do not need to write a file itself, what is the purpose of that plugin?
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 02-06-2019 , 02:16   Re: read messages from messagemode
Reply With Quote #9

Quote:
Originally Posted by ^SmileY View Post
It can be done using log_amx or someting else, you do not need to write a file itself, what is the purpose of that plugin?
log will not do, as he's trying to save it for later usage
DjSoftero is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 02-06-2019 , 08:45   Re: read messages from messagemode
Reply With Quote #10

ok but, what is the purpose of that plugin?

it seems to be not hard to do
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
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:01.


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