Few examples with explanation:
Create a button:
openPrivButton( "lang_en",30,30,4,4,5,-1,32, "^3EN" ,SetLanguage);
When the player click on the button it calls a sub named 'SetLanguage'.
<?php
Sub SetLanguage( $KeyFlags,$ButtonID )
#Cut the first 5 chars of the buttonID , result = 'en'
$language = trim( subStr( $ButtonID,5 ) );
#When the value/string of $language is equal to 'en'
IF($language == "en")THEN
SetCurrentPlayerVar("IdLang","en"); #Set player language to English
ENDIF
EndSub
?>
Create a button for the LFSLapperlanguage_engine
openPrivButton( "example",75,111,50,10,5,-1,ISB_DARK, langEngine("%{example}%"));
To define "example" in english.
Lang "EN"
example = "This text is an exampletext";
EndLang