format
#1

Столкнулся с такой проблемой что...

Есть конструкция кода:

PHP код:
SendServerMessage(playerid"%s"Get_Language_Text(LANG_WELCOME), Get_Player_Name(playerid)); 
Get_Language_Text(LANG_WELCOME) содержит в себе "%s, добро пожаловать на SERVERNAME!".
Get_Player_Name(playerid) - Ник игрока.

И выводиться конечно же только ", добро пожаловать на SERVERNAME!", вот меня и интересует как можно сделать так, чтобы формат работал как я хотел.

Да можно сделать и вот так:
PHP код:
SendServerMessage(playerid"%s%s"Get_Player_Name(playerid), Get_Language_Text(LANG_WELCOME)); 
Ну, а если у меня формат в середине предложения?

Конструкция Get_Language_Text
PHP код:
enum {
    
LANG_WELCOME
};
new 
gLanguageData[][] = {
    
"%s, добро пожаловать на SERVERNAME!"
};
Get_Language_Text(textid)
{
    new 
        
string[256];
    
    
format(stringsizeof(string), gLanguageData[textid]);
    
    return 
string;

Reply


Messages In This Thread
format - by themakar - 31.03.2016, 11:40
Re: format - by Stepashka - 31.03.2016, 12:04
Re: format - by themakar - 31.03.2016, 12:54
Re: format - by Stepashka - 31.03.2016, 13:34
Re: format - by themakar - 31.03.2016, 13:43
Re: format - by Stepashka - 31.03.2016, 14:05
Re: format - by OKStyle - 31.03.2016, 15:50
Re: format - by themakar - 31.03.2016, 18:48
Re: format - by OKStyle - 01.04.2016, 03:53
Re: format - by themakar - 01.04.2016, 11:28

Forum Jump:


Users browsing this thread: 1 Guest(s)