Константин54321
Умник
И так дорогие посетители Павно хочу представить вам свою первую работу:
И так начнём :
Создаём несколько текс драйвов:
Ко всем New
Далее нам нужно создать несколько новых New:
Далее в пабли public OnPlayerStateChange(playerid, newstate, oldstate) добавим это:
Далее в пабли public OnGameModeInit() добавим сами машины, пикапы и 1 обект+текстовую надпись:
Далее идем в паблик public OnPlayerCommandText(playerid, cmdtext[]) и добавляем несколько команд:
Далее нужно создать несколько новых пабликов где нибудь в конце мода:
И создадим сохранение и загрузку склада:
в конец мода вставим:
Скрины в спойлере
Также нам понадобиться файл в scriptfiles который вы можете скачать по ссылке ниже:
Если у вас уже есть в моде команда /drink то удалите её и замените на ту что я предложил!
Автор:Я!
И так начнём :
Создаём несколько текс драйвов:
Ко всем New
PHP:
new Text3D: strit3D;
new Text3D: alkogolj3D;
new Text3D: yaki3D;
new Text3D: groviki3D;
new Text3D: rifaka3D;
PHP:
new furagroviki;
new furayaku;
new furarifaka;
new furaruskaja;
new furastrit;
//=========================[Склад банд]========================================
new ruskajamatbi = 1000;
new stritmatbi = 1000;
new grovikimatbi = 1000;
new rifakamatbi = 1000;
new yakmatbi = 10000;
//==================[Кол-во алкоголя в машинах для перевозки]================
new grovikifuramatbi = 0;
new yakfuramatbi = 0;
new rifakafuramatbi = 0;
new ruskajafuramatbi10 = 0;
new stritfuramatbi = 0; //strit ruskoj
PHP:
if(newcar == furaruskaja)
{
if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
{
format(string, sizeof(string), "Алкоголя: %d/20",ruskajafuramatbi10);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Для загрузки алкоголя используйте /buyalko /sellalkobar");
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не из rm gang");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
if(newcar == furastrit)
{
if(PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)
{
format(string, sizeof(string), "Алкоголя: %d/20",stritfuramatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Для загрузки алкоголя используйте /buyalko /sellalkobar");
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не из Strit Racers");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
if(newcar == furagroviki) //kar
{
if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
{
format(string, sizeof(string), "Алкоголя: %d/20",grovikifuramatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Для загрузки алкоголя используйте /buyalko /sellalkobar");
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не из Grov Gang");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
if(newcar == furayaku) //kar
{
if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
{
format(string, sizeof(string), "Алкоголя: %d/20",yakfuramatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Для загрузки алкоголя используйте /buyalko /sellalkobar");
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не из Yakuza");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
if(newcar == furarifaka) //kar
{
if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
{
format(string, sizeof(string), "Алкоголя: %d/20",rifakafuramatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Для загрузки алкоголя используйте /buyalko /sellalkobar");
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Вы не из Rifa Gang");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
PHP:
CreatePickup(1239,2,-1636.5366, 64.4886, 3.1398); //buy alko picup
CreatePickup(1239,2,-1707.64, 1351.64, 6.50); //Rm sklad
CreatePickup(1239,2,280.7672, -1522.8831, 24.5194); //strit sklad
CreatePickup(1239,2,-2110.5396, -178.3098, 34.8634); //rifa
CreatePickup(1239,2,2470.2000, -1696.1434, 13.1235); //grov
CreatePickup(1239,2,1303.4049, -796.6702, 83.9729); //yakuza
CreateDynamic3DTextLabel(" Для загрузки напишите /buyalko ",0xBFF600FF,-1636.5366, 64.4886, 3.1398,20.0);
//buyalko
CreateObject(3637, -1627.12, 76.45, 10.57, 0.00, 0.00, 314.04);
furayaku = AddStaticVehicleEx(482, 1270.1559, -830.8343, 83.1361, 0.0000, 6, 6, 1000);
furagroviki = AddStaticVehicleEx(482 ,2466.2893, -1710.1877, 13.4040, -90.0000, 16, 16, 1000);
furarifaka = AddStaticVehicleEx(482, -2101.2932, -176.3911, 35.1749, 0.0000, 87, 87, 1000);
furaruskaja = AddStaticVehicleEx(482,-1702.7915, 1353.2509, 7.0520, 133.9801, 0, 0, 1000);
furastrit = AddStaticVehicleEx(482, 288.9522, -1508.7645, 24.8955, 148.8000, 1, 1, 1000);
PHP:
if(strcmp(cmd, "/buyalko",true)==0)
{
if(PlayerToPoint(10,playerid,-1636.5366, 64.4886, 3.1398))
{
if(rifakafuramatbi < 20)
{
if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
{
new carid = GetPlayerVehicleID(playerid);
if(IsAFuraMats(carid))
{
new model = GetVehicleModel(carid);
if(model == 482)
{
SendClientMessage(playerid,COLOR_GRAD2,"Алкоголь загружен");
rifakafuramatbi += 20;
format(string, sizeof(string), "Алкоголя: %d/20",rifakafuramatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
}
}
}
if(PlayerToPoint(10,playerid,-1636.5366, 64.4886, 3.1398))
{
if(stritfuramatbi < 20)
{
if(PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)
{
new carid = GetPlayerVehicleID(playerid);
if(IsAFuraMats(carid))
{
new model = GetVehicleModel(carid);
if(model == 482)
{
SendClientMessage(playerid,COLOR_GRAD2,"Алкоголь загружен");
stritfuramatbi += 20;
format(string, sizeof(string), "Алкоголя: %d/20",stritfuramatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
}
}
}
if(PlayerToPoint(10,playerid,-1636.5366, 64.4886, 3.1398))
{
if(ruskajafuramatbi10 < 20)
{
if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
{
new carid = GetPlayerVehicleID(playerid);
if(IsAFuraMats(carid))
{
new model = GetVehicleModel(carid);
if(model == 482)
{
SendClientMessage(playerid,COLOR_GRAD2,"Алкоголь загружен");
ruskajafuramatbi10 += 20;
format(string, sizeof(string), "Алкоголя: %d/20",ruskajafuramatbi10);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
}
}
}
if(PlayerToPoint(10,playerid,-1636.5366, 64.4886, 3.1398))
{
if(grovikifuramatbi < 20)
{
if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
{
new carid = GetPlayerVehicleID(playerid);
if(IsAFuraMats(carid))
{
new model = GetVehicleModel(carid);
if(model == 482)
{
SendClientMessage(playerid,COLOR_GRAD2,"Алкоголь загружен");
grovikifuramatbi += 20;
format(string, sizeof(string), "Алкоголя: %d/20",grovikifuramatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
}
}
}
if(PlayerToPoint(10,playerid,-1636.5366, 64.4886, 3.1398))
{
if(yakfuramatbi < 20)
{
if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
{
new carid = GetPlayerVehicleID(playerid);
if(IsAFuraMats(carid))
{
new model = GetVehicleModel(carid);
if(model == 482)
{
SendClientMessage(playerid,COLOR_GRAD2,"Алкоголь загружен");
yakfuramatbi += 20;
format(string, sizeof(string), "Алкоголя: %d/20",yakfuramatbi);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
}
}
}
}
if(strcmp(cmd, "/sellalkobar",true)==0)
{
new carid = GetPlayerVehicleID(playerid);
if(IsAFuraMats(carid))
{
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid,COLOR_GREY,"Тебе нужно быть в алковозе");
return 1;
}
if(PlayerToPoint(20,playerid,280.7672, -1522.8831, 24.5194))
{
if(stritmatbi <= 1000)
{
f(PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)
{
new ammount = stritfuramatbi;
format(string, sizeof(string), "Алкоголя: %d/20",stritfuramatbi);
SendClientMessage(playerid,COLOR_GREEN,string);
stritfuramatbi -= ammount;
stritmatbi += ammount;
SaveStrit();
return 1;
}
}
}
if(PlayerToPoint(15,playerid,-1707.64, 1351.64, 6.50))
{
if(ruskajamatbi <= 1000)
{
if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
{
new ammount = ruskajafuramatbi10;
format(string, sizeof(string), "Алкоголя: %d/20",ruskajafuramatbi10);
SendClientMessage(playerid,COLOR_GREEN,string);
ruskajafuramatbi10 -= ammount;
ruskajamatbi += ammount;
SaveAlko();
return 1;
}
}
}
if(PlayerToPoint(15,playerid,-2110.5396, -178.3098, 34.8634))
{
if(rifakamatbi <= 1000)
{
if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
{
new ammount = rifakafuramatbi;
format(string, sizeof(string), "Алкоголя: %d/20",rifakafuramatbi);
SendClientMessage(playerid,COLOR_GREEN,string);
rifakafuramatbi -= ammount;
rifakamatbi += ammount;
SaveRifaka();
return 1;
}
}
}
if(PlayerToPoint(15,playerid,2470.2000, -1696.1434, 13.1235))
{
if(grovikimatbi <= 1000)
{
if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
{
new ammount = grovikifuramatbi;
format(string, sizeof(string), "Алкоголя: %d/20",grovikifuramatbi);
SendClientMessage(playerid,COLOR_GREEN,string);
grovikifuramatbi -= ammount;
grovikimatbi += ammount;
SaveGroviki();
return 1;
}
}
}
if(PlayerToPoint(30,playerid,1303.4049, -796.6702, 83.9729))
{
if(yakmatbi <= 1000)
{
if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
{
new ammount = yakfuramatbi;
format(string, sizeof(string), "Алкоголя: %d/20",yakfuramatbi);
SendClientMessage(playerid,COLOR_GREEN,string);
yakfuramatbi -= ammount;
yakmatbi += ammount;
SaveYakuziki();
return 1;
}
}
}
}
}
if(strcmp(cmd, "/drink", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsAtBar(playerid))
{
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) {
SendClientMessage(playerid, COLOR_WHITE, "--------=====Ïîìîù=====--------");
SendClientMessage(playerid, COLOR_WHITE, "Используйте: /drink [name]");
SendClientMessage(playerid, COLOR_WHITE, "Доступные названия: water(1$),wiski(10$),pivas(5$)");
SendClientMessage(playerid, COLOR_WHITE, "===============================");
return 1;
}
if(strcmp(x_nr,"water",true) == 0)
{
if(PlayerInfo[playerid][pLeader] == 13 || PlayerInfo[playerid][pMember] == 13)
{
new Float:health;
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - 1;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid, "~r~-1$", 3000, 1);
ruskajamatbi -= 1;
SaveAlko();
if(GetPlayerHealth(playerid, health) < 100)
{
SetPlayerHealth(playerid, health + 25.0);
}
}
if(PlayerInfo[playerid][pLeader] == 19 || PlayerInfo[playerid][pMember] == 19)
{
new Float:health;
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - 1;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid, "~r~-1$", 3000, 1);
stritmatbi -= 1;
SaveStrit();
if(GetPlayerHealth(playerid, health) < 100)
{
SetPlayerHealth(playerid, health + 25.0);
}
}
if(PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pMember] == 17)
{
new Float:health;
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - 1;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid, "~r~-1$", 3000, 1);
rifakamatbi -= 1;
SaveRifaka();
if(GetPlayerHealth(playerid, health) < 100)
{
SetPlayerHealth(playerid, health + 25.0);
}
}
if(PlayerInfo[playerid][pLeader] == 14 || PlayerInfo[playerid][pMember] == 14)
{
new Float:health;
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - 1;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid, "~r~-1$", 3000, 1);
grovikimatbi -= 1;
SaveGroviki();
if(GetPlayerHealth(playerid, health) < 100)
{
SetPlayerHealth(playerid, health + 25.0);
}
}
if(PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pMember] == 6)
{
new Float:health;
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - 1;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid, "~r~-1$", 3000, 1);
yakmatbi -= 1;
SaveYakuziki();
if(GetPlayerHealth(playerid, health) < 100)
{
SetPlayerHealth(playerid, health + 25.0);
}
}
}
if(strcmp(x_nr,"wiski",true) == 0)
{
if(PlayerInfo[playerid][pLeader] == 19 || PlayerInfo[playerid][pMember] == 19)
{
new Float:health;
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - 10;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid, "~r~-10$", 3000, 1);
stritmatbi -= 1;
SaveStrit();
if(GetPlayerHealth(playerid, health) < 100)
{
SetPlayerHealth(playerid, health + 25.0);
}
}
if(PlayerInfo[playerid][pLeader] == 13 || PlayerInfo[playerid][pMember] == 13)
{
new Float:health;
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - 10;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid, "~r~-10$", 3000, 1);
ruskajamatbi -= 1;
SaveAlko();
if(GetPlayerHealth(playerid, health) < 100)
{
SetPlayerHealth(playerid, health + 25.0);
}
}
if(PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pMember] == 17)
{
new Float:health;
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - 10;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid, "~r~-10$", 3000, 1);
rifakamatbi -= 1;
SaveRifaka();
if(GetPlayerHealth(playerid, health) < 100)
{
SetPlayerHealth(playerid, health + 25.0);
}
}
if(PlayerInfo[playerid][pLeader] == 14 || PlayerInfo[playerid][pMember] == 14)
{
new Float:health;
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - 10;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid, "~r~-10$", 3000, 1);
grovikimatbi -= 1;
SaveGroviki();
if(GetPlayerHealth(playerid, health) < 100)
{
SetPlayerHealth(playerid, health + 25.0);
}
}
if(PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pMember] == 6)
{
new Float:health;
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - 10;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid, "~r~-10$", 3000, 1);
yakmatbi -= 1;
SaveYakuziki();
if(GetPlayerHealth(playerid, health) < 100)
{
SetPlayerHealth(playerid, health + 25.0);
}
}
}
if(strcmp(x_nr,"pivas",true) == 0)
{
if(PlayerInfo[playerid][pLeader] == 19 || PlayerInfo[playerid][pMember] == 19)
{
new Float:health;
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - 5;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid, "~r~-5$", 3000, 1);
stritmatbi -= 1;
SaveStrit();
if(GetPlayerHealth(playerid, health) < 100)
{
SetPlayerHealth(playerid, health + 25.0);
}
}
if(PlayerInfo[playerid][pLeader] == 13 || PlayerInfo[playerid][pMember] == 13)
{
new Float:health;
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - 5;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid, "~r~-5$", 3000, 1);
ruskajamatbi -= 1;
SaveAlko();
if(GetPlayerHealth(playerid, health) < 100)
{
SetPlayerHealth(playerid, health + 25.0);
}
}
if(PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pMember] == 17)
{
new Float:health;
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - 5;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid, "~r~-5$", 3000, 1);
rifakamatbi -= 1;
SaveRifaka();
if(GetPlayerHealth(playerid, health) < 100)
{
SetPlayerHealth(playerid, health + 25.0);
}
}
if(PlayerInfo[playerid][pLeader] == 14 || PlayerInfo[playerid][pMember] == 14)
{
new Float:health;
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - 5;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid, "~r~-5$", 3000, 1);
grovikimatbi -= 1;
SaveGroviki();
if(GetPlayerHealth(playerid, health) < 100)
{
SetPlayerHealth(playerid, health + 25.0);
}
}
if(PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pMember] == 6)
{
new Float:health;
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - 5;
GivePlayerMoney(playerid, -1);
GameTextForPlayer(playerid, "~r~-5$", 3000, 1);
yakmatbi -= 1;
SaveYakuziki();
if(GetPlayerHealth(playerid, health) < 100)
{
SetPlayerHealth(playerid, health + 25.0);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Вы не в баре!");
return 1;
}
}
return 1;
}
PHP:
forward IsAtBar(playerid);
public IsAtBar(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(4.0,playerid,495.7801,-76.0305,998.7578) || PlayerToPoint(4.0,playerid,499.9654,-20.2515,1000.6797))
{//In grove street bar (with girlfriend), and in Havanna
return 1;
}
else if(PlayerToPoint(4.0,playerid,1215.9480,-13.3519,1000.9219) || PlayerToPoint(10.0,playerid,-2658.9749,1407.4136,906.2734))
{//PIG Pen
return 1;
}
else if(PlayerToPoint(7.0,playerid,1207.2,-28.4,1000.9) || PlayerToPoint(7.0,playerid,968.6,-47.1,1001.1))
{//PIG Pen
return 1;
}
else if(PlayerToPoint(7.0,playerid,-224.7,1404.9,27.7) || PlayerToPoint(7.0,playerid,2536.1,-1321.2,1031.4))
{//PIG Pen
return 1;
}
else if(PlayerToPoint(10.0,playerid,1257.7211,-791.0063,1084.0078) || PlayerToPoint(10.0,playerid,1262.6,-794.5,88.3))
{//PIG Pen
return 1;
}
else if(PlayerToPoint(10.0,playerid,1487.4,-666.9,95.6))
{//PIG Pen
return 1;
}
else if(PlayerToPoint(10.0,playerid,1257.2,-791.0,1084.0) || PlayerToPoint(10.0,playerid,2499.7,-1708.7,1014.7) || PlayerToPoint(10.0,playerid,-785.4873,500.0756,1371.7422) || PlayerToPoint(10.0,playerid,2537.1208,-1285.6659,1054.6406))
{//PIG Pen
return 1;
}
}
return 0;
}
forward IsAFuraMats(carid);
public IsAFuraMats(carid)
{
if( carid == furaruskaja || carid == furastrit|| carid == furarifaka || carid == furagroviki || carid == furayaku)
{
return 1;
}
return 0;
}
в конец мода вставим:
PHP:
forward LoadYakuziki();
public LoadYakuziki()
{
new arrCoords[15][64];
new strFromFile2[256];
new text[600];
new File: file = fopen("alkogolj/yakuziki.ini", io_read);
if (file)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
yakmatbi = strval(arrCoords[0]);
format(text,sizeof(text),"{00B366} * На складе * {FFFFFF}\nАлкоголя: {FF9900}%d{FFFFFF}",yakmatbi);
yaki3D = Create3DTextLabel(text,0xFFFFFFFF,1303.4049, -796.6702, 83.9729,30.0,0,1);
fclose(file);
if(Security == 0 || Security == 1)
{
}
else
{
GameModeExit();
}
}
else
{
GameModeExit();
}
return 1;
}
forward SaveYakuziki();
public SaveYakuziki()
{
new coordsstring[256];
new text[600];
format(coordsstring, sizeof(coordsstring), "%d", yakmatbi);
new File: file2 = fopen("alkogolj/yakuziki.ini", io_write);
fwrite(file2, coordsstring);
format(text,sizeof(text),"{00B366} * На складе * {FFFFFF}\nАлкоголя: {FF9900}%d{FFFFFF}",yakmatbi);
Update3DTextLabelText(yaki3D, 0xFFFFFFFF, text);
fclose(file2);
return 1;
}
forward LoadGroviki();
public LoadGroviki()
{
new arrCoords[15][64];
new strFromFile2[256];
new text[600];
new File: file = fopen("alkogolj/groviki.ini", io_read);
if (file)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
grovikimatbi = strval(arrCoords[0]);
format(text,sizeof(text),"{00B366} * На складе * {FFFFFF}\nАлкоголя: {FF9900}%d{FFFFFF}",grovikimatbi);
groviki3D = Create3DTextLabel(text,0xFFFFFFFF,2470.2000, -1696.1434, 13.1235,30.0,0,1);
fclose(file);
if(Security == 0 || Security == 1)
{
}
else
{
GameModeExit();
}
}
else
{
GameModeExit();
}
return 1;
}
forward SaveGroviki();
public SaveGroviki()
{
new coordsstring[256];
new text[600];
format(coordsstring, sizeof(coordsstring), "%d", grovikimatbi);
new File: file2 = fopen("alkogolj/groviki.ini", io_write);
fwrite(file2, coordsstring);
format(text,sizeof(text),"{00B366} * На складе * {FFFFFF}\nАлкоголя: {FF9900}%d{FFFFFF}",grovikimatbi);
Update3DTextLabelText(groviki3D, 0xFFFFFFFF, text);
fclose(file2);
return 1;
}
forward LoadRifaka();
public LoadRifaka()
{
new arrCoords[15][64];
new strFromFile2[256];
new text[600];
new File: file = fopen("alkogolj/rifaka.ini", io_read);
if (file)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
rifakamatbi = strval(arrCoords[0]);
format(text,sizeof(text),"{00B366} * На складе * {FFFFFF}\nАлкоголя: {FF9900}%d{FFFFFF}",rifakamatbi);
rifaka3D = Create3DTextLabel(text,0xFFFFFFFF,-2110.5396, -178.3098, 34.8634,30.0,0,1);
fclose(file);
if(Security == 0 || Security == 1)
{
}
else
{
GameModeExit();
}
}
else
{
GameModeExit();
}
return 1;
}
forward SaveRifaka();
public SaveRifaka()
{
new coordsstring[256];
new text[600];
format(coordsstring, sizeof(coordsstring), "%d", rifakamatbi);
new File: file2 = fopen("alkogolj/rifaka.ini", io_write);
fwrite(file2, coordsstring);
format(text,sizeof(text),"{00B366} * На складе * {FFFFFF}\nАлкоголя: {FF9900}%d{FFFFFF}",rifakamatbi);
Update3DTextLabelText(rifaka3D, 0xFFFFFFFF, text);
fclose(file2);
return 1;
}
forward LoadStrit();
public LoadStrit()
{
new arrCoords[15][64];
new strFromFile2[256];
new text[600];
new File: file = fopen("alkogolj/strit.ini", io_read);
if (file)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
stritmatbi = strval(arrCoords[0]);
format(text,sizeof(text),"{00B366} * На складе * {FFFFFF}\nАлкоголя: {FF9900}%d{FFFFFF}",stritmatbi);
strit3D = Create3DTextLabel(text,0xFFFFFFFF,280.7672, -1522.8831, 24.5194,30.0,0,1);
fclose(file);
if(Security == 0 || Security == 1)
{
}
else
{
GameModeExit();
}
}
else
{
GameModeExit();
}
return 1;
}
forward SaveStrit();
public SaveStrit()
{
new coordsstring[256];
new text[600];
format(coordsstring, sizeof(coordsstring), "%d", stritmatbi);
new File: file2 = fopen("alkogolj/strit.ini", io_write);
fwrite(file2, coordsstring);
format(text,sizeof(text),"{00B366} * На складе * {FFFFFF}\nАлкоголя: {FF9900}%d{FFFFFF}",stritmatbi);
Update3DTextLabelText(strit3D, 0xFFFFFFFF, text);
fclose(file2);
return 1;
}
forward LoadAlko();
public LoadAlko()
{
new arrCoords[15][64];
new strFromFile2[256];
new text[600];
new File: file = fopen("alkogolj/alko.ini", io_read);
if (file)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
ruskajamatbi = strval(arrCoords[0]);
format(text,sizeof(text),"{00B366} * На складе * {FFFFFF}\nАлкоголя: {FF9900}%d{FFFFFF}",ruskajamatbi);
alkogolj3D = Create3DTextLabel(text,0xFFFFFFFF,-1707.6443, 1351.6389, 6.5032,30.0,0,1);
fclose(file);
if(Security == 0 || Security == 1)
{
}
else
{
GameModeExit();
}
}
else
{
GameModeExit();
}
return 1;
}
forward SaveAlko();
public SaveAlko()
{
new coordsstring[256];
new text[600];
format(coordsstring, sizeof(coordsstring), "%d", ruskajamatbi);
new File: file2 = fopen("alkogolj/alko.ini", io_write);
fwrite(file2, coordsstring);
format(text,sizeof(text),"{00B366} * На складе * {FFFFFF}\nАлкоголя: {FF9900}%d{FFFFFF}",ruskajamatbi);
Update3DTextLabelText(alkogolj3D, 0xFFFFFFFF, text);
fclose(file2);
return 1;
}
Скрины в спойлере
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
[/URL]
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
[/URL]
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
[/URL]Также нам понадобиться файл в scriptfiles который вы можете скачать по ссылке ниже:
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Если у вас уже есть в моде команда /drink то удалите её и замените на ту что я предложил!
Автор:Я!
Последнее редактирование:
