Skip to content

Add specifier to `str_format` easy with pp-formatter

License

Notifications You must be signed in to change notification settings

tsssu/pp-formatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Pawn Plus Formatter

This lib will add your specifier into str_format without doing anything unnecessary.

Installation

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.

Usage

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));
}

Credits

  • IS4Code for PawnPlus

About

Add specifier to `str_format` easy with pp-formatter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages