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

small problem with plugin ML


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Adomaz1
Senior Member
Join Date: Feb 2014
Old 08-18-2016 , 09:18   small problem with plugin ML
Reply With Quote #1

hello, edited this plugin so that it'd be ML, but it always uses default server language, although I use "id" in every message. I also tried to change id to LANG_PLAYER, but it's the same. :/

Code:
#include <amxmodx>

new maxplayers;
new gmsgSayText;

public plugin_init() {
	register_plugin("Admin Check", "1.51", "OneEyed")
	maxplayers = get_maxplayers()
	gmsgSayText = get_user_msgid("SayText")
	register_clcmd("say", "handle_say")
	register_dictionary("admincheck.txt")
}

public handle_say(id) {
	new said[192]
	read_args(said,192)
	if( ( containi(said, "/admins") != -1 ))
		set_task(0.1,"print_adminlist",id)
	return PLUGIN_CONTINUE
}

public print_adminlist(user) 
{
	new adminnames[33][32]
	new message[256]
	new id, count, x, len
	
	for(id = 1 ; id <= maxplayers ; id++)
		if(is_user_connected(id))
			if(get_user_flags(id) & ADMIN_KICK)
				get_user_name(id, adminnames[count++], 31)

	len = formatex(message, 255, "%L", id, "ONLINE_ADMINS", adminnames)
	if(count > 0) {
		for(x = 0 ; x < count ; x++) {
			len += formatex(message[len], 255-len, "%s^1, ", adminnames[x], x < (count-1) ? ", ":"")
			if(len > 96 ) {
				print_message(id, message)
				format(message, 255, "%L", id, "ONLINE_ADMINS", adminnames)
			}
		}
		print_message(user, message)
	}
	else {
		format(message, 255, "%L", id, "NOADMINS")
		print_message(user, message)
	}
}

print_message(id, msg[]) {
	message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
	write_byte(id)
	write_string(msg)
	message_end()
}
Adomaz1 is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 08-18-2016 , 10:15   Re: small problem with plugin ML
Reply With Quote #2

Does this happen with other plugins?
__________________
gabuch2 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 08-18-2016 , 10:45   Re: small problem with plugin ML
Reply With Quote #3

Try LANG_SERVER
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Adomaz1
Senior Member
Join Date: Feb 2014
Old 08-19-2016 , 05:55   Re: small problem with plugin ML
Reply With Quote #4

Quote:
Originally Posted by Shattered Heart Lynx View Post
Does this happen with other plugins?
no, it's only with this plugin.

I tried id, LANG_PLAYER, LANG_SERVER, but nothing helped. :/

Last edited by Adomaz1; 08-19-2016 at 05:55.
Adomaz1 is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 08-20-2016 , 14:19   Re: small problem with plugin ML
Reply With Quote #5

Show us the lang file.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 08-20-2016 , 15:56   Re: small problem with plugin ML
Reply With Quote #6

Quote:
Originally Posted by Adomaz1 View Post
hello, edited this plugin so that it'd be ML, but it always uses default server language, although I use "id" in every message. I also tried to change id to LANG_PLAYER, but it's the same. :/
Yeah because LANG_PLAYER (or id) uses client language from setinfo. So if you language is the same as server's one then it will show the same message.

You'll need to change your setinfo
Write in console

setinfo lang en
or
setinfo lang de

and so on...
siriusmd99 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-20-2016 , 16:03   Re: small problem with plugin ML
Reply With Quote #7

Your code looks wrong. If you want to use formatex() with %L and id, you should use it inside the loop. Then once formatted for all the concerned players, you show the message to "user".
__________________
Arkshine is offline
Adomaz1
Senior Member
Join Date: Feb 2014
Old 08-21-2016 , 06:53   Re: small problem with plugin ML
Reply With Quote #8

Quote:
Originally Posted by Arkshine View Post
Your code looks wrong. If you want to use formatex() with %L and id, you should use it inside the loop. Then once formatted for all the concerned players, you show the message to "user".
Thank you. I don't know if this is right, but changing id to user was the answer.
Adomaz1 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 15:39.


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