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

LookupLangKey has an &id argument?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-14-2018 , 09:40   LookupLangKey has an &id argument?
Reply With Quote #1

PHP Code:
native LookupLangKey(Output[], OutputSize, const Key[], &id); 
I had to use this function for the first time and noticed that the id has an & in front. Why? This argument is supposed to be the player's id or LANG_SERVER, so why is the id saved in a variable? The function needs to be used like this because of it:

PHP Code:
new szFormat[32], id LANG_SERVER
LookupLangKey
(szFormatcharsmax(szFormat), "SOME_KEY"id
Instead of like this:

PHP Code:
new szFormat[32]
LookupLangKey(szFormatcharsmax(szFormat), "SOME_KEY"LANG_SERVER
There's no point of storing the id anywhere.
Am I missing something here?
__________________

Last edited by OciXCrom; 07-14-2018 at 09:40.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-14-2018 , 10:01   Re: LookupLangKey has an &id argument?
Reply With Quote #2

Yes think so as this code says

Code:
static cell AMX_NATIVE_CALL LookupLangKey(AMX *amx, cell *params)
{
	int len;
	char *key=get_amxstring(amx,params[3],0,len);
	const char *def=translate(amx, playerlang(*get_amxaddr(amx, params[4])),key);

	if (def==NULL)
	{
		return 0;
	}

	set_amxstring(amx,params[1],def,params[2]);
	return 1;
};
its getting param[4] & not setting.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted 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 01:52.


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