This lib will add your specifier into str_format
without doing anything unnecessary.
Download the .inc, and place it into pawno/include
or qawno/include
.
Use the include by including this:
#include <pp-formatter>
in your gamemode files.
The Syntax:
FormatSpecifier<specifier>(name, input)
{
return output;
}
Examples:
#include <pp-formatter>
FormatSpecifier<'p'>("PlayerName", input)
{
if (!IsPlayerConnected(input)) return STR_NULL;
new name[MAX_PLAYER_NAME + 1];
GetPlayerName(input, name, sizeof(name));
return str_new(name);
}
public OnPlayerConnect(playerid)
{
print_s(str_format("Hello %p", playerid));
}
- IS4Code for PawnPlus