05.12.2016, 14:37
I would look into the va_format function developed by ZeeX and ******.
It's a complex but simple method to approach formatting arguments into a string.
http://pastebin.com/R3ZeiK7L
Example usage:
It's a complex but simple method to approach formatting arguments into a string.
http://pastebin.com/R3ZeiK7L
Example usage:
PHP код:
SendFormattedMessage(playerid, colour, const formatstr[], va_args<>)
{
new format_output[145];
va_format(format_output, sizeof(format_output), formatstr, va_start<3>);
return SendClientMessage(playerid, colour, format_output);
}
public OnPlayerSpawn(playerid)
{
SendFormattedMessage(playerid, -1, "Your skin ID is %d, you are on team %d and your score is %d.", GetPlayerSkin(playerid), GetPlayerTeam(playerid), GetPlayerScore(playerid));
return 1;
}