21.06.2010, 09:26
I want to keep my script easily customizable, so localization is a smart thing to add imo. Just wondering if it is possible to have a string definition that can have placeholders in it?
Something like this would be very useful for translating scripts into different languages or just changing the messages in general.
Код:
#define stringWelcome "Welcome to %s server, %s. Please enjoy your stay." #define serverName "The Fun Zone" ... OnPlayerConnect(playerid){ new string[128], playerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); format(string, stringWelcome, serverName, playerName); SendClientMessage(playerid, 0xFFFFFFFF, string); }