Доступ к готовым решениям

Переход в группу "Пользователь"

300.00 ₽
Одноразовый платёж
Быстрый переход в группу "Пользователи", без надобности написания постов и ожидания.

Покупка дает возможность:
Быть полноправным участником форума
Нормальное копирование кода
Создавать темы
Скачивать файлы
Доступ к архиву Pawno-Info

Мануал Русифицированная система званий для ДМ (дисс на Alex Westbrook'a)

Статус
В этой теме нельзя размещать новые ответы.

#chopper

Новичок
Приветствую всех пользователей данного портала. В этом мануале, если его можно так назвать, я покажу как с нуля (то бишь, сразу в new.pwn) занести систему рангов по килам.

Начнем. Внешний вид.

В начало мода.

PHP:
enum chopperData {
	player_Kills,
	player_Death
};
new MyStat[MAX_PLAYERS][chopperData];

new Text:OtherTD[5][MAX_PLAYERS];
new Text:StatsTD[3][MAX_PLAYERS];
В public OnPlayerConnect(playerid)
PHP:
OtherTD[0][playerid] = TextDrawCreate(492.000000, 100.000000, "New Textdraw"); // Задний фон
	TextDrawBackgroundColor(OtherTD[0][playerid], 252645220);
	TextDrawFont(OtherTD[0][playerid], 5);
	TextDrawLetterSize(OtherTD[0][playerid], 0.500000, 1.000000);
	TextDrawColor(OtherTD[0][playerid], -1);
	TextDrawSetOutline(OtherTD[0][playerid], 1);
	TextDrawSetProportional(OtherTD[0][playerid], 1);
	TextDrawUseBox(OtherTD[0][playerid], 1);
	TextDrawBoxColor(OtherTD[0][playerid], 255);
	TextDrawTextSize(OtherTD[0][playerid], 140.000000, 110.000000);
	TextDrawSetPreviewModel(OtherTD[0][playerid], 19299);
	TextDrawSetPreviewRot(OtherTD[0][playerid], -16.000000, 0.000000, -55.000000, 1.000000);
	TextDrawSetSelectable(OtherTD[0][playerid], 0);

	OtherTD[1][playerid] = TextDrawCreate(530.000000, 100.000000, "џBAм…E"); // Звание
	TextDrawBackgroundColor(OtherTD[1][playerid], 255);
	TextDrawFont(OtherTD[1][playerid], 2);
	TextDrawLetterSize(OtherTD[1][playerid], 0.390000, 2.000000);
	TextDrawColor(OtherTD[1][playerid], -1);
	TextDrawSetOutline(OtherTD[1][playerid], 0);
	TextDrawSetProportional(OtherTD[1][playerid], 1);
	TextDrawSetShadow(OtherTD[1][playerid], 1);
	TextDrawSetSelectable(OtherTD[1][playerid], 0);

	OtherTD[3][playerid] = TextDrawCreate(525.000000, 138.000000, "YЂ…†CЏB"); // Убийств
	TextDrawBackgroundColor(OtherTD[3][playerid], 255);
	TextDrawFont(OtherTD[3][playerid], 2);
	TextDrawLetterSize(OtherTD[3][playerid], 0.390000, 2.000000);
	TextDrawColor(OtherTD[3][playerid], -1);
	TextDrawSetOutline(OtherTD[3][playerid], 0);
	TextDrawSetProportional(OtherTD[3][playerid], 1);
	TextDrawSetShadow(OtherTD[3][playerid], 1);
	TextDrawSetSelectable(OtherTD[3][playerid], 0);

	OtherTD[4][playerid] = TextDrawCreate(524.000000, 172.000000, "C–EPЏE†"); // Смертей
	TextDrawBackgroundColor(OtherTD[4][playerid], 255);
	TextDrawFont(OtherTD[4][playerid], 2);
	TextDrawLetterSize(OtherTD[4][playerid], 0.390000, 2.000000);
	TextDrawColor(OtherTD[4][playerid], -1);
	TextDrawSetOutline(OtherTD[4][playerid], 0);
	TextDrawSetProportional(OtherTD[4][playerid], 1);
	TextDrawSetShadow(OtherTD[4][playerid], 1);
	TextDrawSetSelectable(OtherTD[4][playerid], 0);

	StatsTD[0][playerid] = TextDrawCreate(510.000000, 117.000000, "zName"); // Само звание
	TextDrawBackgroundColor(StatsTD[0][playerid], 255);
	TextDrawFont(StatsTD[0][playerid], 2);
	TextDrawLetterSize(StatsTD[0][playerid], 0.390000, 2.000000);
	TextDrawColor(StatsTD[0][playerid], 1788399035);
	TextDrawSetOutline(StatsTD[0][playerid], 0);
	TextDrawSetProportional(StatsTD[0][playerid], 1);
	TextDrawSetShadow(StatsTD[0][playerid], 1);
	TextDrawSetSelectable(StatsTD[0][playerid], 0);

	StatsTD[1][playerid] = TextDrawCreate(548.000000, 152.000000, "100"); // Количество убийств
	TextDrawBackgroundColor(StatsTD[1][playerid], 255);
	TextDrawFont(StatsTD[1][playerid], 2);
	TextDrawLetterSize(StatsTD[1][playerid], 0.390000, 2.000000);
	TextDrawColor(StatsTD[1][playerid], 1788399035);
	TextDrawSetOutline(StatsTD[1][playerid], 0);
	TextDrawSetProportional(StatsTD[1][playerid], 1);
	TextDrawSetShadow(StatsTD[1][playerid], 1);
	TextDrawSetSelectable(StatsTD[1][playerid], 0);

	StatsTD[2][playerid] = TextDrawCreate(548.000000, 185.000000, "100"); // Количество смертей
	TextDrawBackgroundColor(StatsTD[2][playerid], 255);
	TextDrawFont(StatsTD[2][playerid], 2);
	TextDrawLetterSize(StatsTD[2][playerid], 0.390000, 2.000000);
	TextDrawColor(StatsTD[2][playerid], 1788399035);
	TextDrawSetOutline(StatsTD[2][playerid], 0);
	TextDrawSetProportional(StatsTD[2][playerid], 1);
	TextDrawSetShadow(StatsTD[2][playerid], 1);
	TextDrawSetSelectable(StatsTD[2][playerid], 0);
PHP:
public OnPlayerSpawn(playerid)
{
	for(new i; i < 5; i++) TextDrawShowForPlayer(playerid,OtherTD[i][playerid]);
	for(new i; i < 3; i++) TextDrawShowForPlayer(playerid,StatsTD[i][playerid]);
	UpdateMyStatistic(playerid);
	return 1;
}
PHP:
public OnPlayerDeath(playerid, killerid, reason)
{
	for(new i; i < 5; i++) TextDrawHideForPlayer(playerid,OtherTD[i][playerid]);
	for(new i; i < 3; i++) TextDrawHideForPlayer(playerid,StatsTD[i][playerid]);
	MyStat[killerid][player_Kills]++;
	MyStat[playerid][player_Death]++;
	UpdateMyStatistic(playerid);
	UpdateMyStatistic(killerid);
	return 1;
}
PHP:
stock UpdateMyStatistic(playerid)
{
	switch(MyStat[playerid][player_Kills]) {
		case 0..100: TextDrawSetString(StatsTD[0][playerid],"мOBOЂPAмE‰"); // Новобранец
		case 101..300: TextDrawSetString(StatsTD[0][playerid],"EЃPE†ЏOP"); // Ефрейтор
		case 301..500: TextDrawSetString(StatsTD[0][playerid],"CEP„AмЏ"); // Сержант
		case 501.800: TextDrawSetString(StatsTD[0][playerid],"ћE†ЏEмAмЏ"); // Лейтенант
		case 801..1500: TextDrawSetString(StatsTD[0][playerid],"KAЊ…ЏAм"); // Капитан
		case 1501..2000: TextDrawSetString(StatsTD[0][playerid],"™EмEPA‡"); // Генерал
		case 2001..3000: TextDrawSetString(StatsTD[0][playerid],"®APЋA‡"); // Маршал
	}
	new info[128];
	format(info,sizeof(info),"%d",MyStat[playerid][player_Kills]);
	TextDrawSetString(StatsTD[1][playerid],info);
	format(info,sizeof(info),"%d",MyStat[playerid][player_Death]);
	TextDrawSetString(StatsTD[2][playerid],info);
	return true;
}
Плюсы данной системы:
+ Она русифицирована.
+ Не требует доработок (в плане исправления ошибок).
+ Можно спокойно использовать на сервере (если дописать сохранение).
+ Очень проста и приятна на глаз.
+ Не требует секундного обновления, тем самым снижает нагрузку на сервер.

Вообще, мне все равно на 15 потраченных минут впустую. Пользуйтесь. Если нужно будет, то выложу исходник (new.pwn).

Автор: #chopper
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу