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

LANG string with variable


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 01-04-2015 , 22:12   LANG string with variable
Reply With Quote #1

Hello. Right now I have this dumb code:
PHP Code:
    switch(i_state)
    {
        case 
0:
        {
            
client_print(idprint_chat"%s%L"PREFIXLANG_SERVER"S_0")
        }
        case 
1:
        {
            
client_print(idprint_chat"%s%L"PREFIXLANG_SERVER"S_1")
        }
        case 
2:
        {
            
client_print(idprint_chat"%s%L"PREFIXLANG_SERVER"S_2")
        }
        case 
3:
        {
            
client_print(idprint_chat"%s%L"PREFIXLANG_SERVER"S_3")
        }
        case 
4:
        {
            
client_print(idprint_chat"%s%L"PREFIXLANG_SERVER"S_4")
        }
        case 
5:
        {
            
client_print(idprint_chat"%s%L"PREFIXLANG_SERVER"S_5")
        }
    } 
How I can simplify it? I try:
PHP Code:
    new state_str[32]
    
num_to_str(i_statestate_strcharsmax(state_str))
    
client_print(idprint_chat"%s%L"PREFIXLANG_SERVER"S_%s"state_str
But I got:

(ofcousre "S_0" exist in language file of plugin)

Last edited by Phant; 01-04-2015 at 22:13.
Phant is offline
Send a message via ICQ to Phant
 



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 22:27.


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