SphereCommunity
LANG = RUS/ENG - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: LANG = RUS/ENG (/Thread-LANG-RUS-ENG)



LANG = RUS/ENG - Gavrik - 06-10-2014 01:54 AM

Hello!
Help me, please
I bad speak english and bad translation

I encountered a problem checking LANG=RUS/ENG, and redirected to dialogue.

Code:
[FUNCTION f_onchar_create]
if <src.account.lang> == RUS
src.sdialog d_party_ru
else <src.account.lang> == ENG
src.sdialog d_party_en
endif

21:29:ERROR:(sphere_serv_triggers.scp,66)Undefined symbol 'RUS'
21:29:ERROR:(sphere_serv_triggers.scp,66)Undefined symbol 'RUS'

0.56b


RE: LANG = RUS/ENG - Feeh - 06-10-2014 02:35 AM

[FUNCTION f_onchar_create]
if (!<STRCMPI("<src.account.lang>","RUS")>)
src.sdialog d_party_ru
elif (!<STRCMPI("<src.account.lang>","ENG")>) //elif is the same as else if
src.sdialog d_party_en
endif

STRCMP compare two strings, return 0 if equal
STRCMPI is the same as STRCMP but ignore case

Hope it helps


RE: LANG = RUS/ENG - Gavrik - 06-10-2014 04:28 AM

(06-10-2014 02:35 AM)Feeh Wrote:  [FUNCTION f_onchar_create]
if (!<STRCMPI("<src.account.lang>","RUS")>)
src.sdialog d_party_ru
elif (!<STRCMPI("<src.account.lang>","ENG")>) //elif is the same as else if
src.sdialog d_party_en
endif

STRCMP compare two strings, return 0 if equal
STRCMPI is the same as STRCMP but ignore case

Hope it helps

22:39:ERROR:(sphere_serv_triggers.scp,66)Can't resolve <STRCMPI("RUS","RUS")>
22:39:ERROR:(sphere_serv_triggers.scp,66)Undefined symbol ''


RE: LANG = RUS/ENG - Feeh - 06-10-2014 04:44 AM

Sorry, I always make confusion with STRCMPI

[FUNCTION f_onchar_create]
if (!STRCMPI("<src.account.lang>","RUS"))
src.sdialog d_party_ru
elif (!STRCMPI("<src.account.lang>","ENG")) //elif is the same as else if
src.sdialog d_party_en
endif


RE: LANG = RUS/ENG - Gavrik - 06-10-2014 05:54 AM

(06-10-2014 04:44 AM)Feeh Wrote:  Sorry, I always make confusion with STRCMPI

[FUNCTION f_onchar_create]
if (!STRCMPI("<src.account.lang>","RUS"))
src.sdialog d_party_ru
elif (!STRCMPI("<src.account.lang>","ENG")) //elif is the same as else if
src.sdialog d_party_en
endif

Thank you man!=)