All Projects → ziggi → rustext

ziggi / rustext

Licence: MIT license
Fix Russian text plugin for SA-MP: GameText's, TextDraw's and Menu's

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
Pawn
127 projects
CMake
9771 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to rustext

protection
Flexible server protection system (development)
Stars: ✭ 23 (+53.33%)
Mutual labels:  gta, sa-mp, samp, sanandreas, gtasa
Open-GTO
RPG gamemode for SA-MP
Stars: ✭ 45 (+200%)
Mutual labels:  gta, sa-mp, samp, sanandreas, gtasa
GWRP-0.3
Игровой режим для San Andreas Multiplayer
Stars: ✭ 22 (+46.67%)
Mutual labels:  gta, sa-mp, samp, sanandreas, gtasa
samp-node-lib
NodeJS library for Scripting San Andreas Multiplayer:SAMP depends on samp-node plugin
Stars: ✭ 23 (+53.33%)
Mutual labels:  gta, sa-mp, samp, gtasa
gta-samp-mouse-only
Play GTA San Andreas Multiplayer with mouse only and no keyboard
Stars: ✭ 22 (+46.67%)
Mutual labels:  sa-mp, samp, gtasa
gtasa-savegame-editor
GUI tool to edit GTA San Andreas savegames.
Stars: ✭ 56 (+273.33%)
Mutual labels:  gta, sanandreas, gtasa
SS-Gang-System-SQLITE
SS Gang System for SA-MP
Stars: ✭ 23 (+53.33%)
Mutual labels:  sa-mp, samp
Pawn.CMD
🚀 Plugin-powered command processor for SA:MP server
Stars: ✭ 80 (+433.33%)
Mutual labels:  sa-mp, samp
samp-foreach
foreach standalone include (non y_iterate version)
Stars: ✭ 20 (+33.33%)
Mutual labels:  sa-mp, samp
eSelection
Dynamic model selection library for SA-MP servers
Stars: ✭ 28 (+86.67%)
Mutual labels:  sa-mp, samp
code-parse.inc
Pre-processor macros for analysing PAWN functions.
Stars: ✭ 23 (+53.33%)
Mutual labels:  sa-mp, samp
Pawn.Regex
🔎 Plugin that adds support for regular expressions in Pawn
Stars: ✭ 34 (+126.67%)
Mutual labels:  sa-mp, samp
samp-ptl
SA:MP Plugin Template Library (C++17)
Stars: ✭ 16 (+6.67%)
Mutual labels:  sa-mp, samp
samp-discord-plugin
SA:MP Discord Rich Presence plugin
Stars: ✭ 63 (+320%)
Mutual labels:  sa-mp, samp
VehFuncs
New vehicle features for GTA San Andreas mods
Stars: ✭ 30 (+100%)
Mutual labels:  gta, gtasa
PacPaw
Pawn package manager for SA-MP
Stars: ✭ 14 (-6.67%)
Mutual labels:  sa-mp, samp
trilogymp
Trilogy Multiplayer (TMP) is a work in progress nonprofit open source multiplayer software project for Grand Theft Auto: The Trilogy. This repository serves as a base for discussions and project management.
Stars: ✭ 105 (+600%)
Mutual labels:  gta, gtasa
amx assembly
Interesting #emit stuff
Stars: ✭ 49 (+226.67%)
Mutual labels:  sa-mp
flhooks
React like Hooks implementation for Flutter.
Stars: ✭ 38 (+153.33%)
Mutual labels:  hooks
git-toolkit
Git工具集
Stars: ✭ 35 (+133.33%)
Mutual labels:  hooks

rustext

Fix Russian text plugin for SA-MP: GameText's, TextDraw's and Menu's. Default russifier type is SanLtd.

Usage

Just add rustext[.so] in your server.cfg to plugins key. If you want to get additional functionality you should copy rustext.inc to your libraries directory and add #include "rustext" in your script.

Russifiers

You can download any of the usеd russifiers here.

Examples

Here you can see how it works with SanLtd russifier:

sanltd

Here you can see how it works with Ukraine localization:

ukraine

Example of usage

Base script for setting player russifier:

#include <a_samp>
#include <rustext>

static
	TextRusTD[RussifierType];

const
	Float:TEXT_BASE_X = 150.0,
	Float:TEXT_BASE_Y = 150.0,
	TEXT_RUSSIFIERS_COUNT = 7; // only Russian localizations

public OnGameModeInit()
{
	for (new i; i < TEXT_RUSSIFIERS_COUNT; i++) {
		TextRusTD[RussifierType:i] = _:TextDrawCreate(TEXT_BASE_X,
		                                              TEXT_BASE_Y + 15.0 * i,
		                                              "Я могу прочитать этот текст, это мой русификатор");
		TextDrawSetSelectable(Text:TextRusTD[RussifierType:i], 1);
		TextDrawTextSize(Text:TextRusTD[RussifierType:i], 600.0, 10.0);
	}
	return 1;
}

public OnPlayerSpawn(playerid)
{
	for (new i; i < TEXT_RUSSIFIERS_COUNT; i++) {
		SetPlayerRussifierType(playerid, RussifierType:i);
		TextDrawShowForPlayer(playerid, Text:TextRusTD[RussifierType:i]);
	}
	SelectTextDraw(playerid, 0xAA3333FF);
	return 1;
}

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
	for (new i; i < TEXT_RUSSIFIERS_COUNT; i++) {
		if (TextRusTD[RussifierType:i] == _:clickedid) {
			SetPlayerRussifierType(playerid, RussifierType:i);
			CancelSelectTextDraw(playerid);
		}
		TextDrawHideForPlayer(playerid, Text:TextRusTD[RussifierType:i]);
	}
	return 0;
}

Or you can use russifier library for this. russifier

Types

enum RussifierType {
	RussifierType_Disabled = -1,
	RussifierType_SanLtd = 0,
	RussifierType_OneC,
	RussifierType_Rush,
	RussifierType_Unknown1,
	RussifierType_Unknown2,
	RussifierType_Unknown3,
	RussifierType_MG,
	RussifierType_Community,
	RussifierType_Ukraininan,
	RussifierType_Hungarian,
}

Natives

native GetRussifierVersion(version[], const size = sizeof(version));
native GetRussifierText(RussifierType:type, string[], string_return[], const size = sizeof(string_return));

native SetPlayerRussifierType(playerid, RussifierType:type);
native RussifierType:GetPlayerRussifierType(playerid);

native SetDefaultRussifierType(RussifierType:type);
native RussifierType:GetDefaultRussifierType();

Build

git clone https://github.com/ziggi/rustext.git
mkdir build
cd build
cmake ..
make

Build (Visual Studio)

cd FCNPC
mkdir build
cd build
cmake .. -G "Visual Studio 12"

Thanks

Big thanks to urShadow for urmem and Pawn.RakNet on which based rakserver hook code.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].