AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved read messages from messagemode (https://forums.alliedmods.net/showthread.php?t=314139)

Nutu_ 02-05-2019 05:20

read messages from messagemode
 
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

DjSoftero 02-05-2019 05:30

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

Quote:

Originally Posted by fysiks (Post 1256579)
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)




^SmileY 02-05-2019 07:28

Re: read messages from messagemode
 
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");

eat1k 02-05-2019 15:02

Re: read messages from messagemode
 
PHP Code:

new authid[80

lol??? See MAX_AUTHID_LENGTH and don't use write_file.

Nutu_ 02-05-2019 16:30

Re: read messages from messagemode
 
Quote:

Originally Posted by eat1k (Post 2638321)
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

CrazY. 02-05-2019 18:09

Re: read messages from messagemode
 
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

Nutu_ 02-05-2019 18:38

Re: read messages from messagemode
 
Quote:

Originally Posted by CrazY. (Post 2638342)
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

^SmileY 02-05-2019 20:16

Re: read messages from messagemode
 
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?

DjSoftero 02-06-2019 02:16

Re: read messages from messagemode
 
Quote:

Originally Posted by ^SmileY (Post 2638352)
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

^SmileY 02-06-2019 08:45

Re: read messages from messagemode
 
ok but, what is the purpose of that plugin?

it seems to be not hard to do


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

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