Developers' API
Code:
/**
* Converts a string that contains words in RTL languages to be displayed correctly in-game.
*
* @param dest Destination string buffer to copy the RTL-ed string to.
* @param destLen Destination buffer length (includes null terminator).
* @param original Original non-rtled string.
*
* @return The amount of words that needed RTLifying.
*/
native RTLify(String:dest[], destLen, const String:original[]);
Example plugin:
Code:
#pragma semicolon 1
#include <sourcemod>
#include <rtler>
public OnPluginStart()
{
AddCommandListener(OnRTLifyCommand, "rtlify");
}
public Action:OnRTLifyCommand(client, const String:command[], argc)
{
new String:arg[192];
GetCmdArgString(arg, sizeof(arg));
new len = strlen(arg);
decl String:dest[len];
RTLify(dest, len, arg);
PrintToChat(client, dest);
return Plugin_Handled;
}