Jass Vault WC3Jass.com
"The Jass Vault"
 
 FAQ   Search   Memberlist   Usergroups   Register 
 Profile   Log in to check your private messages   Log in  
 Forum   Scripts   Files   Chat   Pastebin   Function finder  
Affiliates
The HIVE Workshop Games Modding
The Hubb Wc3Campaigns
WC3-Mapping.net

GetLanguage

 
Post new topic   Reply to topic    Jass Vault -> Interface
View previous script :: View next script  

Script code
function GetLanguage takes nothing returns string
	local string Name = GetObjectName('hfoo')
	if Name=="Soldat" then
		return "German"
	endif
	if Name=="Footman" then
		return "English"
	endif
	// Do NOT use elseif, because that may cause desyncs
	// Add other languages with other unit names here
	return "Other"
endfunction
Script info
Description
This function returns the game language of the local player.
The result may be different for different players, it is asynchronous.

An asynchronous variable is no problem, a long as you do not create any handles (including strings) for one player only or change values affecting the game (like a unit's hp).

For those, who know how to use asynchronous values, it is useful for multiboards or notifications.

Display posts from previous:   
Post new topic   Reply to topic    Jass Vault -> Interface All times are GMT
Page 1 of 1

 
Jump to:  
You can submit new scripts in this section
You can comment on scripts in this section
You cannot edit your scripts in this section
You cannot delete your scripts in this forum



FSDark by SkaidonDesigns
Powered by phpBB © 2001, 2002 phpBB Group