F PUB - Inc.2022-11-23 154415

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 46

/*==============================[Public's]====================================*/

void SecPlayerTimer(playerid)
{
if(PlayerInfo[playerid][pLogged] == false)
{
SetPVarInt(playerid, "TimeLogged", GetPVarInt(playerid,"TimeLogged")
+1);
if(GetPVarInt(playerid,"TimeLogged") > 60)
{
SendClientMessage(playerid, c_ORANGE, "���� �� ����������
����������, �� ������ �� ���� ������� /q(uit)");
DeletePVar(playerid, "TimeLogged");
Kick(playerid);
}
}
else
{
new AFK_TIME = GetPVarInt(playerid, "AFK");
SetPVarInt(playerid, "AFK", AFK_TIME+1);
if(AFK_TIME > 1)
{
new
CB[30],
result[4]
;
result[0] = floatround(AFK_TIME / (3600 * 24));
result[1] = floatround(AFK_TIME / 3600);
result[2] = floatround((AFK_TIME / 60) - (result[1] * 60));
result[3] = floatround(AFK_TIME - ((result[1] * 3600) +
(result[2] * 60)));
switch(result[0])
{
case 0:
{
switch(result[1])
{
case 0: format(CB, 30, "%02d:%02d", result[2],
result[3]);
default: format(CB, 30, "%d:%02d:%02d",
result[1], result[2], result[3]);
}
}
}
SetPlayerChatBubble(playerid, CB, c_ORANGE, 15.0, 1200);
if(AFK_TIME > 900)
{
if(AdminInfo[playerid][a_level] > 0 && AdminInfo[playerid]
[a_level] < 3 && AFK_TIME >= 3600)
{
SendClientMessage(playerid, c_ARGON, "�� ����
����������� �� ������� �� ������ ������� � ������ AFK.");
DeletePVar(playerid, "AFK");
Kick(playerid);
}
else if(!AdminInfo[playerid][a_level])
{
SendClientMessage(playerid, c_ARGON, "�� ����
����������� �� ������� �� ������ ������� � ������ AFK.");
DeletePVar(playerid, "AFK");
Kick(playerid);
}
}
}
if(GetPlayerMoney(playerid) != GetMoney(playerid))
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, GetMoney(playerid));
}
if(PlayerInfo[playerid][pWanted] > 0)
{
PlayerInfo[playerid][pWantedTime]--;
if(PlayerInfo[playerid][pWantedTime] <= 0)
{
PlayerInfo[playerid][pWanted]--;
SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWanted]);
if(!PlayerInfo[playerid][pWanted])
SendClientMessage(playerid, c_ARGON, "�� ������ �� �������������� � �����
"LGREEN"SA");
else SendClientMessage(playerid, c_ARGON, "��� �������
������� � ����� "LGREEN"SA "ARGON"�������.");
if(PlayerInfo[playerid][pWanted] > 0) PlayerInfo[playerid]
[pWantedTime] = 3600 + random(3600);
}
}
if(PlayerInfo[playerid][Spectating][1] != INVALID_PLAYER_ID)
{
new str[300];
new Float:values[3];
GetPlayerHealth(PlayerInfo[playerid][Spectating][0], values[0]);
GetPlayerArmour(PlayerInfo[playerid][Spectating][0], values[1]);
GetVehicleHealth(GetPlayerVehicleID(PlayerInfo[playerid]
[Spectating][0]), values[2]);
format(str, sizeof(str), "%s~n~ID: %d~n~Ping: %d~n~HP:
%.1f~n~Armour: %.1f~n~Speed: %d~n~CarHP: %.1f~n~Ammo: %i:%i~n~Warns: %d~n~Cash:
%d",
GetName(PlayerInfo[playerid][Spectating][0]),
PlayerInfo[playerid][Spectating][0], GetPlayerPing(PlayerInfo[playerid][Spectating]
[0]),
values[0], values[1], GetSpeed(PlayerInfo[playerid][Spectating]
[0]) / 2, values[2],
GetPlayerWeapon(PlayerInfo[playerid][Spectating][0]),
GetPlayerAmmo(PlayerInfo[playerid][Spectating][0]),
PlayerInfo[PlayerInfo[playerid][Spectating][0]][pWarn],
PlayerInfo[PlayerInfo[playerid][Spectating][0]][pCash]);
PlayerTextDrawSetString(PlayerInfo[playerid][Spectating][1],
PlayerInfo[PlayerInfo[playerid][Spectating][1]][SpecTxt], str);
}
if(DrivingTestTime[playerid] > 0)
{
if(GetPlayerState(playerid) != 2)
{
DrivingTestTime[playerid]--;
new string[12];
format(string,12,"~r~%d",DrivingTestTime[playerid]);
GameTextForPlayer(playerid, string, 2000, 6);
if(DrivingTestTime[playerid] == 0)
{
SendClientMessage(playerid, COLOR_RED, "���� �������,
�� ��������� ������� �� ���������� �������� �����������");
DeletePVar(playerid, "DrivingTest");
DeletePVar(playerid, "DrivingTestHealth");
DeletePVar(playerid, "DrivingTestError");
}
}
}
if(FlyTestTime[playerid] > 0)
{
if(GetPlayerState(playerid) != 2)
{
FlyTestTime[playerid]--;
new string[12];
format(string,12,"~r~%d",FlyTestTime[playerid]);
GameTextForPlayer(playerid, string, 2000, 6);
if(FlyTestTime[playerid] == 0)
{
SendClientMessage(playerid, COLOR_RED, "���� �������,
�� ��������� ������� �� ���������� ��������� �����������");
DeletePVar(playerid, "FlyTest");
DeletePVar(playerid, "FlyTestHealth");
DeletePVar(playerid, "FlyTestError");
}
}
}
if(WaterTestTime[playerid] > 0)
{
if(GetPlayerState(playerid) != 2)
{
WaterTestTime[playerid]--;
new string[12];
format(string,12,"~r~%d",WaterTestTime[playerid]);
GameTextForPlayer(playerid, string, 2000, 6);
if(WaterTestTime[playerid] == 0)
{
SendClientMessage(playerid, COLOR_RED, "���� �������,
�� ��������� ������� �� ���������� ������ �����������");
DeletePVar(playerid, "WaterTest");
DeletePVar(playerid, "WaterTestTimeOn");
DeletePVar(playerid, "WaterTestHealth");
DeletePVar(playerid, "WaterTestError");
}
}
}
if(GetPVarInt(playerid, "TimeTaxi") > 0)
{
SetPVarInt(playerid, "TimeTaxi", GetPVarInt(playerid, "TimeTaxi")
- 1);
if(GetPVarInt(playerid, "TimeTaxi") == 0)
{
if(GetMoney(playerid) > GetPVarInt(playerid, "TaxiPrice"))
{
new string[32];
format(string, sizeof(string), "~r~-%i$",
GetPVarInt(playerid, "TaxiPrice"));
GameTextForPlayer(playerid, string, 5000, 1);
format(string, sizeof(string), "~b~+%i$",
GetPVarInt(playerid, "TaxiPrice"));
GameTextForPlayer(GetPVarInt(playerid, "PlayerTaxi"),
string, 5000, 1);
GiveDonate(playerid, -GetPVarInt(playerid,
"TaxiPrice"));

PlayerInfo[GetPVarInt(playerid, "PlayerTaxi")]
[pPayCheck] += GetPVarInt(playerid, "TaxiPrice");
SetPVarInt(playerid, "TimeTaxi", 30);
SetPVarInt(GetPVarInt(playerid, "PlayerTaxi"),
"TaxiMoney", GetPVarInt(GetPVarInt(playerid, "PlayerTaxi"), "TaxiMoney") +
GetPVarInt(playerid, "TaxiPrice"));
}
else
{
SendClientMessage(playerid, COLOR_GREY, "� ��� ��
������� �����!");
RemovePlayerFromVehicle(playerid);
}
}
}
if(GetPVarInt(playerid, "TimeBus") > 0)
{
SetPVarInt(playerid, "TimeBus", GetPVarInt(playerid, "TimeBus") -
1);
new string[32];
format(string, sizeof(string), "~r~%i", GetPVarInt(playerid,
"TimeBus"));
GameTextForPlayer(playerid, string, 2000, 6);
if(GetPVarInt(playerid, "TimeBus") == 0)
{
DeletePVar(playerid, "TimeBus");
new type = GetPVarInt(playerid, "TypeBus"), p =
pPressed[playerid];
SetPVarInt(playerid, "BusStop", 1);
if(type == 1)
SetPlayerRaceCheckpoint(playerid,0,BusCityLS[p][0],BusCityLS[p][1],BusCityLS[p]
[2],BusCityLS[p][3],BusCityLS[p][4],BusCityLS[p][5],5.0);
if(type == 2)
SetPlayerRaceCheckpoint(playerid,0,BusCitySF[p][0],BusCitySF[p][1],BusCitySF[p]
[2],BusCitySF[p][3],BusCitySF[p][4],BusCitySF[p][5],5.0);
if(type == 3)
SetPlayerRaceCheckpoint(playerid,0,BusCityLV[p][0],BusCityLV[p][1],BusCityLV[p]
[2],BusCityLV[p][3],BusCityLV[p][4],BusCityLV[p][5],5.0);
if(type == 4)
SetPlayerRaceCheckpoint(playerid,0,BusSchool[p][0],BusSchool[p][1],BusSchool[p]
[2],BusSchool[p][3],BusSchool[p][4],BusSchool[p][5],5.0);
if(type == 5) SetPlayerRaceCheckpoint(playerid,0,BusLS[p]
[0],BusLS[p][1],BusLS[p][2],BusLS[p][3],BusLS[p][4],BusLS[p][5],5.0);
}
}

if(GetPVarInt(playerid, "TypeBus")) PlayerInfo[playerid][pBusTime]++;

if(GetPVarInt(playerid,"BusTime") > 0)
{
if(GetPlayerState(playerid) != 2 ||
GetPlayerVehicleID(playerid) != PlayerInfo[playerid][BusCarID])
{
new string[32];
SetPVarInt(playerid,"BusTime",
GetPVarInt(playerid,"BusTime") - 1);
format(string, sizeof(string), "~r~
%d",GetPVarInt(playerid,"BusTime"));
GameTextForPlayer(playerid,string, 2000, 6);
new CB[16];
Convert(PlayerInfo[playerid][pBusTime], CB);
if(GetPVarInt(playerid,"BusTime") == 0)
{
if(IsValidDynamic3DTextLabel(BusText3D[playerid]))
DestroyDynamic3DTextLabel(BusText3D[playerid]);
SendMes(playerid, COLOR_BLUE, "������� ���� ��������.
���� ����������: %i$. ���� �����: %s", GetPVarInt(playerid,"BusMoney"), CB);
SendClientMessage(playerid,COLOR_WHITE, "������ �����
����������� �� ���� �� ���� ��������");
PlayerInfo[playerid][pPayCheck] +=
GetPVarInt(playerid,"BusMoney");
SetVehicleToRespawn(PlayerInfo[playerid][BusCarID]);
PlayerInfo[playerid][BusCarID] = INVALID_VEHICLE_ID;
DeletePVar(playerid,"BusTime");
DeletePVar(playerid,"TypeBus");
DeletePVar(playerid,"PriceBus");
DeletePVar(playerid,"BusStop");
DeletePVar(playerid,"BusMoney");
PlayerInfo[playerid][pBusTime] = 0;
pPressed[playerid] = 0;
}
}
}

if(PlayerClearDelay[playerid] == 1)
{
ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 1, 1, 1, 1,
1, 1);
PlayerClearDelay[playerid] = 0;
}

if(PlayerInfo[playerid][pMute] > 0)
{
PlayerInfo[playerid][pMute]--;
if(!PlayerInfo[playerid][pMute]) SendClientMessage(playerid,
c_GREEN, "���� ���������� ���� �����������, ������ �� ������ ��������.");
}
if(pKeyTime[playerid] > 0)
{
pKeyTime[playerid]--;
if(!pKeyTime[playerid])
{
if(cexjob[playerid] == true)
{
if(pKeys[playerid] > 0 && pProverka[playerid] ==
true)
{
pKeys[playerid]--;

PlayerTextDrawTextSize(playerid,
games_PTD[playerid], CheckCountGames[playerid]-10.1, 19.0);
CheckCountGames[playerid] -= 10.1;
PlayerTextDrawShow(playerid,
games_PTD[playerid]);
}
SetTimerEx("@Key_Job", 2000, false, "i", playerid);
}
if(newjob[playerid] == true)
{
if(pKeys[playerid] > 0 && pProverka[playerid] ==
true)
{
pKeys[playerid]--;

PlayerTextDrawTextSize(playerid,
games_PTD[playerid], CheckCountGames[playerid]-10.1, 19.0);
CheckCountGames[playerid] -= 10.1;
PlayerTextDrawShow(playerid,
games_PTD[playerid]);
}
SetTimerEx("@Key_Cand_Job", 2000, false, "i",
playerid);
}
pProverka[playerid] = false;
ApplyAnimation(playerid, "OTB", "WTCHRACE_LOSE", 4.1, 1, 1,
1, 1, 0, 1);
SetTimerEx("ClearText", 2000, false, "i", playerid);

TextDrawHideForPlayer(playerid, games_TD[2]);
TextDrawHideForPlayer(playerid, games_TD[3]);
TextDrawShowForPlayer(playerid, games_TD[5]);
}
}
if(pTimeJob[playerid] > 0)
{
pTimeJob[playerid]--;
if(!pTimeJob[playerid])
{
DisablePlayerCheckpoint(playerid);
ClearAnimations(playerid);
DeletePVar(playerid, "PLAYER_ANIM");
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);

pMesto[0]--;

if(Workpiece[playerid] > 0) WorkCase[1]


[WorkMesto[playerid]-1] = false;
cexjob[playerid] =
pProverka[playerid] = false;

WorkMesto[playerid] =
Workpiece[playerid] =
pKeyJob[playerid] =
pKeys[playerid] = 0;

RemovePlayerAttachedObject(playerid, 0);
RemovePlayerAttachedObject(playerid, 1);
RemovePlayerAttachedObject(playerid, 2);

TextDrawHideForPlayer(playerid, games_TD[0]);
TextDrawHideForPlayer(playerid, games_TD[1]);
TextDrawHideForPlayer(playerid, games_TD[2]);
TextDrawHideForPlayer(playerid, games_TD[3]);
TextDrawHideForPlayer(playerid, games_TD[4]);
TextDrawHideForPlayer(playerid, games_TD[5]);

PlayerTextDrawTextSize(playerid, games_PTD[playerid], 0.0,


19.0);
CheckCountGames[playerid] = 0;
PlayerTextDrawHide(playerid, games_PTD[playerid]);

if(PlantObject[playerid] != -1)
{
DestroyObject(PlantObject[playerid]);
PlantObject[playerid] = -1;
}

ShowPlayerDialog(playerid, D_NULL, 0, "NPC ������������",


""LGREEN"�� �� ����� ��������� ��� ������ �� ���������� ����. ������� ����
��������.", "��� ����", "");
}
}
if(PlayerInfo[playerid][pSleep] > 0) PlayerInfo[playerid][pSleep]--; //
-1 ������� � ������� (�����)
if(PlayerInfo[playerid][pJail] > 0)
{
PlayerInfo[playerid][pJailTime]--;
if(!PlayerInfo[playerid][pJailTime])
{
if(PlayerInfo[playerid][pJail] == 1 || PlayerInfo[playerid]
[pJail] == 2)
{
SetPlayerPos(playerid, 1552.704467,-
1675.532470,16.195312);
SetPlayerFacingAngle(playerid, 13.8672);
}
static const fmt_str[] = "NPC ��������: %s, �� �����. ��
����� ���� ���� � �����.";
new string[sizeof(fmt_str) + MAX_PLAYER_NAME];
format(string, sizeof(string), fmt_str, GetName(playerid));
ProxDetector(playerid, 15.0, c_PURPLE, string);

SetPlayerTeamColor(playerid);
PlayerInfo[playerid][pJail] =
PlayerInfo[playerid][pJailTime] = 0;
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
}
}
if(GetPVarInt(playerid, "TazerTime") > 0)
{
SetPVarInt(playerid, "TazerTime", GetPVarInt(playerid,
"TazerTime")-1);
if(!GetPVarInt(playerid, "TazerTime"))
{
ClearAnimations(playerid);
TogglePlayerControllable(playerid, 1);
}
}
if(PlayerInfo[playerid][pPhone][0] != INVALID_PLAYER_ID)
{
PlayerInfo[playerid][pPhone][0]++;
if(PlayerInfo[PlayerInfo[playerid][pPhone][1]][pPhone][1] ==
INVALID_PLAYER_ID && PlayerInfo[playerid][pPhone][0] == 5)
{
new str[20 + MAX_PLAYER_NAME];
PlayerInfo[playerid][pPhone][0] = 0;
format(str, sizeof(str), "� %s ������ �������",
GetName(PlayerInfo[playerid][pPhone][1]));
ProxDetector(PlayerInfo[playerid][pPhone][1], 10.0,
c_PURPLE, str);
}
}
if(PlayerInfo[playerid][pPhone][1] != INVALID_PLAYER_ID &&
PlayerInfo[playerid][pPhone][0] != INVALID_PLAYER_ID)
{
SetPVarInt(playerid, "PHONE_TIME", GetPVarInt(playerid, "PHONE_TIME")
+1);
if(GetPVarInt(playerid, "PHONE_TIME") >= 10)
{
if(PlayerInfo[playerid][pPhoneMoney] >= 1)
{
PlayerInfo[playerid][pPhoneMoney]--;
DeletePVar(playerid, "PHONE_TIME");
}
else
{
SendClientMessage(PlayerInfo[playerid][pPhone][1],
c_ARGON, "[�������] ��������, ���� ����������...");
SendClientMessage(playerid, c_ARGON, "[�������]
��������, ���� ����������...");
MobileCrash(playerid);
}
}
}
if(GetPVarInt(playerid, "PLAYER_GOV") > 0)
{
SetPVarInt(playerid, "PLAYER_GOV", GetPVarInt(playerid,
"PLAYER_GOV")-1);
if(!GetPVarInt(playerid, "PLAYER_GOV")) DeletePVar(playerid,
"PLAYER_GOV");
}
if(GetPVarInt(playerid, "Flood") > 30) Kick(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && !AFK_TIME)
SpeedSecond(playerid);
if(GetPVarInt(playerid, "PickupTime") < gettime() &&
GetPVarInt(playerid, "PickupLast") > 0) DeletePVar(playerid, "PickupLast");
}
return true;
}

void FiveSave(playerid)
{
foreach(new i : Player)
{
new Float:health;
GetPlayerHealth(i,health);
if(PlayerInfo[playerid][pHunger] >= 5 && PlayerInfo[playerid][pThirst]
>= 5)
{
if(PlayerInfo[i][pHunger] >= 2) PlayerInfo[i][pHunger] -= 2;
else PlayerInfo[playerid][pHunger]--;

if(PlayerInfo[i][pThirst] >= 3) PlayerInfo[i][pThirst] -= 3;


else PlayerInfo[playerid][pThirst] -= 2;

if(PlayerInfo[i][pHunger] == 15 || PlayerInfo[i][pThirst] == 15)


SendClientMessage(i, c_ARGON, "�� �������������. �������� ���� ��������� ��������
������.");
if(PlayerInfo[i][pHunger] == 10 || PlayerInfo[i][pThirst] == 10)
SendClientMessage(i, c_ARGON, "�� �������������. �������� ���� ��������� ��������
������.");
if(PlayerInfo[i][pHunger] == 5 || PlayerInfo[i][pThirst] == 5)
SendClientMessage(i, c_ARGON, " ���� �� �� �������� ��������� �������� ������, �� �
��� ����� ��������� ��������.");
}
else SetPlayerHealth(i, health-10.0);
SaveAccount(i);
UpdateHunger(playerid);
}

if(!random(2)) SendClientMessageToAll(c_PURPLE, "[���. �������]


"WHITE"�������� ���� �������. �� ������ ����������� ������� �����������
"GREEN"/call");
else SendClientMessageToAll(c_PURPLE, "[���. �������] "WHITE"�������� �������
�������. �� ������ ������ ������ ����������� "GREEN"/call");
for(new i = CarBmx[0]; i <= CarBmx[3]; i++)
{
if(!IsVehicleOccupied(i)) SetVehicleToRespawn(i);
}
return true;
}

void TenSecTimer()
{
PayDayTimer();
foreach(new i : Player)
{
if(PlayerInfo[i][pLogged] == false) continue;
if(GetPVarInt(i, "Flood") > 0) DeletePVar(i, "Flood");
new Float:health;
GetPlayerHealth(i,health);
if(pDeath[i] == 2)
{
PlayerInfo[i][pHeal] += 4.0;
SetPlayerHealth(i, health+4.0);
ShowInfoForPlayer(i, "+4 HEALTH", 2000);
if(PlayerInfo[i][pHeal] >= 100)
{
pDeath[i] = 0;
PlayerInfo[i][pHeal] = 100;
SetPlayerHealth(i, 100.0);
SendClientMessage(i, c_ARGON, "�� ���� �������� �� ��������
SA.");
}
}
}
forveh(Vehicleid)
{
if(Vehicleid == INVALID_VEHICLE_ID) continue;
if(!CarSPD(GetVehicleModel(Vehicleid)))
{
if(VehicleInfo[Vehicleid][vEngine] == true &&
VehicleInfo[Vehicleid][vFuel] <= 0.0)
{
VehicleInfo[Vehicleid][vFuel] = 0.0;
VehicleInfo[Vehicleid][vEngine] = false;
EngineVehicle(Vehicleid, false);
}
else if(VehicleInfo[Vehicleid][vEngine] == true &&
VehicleInfo[Vehicleid][vFuel] > 0.0) VehicleInfo[Vehicleid][vFuel] -=
TransInfo[GetVehicleModel(Vehicleid)-399][trConsumption]/100.0;
}
}
for(new i = 0; i < TOTALACTORS; i++)
{
SetActorPos(ActorsInfo[i][aID],ActorsInfo[i][acX],ActorsInfo[i]
[acY],ActorsInfo[i][acZ]);
ApplyActorAnimation(ActorsInfo[i][aID], ActorsInfo[i][aBible],
ActorsInfo[i][aAnim], 4.1,1,1,1,1,1);
}
return true;
}
/*============================================================================*/
void OnCheatDetected(playerid, ip_address[], type, code)
{
if(playerid == INVALID_PLAYER_ID) return true;
else if(AdminInfo[playerid][a_level] > 0) return true;
else if(type == AC_GLOBAL_TRIGGER_TYPE_PLAYER)
{
switch(code)
{
case 5, 6, 11, 22:
{
return 1;
}
case 32: // CarJack
{
new
Float:x,
Float:y,
Float:z;

AntiCheatGetPos(playerid, x, y, z);
return SetPlayerPos(playerid, x, y, z);
}
case 40: // Sandbox
{
SendClientMessage(playerid, -1, MAX_CONNECTS_MSG);
return AntiCheatKickWithDesync(playerid, code);
}
case 41: // Invalid Version
{
SendClientMessage(playerid, -1, UNKNOWN_CLIENT_MSG);
return AntiCheatKickWithDesync(playerid, code);
}
default:
{
if(gettime() - pAntiCheatLastCodeTriggerTime[playerid][code] <
AC_TRIGGER_ANTIFLOOD_TIME)
return 1;

pAntiCheatLastCodeTriggerTime[playerid][code] = gettime();
AC_CODE_TRIGGERED_COUNT[code]++;

new
string[88 - 10 + MAX_PLAYER_NAME + 5 + AC_MAX_CODE_NAME_LENGTH
+ AC_MAX_CODE_LENGTH],
trigger_type = AC_CODE_TRIGGER_TYPE[code];

if(trigger_type == AC_CODE_TRIGGER_TYPE_WARNING)
{
format(string, sizeof(string), "<AC> %s[%d] ������������ �
������������� ���-��������: %s [code: %03d].", GetName(playerid), playerid,
AC_CODE_NAME[code], code);
SendAdminMessage(-1, string);
}
else // AC_CODE_TRIGGER_TYPE_KICK
{
format(string, sizeof(string), "<AC-KICK> %s[%d] ��� ������ ��
��������� � ������������� ���-��������: %s [code: %03d].", GetName(playerid),
playerid, AC_CODE_NAME[code], code);
SendAdminMessage(-1, string);

format(string, sizeof(string), "�� ���� ������� �� ��������� �


������������� ���-��������: %s [code: %03d].", AC_CODE_NAME[code], code);
SendClientMessage(playerid, -1, string);

AntiCheatKickWithDesync(playerid, code);
}
}
}
}
else // AC_GLOBAL_TRIGGER_TYPE_IP
{
AC_CODE_TRIGGERED_COUNT[code]++;

new
string[58 - 8 + 16 + AC_MAX_CODE_NAME_LENGTH + AC_MAX_CODE_LENGTH];

format(string, sizeof(string), "<AC-BAN-IP> IP-����� %s ��� ������������:


%s [code: %03d].", ip_address, AC_CODE_NAME[code], code);
SendAdminMessage(-1, string);

BlockIpAddress(ip_address, 0);
}
return 1;
}
/*============================================================================*/
public OnQueryError(errorid, const error[], const callback[], const query[],
MySQL:handle)
{
printf("[ERROR] MYSQL (%i), (%s), (%s), (%s)", errorid, error, callback,
query);
return true;
}
/*============================================================================*/
void OnPlayerLogin(playerid)
{
SetPlayerVirtualWorld(playerid, playerid + 1);
TogglePlayerControllable(playerid, 0);

if(!random(2))
{
SetPlayerPos(playerid, 1244.6781,-1387.5233,13.3752);
SetPlayerCameraPos(playerid, 1248.2653, -1385.4033, 60.0644);
SetPlayerCameraLookAt(playerid, 1249.2600, -1385.5425, 59.7994);
}
else
{
SetPlayerPos(playerid, 1011.5471,-1726.0316,20.7109);
SetPlayerCameraPos(playerid, 998.1854, -1724.4066, 55.4353);
SetPlayerCameraLookAt(playerid, 997.2802, -1724.8407, 55.2303);
}

PlayAudioStreamForPlayer(playerid,"http://mountains-project.ru/media/
welcome.mp3");

if(cache_num_rows())
{
static const fmt_str [] =
"\
"WHITE"������������ ��� �� ������� ������� Mountains Project.
"GREEN"%s,"WHITE" ��� ��� ��������������� �� ����� �������.\n\
���� ������ ������� ����������� ���, �� ������� ��� ������ � ����
����.\n\n\
���� �� �� �������� ���������� ��������, ����������� �������
����� � �������� � ������ ������� "ORANGE"/q(uit),\n\
"WHITE"�������� ��� � ���� ������������ SA:MP � ����������������
����� �������.\n\
���� ��� ��� ������� � �� ������ ������, �� �� ������
������������ ��� �� ����� �����: "ORANGE"www.argonrp.ru\n\
"WHITE"����� �� ������� \"������ �������\" � �������
����� \"����� ������\", ����� ����, ��� ����� ������ ����� ������.\n\n\
"ORANGE"�������, ��� ��� ����� ������������� ����� ����� 5-� ���,
��� IP ����� ����� ������� �� 1 ���.\
";
new string[sizeof(fmt_str) + MAX_PLAYER_NAME - 1];
format(string, sizeof(string), fmt_str, GetName(playerid));
ShowPlayerDialog(playerid, D_LOG, DIALOG_STYLE_PASSWORD,
""GREEN"Mountains Project", string, "������", "��� ����");
}
else
{
pReg[playerid] = true;
static const fmt_str [] =
"\
"WHITE"������������ ��� �� ������� ������� Mountains Project.
"GREEN"%s,"WHITE" ��� ��� �� ��������������� �� ����� �������.\n\n\
\t- ���������� ������ �� ���������� ����������� �� �������.\n\t-
������� ��� ������ � ���� ����:\
";
new string[sizeof(fmt_str) + MAX_PLAYER_NAME - 1];
format(string, sizeof(string), fmt_str, GetName(playerid));
ShowPlayerDialog(playerid, D_REG, DIALOG_STYLE_PASSWORD,
""GREEN"Mountains Project", string, "�����", "��� ����");
}
return true;
}
/*============================================================================*/
void ChangePass(playerid, pass[], type)
{
if(cache_num_rows())
{
if(!type) ShowPlayerDialog(playerid, D_CFG+3, DIALOG_STYLE_INPUT,
"����� �����", ""WHITE"������� ����� ������:", "������", "�����");
else ShowPlayerDialog(playerid, D_CFG+4, DIALOG_STYLE_INPUT, "�����
�����", ""WHITE"������� ����� ������:", "������", "�����");
}
else
{
SendClientMessage(playerid, c_ORANGE, NotTruePassword);
Kick(playerid);
}
return true;
}
/*============================================================================*/
void BadLogin(playerid, pass[])
{
if(cache_num_rows())
{
cache_get_value_index(0, 43, PlayerInfo[playerid][pSettings], 32);
cache_get_value_index_int(0, 48, PlayerInfo[playerid][pKey]);
sscanf(PlayerInfo[playerid][pSettings],
"p<,>a<i>[7]",PlayerInfo[playerid][pSend]);
if(PlayerInfo[playerid][pSend][2] == 1) ShowPlayerDialog(playerid,
D_LOG+1, DIALOG_STYLE_INPUT, "������", ""WHITE"������� ��� ���-��� � ���� ����:",
"����", "������");
else LoadAccount(playerid);
}
else
{
if(!GetPVarInt(playerid, "wrongPass"))
{
SendClientMessage(playerid, c_ARGON, "�� ����� �������� ������ ��
��������. �� ������ ����������� /q(uit)");
Kick(playerid);
}
SetPVarInt(playerid, "wrongPass", GetPVarInt(playerid, "wrongPass")-1);

static const fmt_str [] =


"\
"WHITE"������������ ��� �� ������� ������� Mountains Project.
"GREEN"%s,"WHITE" ��� ��� ��������������� �� ����� �������.\n\
���� ������ ������� ����������� ���, �� ������� ��� ������ � ����
����.\n\n\
���� �� �� �������� ���������� ��������, ����������� �������
����� � �������� � ������ ������� "ORANGE"/q(uit),\n\
"WHITE"�������� ��� � ���� ������������ SA:MP � ����������������
����� �������.\n\
���� ��� ��� ������� � �� ������ ������, �� �� ������
������������ ��� �� ����� �����: "ORANGE"www.argonrp.ru\n\
"WHITE"����� �� ������� \"������ �������\" � �������
����� \"����� ������\", ����� ����, ��� ����� ������ ����� ������.\n\n\
"ORANGE"�������, ��� ��� ����� ������������� ����� ����� 5-� ���,
��� IP ����� ����� ������� �� 1 ���.\
",
fmt_str_2 [] = "�� ����� �� ������ ������! �������� %i �������";

new
string[sizeof(fmt_str) + MAX_PLAYER_NAME - 1],
string_2[sizeof(fmt_str_2) + 3]
;

format(string, sizeof(string), fmt_str, GetName(playerid));


format(string_2, sizeof(string_2), fmt_str_2, GetPVarInt(playerid,
"wrongPass")+1);

ShowPlayerDialog(playerid, D_LOG, DIALOG_STYLE_PASSWORD,


""GREEN"Mountains Project", string, "������", "��� ����");
SendClientMessage(playerid, c_ORANGE, string_2);
}
return true;
}
/*============================================================================*/
void AdminLogin(playerid)
{
if(cache_num_rows())
{
ShowPlayerDialog(playerid, D_SPAWN, DIALOG_STYLE_LIST, "����� ������",
""WHITE"1. ����� ������\n2. ���\n3. ����������\n4. �����\n5. ������", "�����", "");
pAdmLogged[playerid] = true;

static const fmt_str [] = "[ALOGIN] %s[%i] ������������ �


���������������� ������";
new string[sizeof(fmt_str) + 24];
format(string, sizeof(string), fmt_str, GetName(playerid), playerid);
SendAdminMessage(c_ARGON, string);
}
else
{
SendClientMessage(playerid, c_ORANGE, NotTruePassword);
Kick(playerid);

static const fmt_str [] = "[ALOGIN] %s ��� �������� ����������������


������. ��� ������ ��������.";
new string[sizeof(fmt_str) + 24];
format(string, sizeof(string), fmt_str, GetName(playerid));
SendAdminMessage(c_ARGON, string);
}
return true;
}
/*============================================================================*/
/*============================================================================*/
void LoadAcc(playerid, story_spawn)
{
if(!cache_num_rows()) return true;
cache_get_value_index_int(0, 0, PlayerInfo[playerid][pID]);
cache_get_value_index(0, 2, PlayerInfo[playerid][pPassword], 32);
cache_get_value_index(0, 3, PlayerInfo[playerid][pRegIP], 16);
cache_get_value_index(0, 4, PlayerInfo[playerid][pMail], 64);
cache_get_value_index_int(0, 5, PlayerInfo[playerid][pLevel]);
cache_get_value_index_int(0, 6, PlayerInfo[playerid][pCash]);
cache_get_value_index_int(0, 7, PlayerInfo[playerid][pBank]);
cache_get_value_index_int(0, 8, PlayerInfo[playerid][pCoin]);
cache_get_value_index_int(0, 9, PlayerInfo[playerid][pAllCoin]);
cache_get_value_index_int(0, 10, PlayerInfo[playerid][pLastCoin]);
cache_get_value_index_int(0, 11, PlayerInfo[playerid][pExp]);
cache_get_value_index(0, 12, PlayerInfo[playerid][pRegData], 16);
cache_get_value_index_int(0, 13, PlayerInfo[playerid][pJob]);
cache_get_value_index_int(0, 14, PlayerInfo[playerid][pLeader]);
cache_get_value_index_int(0, 15, PlayerInfo[playerid][pMember]);
cache_get_value_index_int(0, 16, PlayerInfo[playerid][pRank]);
cache_get_value_index_int(0, 17, PlayerInfo[playerid][pWarn]);
cache_get_value_index_int(0, 18, PlayerInfo[playerid][pSex]);
cache_get_value_index_int(0, 19, PlayerInfo[playerid][pModel]);
cache_get_value_index_int(0, 20, PlayerInfo[playerid][pChar]);
cache_get_value_index_int(0, 21, PlayerInfo[playerid][pJobSkin]);
cache_get_value_index_int(0, 22, PlayerInfo[playerid][pSkin]);
cache_get_value_index(0, 23, PlayerInfo[playerid][pLics], 16);
cache_get_value_index(0, 24, PlayerInfo[playerid][pGuns], 40);
cache_get_value_index(0, 25, PlayerInfo[playerid][pAmmos], 160);
cache_get_value_index_int(0, 26, PlayerInfo[playerid][pMute]);
cache_get_value_index_int(0, 27, PlayerInfo[playerid][pJail]);
cache_get_value_index_int(0, 28, PlayerInfo[playerid][pJailTime]);
cache_get_value_index_int(0, 29, PlayerInfo[playerid][pWanted]);
cache_get_value_index_int(0, 30, PlayerInfo[playerid][pWantedTime]);
cache_get_value_index(0, 31, PlayerInfo[playerid][pWantedWho],
MAX_PLAYER_NAME);
cache_get_value_index(0, 32, PlayerInfo[playerid][pWantedReason], 32);
cache_get_value_index_float(0, 33, PlayerInfo[playerid][pHeal]);
cache_get_value_index_float(0, 34, PlayerInfo[playerid][pArmour]);
cache_get_value_index_int(0, 35, PlayerInfo[playerid][pDrugs]);
cache_get_value_index_int(0, 36, PlayerInfo[playerid][pMats]);
cache_get_value_index_int(0, 37, PlayerInfo[playerid][pCrimes]);
cache_get_value_index(0, 38, PlayerInfo[playerid][pMarried],
MAX_PLAYER_NAME);
cache_get_value_index_int(0, 39, PlayerInfo[playerid][pAge]);
cache_get_value_index_int(0, 40, PlayerInfo[playerid][pSpawn]);
cache_get_value_index_int(0, 41, PlayerInfo[playerid][pArrests]);
cache_get_value_index(0, 42, PlayerInfo[playerid][pItems], 512);
cache_get_value_index(0, 43, PlayerInfo[playerid][pSettings], 32);
cache_get_value_index_int(0, 44, PlayerInfo[playerid][pRebuke]);
cache_get_value_index_int(0, 45, PlayerInfo[playerid][pPayCheck]);
cache_get_value_index_int(0, 46, PlayerInfo[playerid][pPhoneNumber]);
cache_get_value_index_int(0, 47, PlayerInfo[playerid][pPhoneMoney]);
cache_get_value_index_int(0, 48, PlayerInfo[playerid][pKey]);
cache_get_value_index_int(0, 49, PlayerInfo[playerid][pOnlineTime]);
cache_get_value_index(0, 50, PlayerInfo[playerid][pInvited], 24);
cache_get_value_index_int(0, 51, PlayerInfo[playerid][pEnter]);
cache_get_value_index_int(0, 52, PlayerInfo[playerid][pHunger]);
cache_get_value_index_int(0, 53, PlayerInfo[playerid][pThirst]);
cache_get_value_index_int(0, 54, PlayerInfo[playerid][pSleep]);
cache_get_value_index(0, 55, PlayerInfo[playerid][pSkills], 16);
cache_get_value_index(0, 56, PlayerInfo[playerid][pRabotas], 16);
cache_get_value_index(0, 57, PlayerInfo[playerid][pPromo], 24);

cache_get_value_name_int(0, "story", PlayerInfo[playerid][pStory]); // story

cache_get_value_name_int(0, "securitycode", PlayerInfo[playerid]


[pSecurityCode]);
cache_get_value_name_int(0, "checkcode", PlayerInfo[playerid][pCheckCode]);

SetSpawnInfo(playerid, 255, PlayerInfo[playerid][pModel], 0.0, 0.0, 0.0, 0.0,


0, 0, 0, 0, 0, 0);
sscanf(PlayerInfo[playerid][pLics], "p<,>a<i>[4]",PlayerInfo[playerid]
[pLic]);
sscanf(PlayerInfo[playerid][pGuns], "p<,>a<i>[13]",PlayerInfo[playerid]
[pGun]);
sscanf(PlayerInfo[playerid][pItems], "p<,>a<i>[37]",PlayerInfo[playerid]
[pItem]);
sscanf(PlayerInfo[playerid][pAmmos], "p<,>a<i>[13]",PlayerInfo[playerid]
[pAmmo]);
sscanf(PlayerInfo[playerid][pSettings], "p<,>a<i>[7]",PlayerInfo[playerid]
[pSend]);
sscanf(PlayerInfo[playerid][pSkills], "p<,>a<i>[4]",PlayerInfo[playerid]
[pSkill]);
sscanf(PlayerInfo[playerid][pRabotas], "p<,>a<i>[4]",PlayerInfo[playerid]
[pJobSkill]);

new Float:e_player_x, Float:e_player_y, Float:e_player_z, e_Virt, e_Int,


sscanf_delimit [ 64 ] ;
cache_get_value_name ( 0, "e_player", sscanf_delimit, 64 ) ;
sscanf ( sscanf_delimit, "p<,>fffii", e_player_x, e_player_y, e_player_z,
e_Int, e_Virt ) ;
SetPVarFloat(playerid, "e_X", e_player_x);
SetPVarFloat(playerid, "e_Y", e_player_y);
SetPVarFloat(playerid, "e_Z", e_player_z);
SetPVarInt(playerid, "e_Int", e_Int);
SetPVarInt(playerid, "e_Virt", e_Virt);

PlayerInfo[playerid][pPhone][0] =
PlayerInfo[playerid][pPhone][1] = INVALID_PLAYER_ID;

for(new i; i < MAX_PLAYER_TASKS; i ++)


{
if(PlayerInfo[playerid][pQuests][i] == 1) SendClientMessage(playerid,
0xFF9900AA, "� ��� ���� �������� �������. �����������: {FFFFFF}/storylines");
}
/*format(quest_string, 144, "%d %d %d %d %d st %d", PlayerInfo[playerid]
[pQuests][0],
PlayerInfo[playerid][pQuests][1],
PlayerInfo[playerid][pQuests][2],
PlayerInfo[playerid][pQuests][3],
PlayerInfo[playerid][pQuests][4], PlayerInfo[playerid][pStory]);*/

new
ip[16],
hour,
minuite,
second,
day,
month,
year

;
getdate(year, month, day);
gettime(hour, minuite, second);
GetPlayerIp(playerid, ip, 16);

if(PlayerInfo[playerid][pEnter] == 19)
{
static fmt_str[] = "SELECT * FROM `"TABLE_CONNECTS"` WHERE `Name` =
'%s'";
new string[sizeof(fmt_str) + MAX_PLAYER_NAME];
mysql_format(MySQL, string, sizeof(string), fmt_str,
GetName(playerid));
new Cache:result = mysql_query(MySQL, string, true);

if(cache_num_rows() >= 20)


{
static fmt_str_2[] = "DELETE FROM `"TABLE_CONNECTS"` WHERE `ID` =
'0' AND `Name` = '%s' LIMIT 1";
new string_2[sizeof(fmt_str_2) + MAX_PLAYER_NAME];
mysql_format(MySQL, string_2, sizeof(string_2), fmt_str_2,
GetName(playerid));
mysql_tquery(MySQL, string_2, "", "");

for(new i = 0; i < cache_num_rows(); i++)


{
static fmt_str_3[] = "UPDATE `"TABLE_CONNECTS"` SET `ID` =
'%i' WHERE `ID` = '%i' AND `Name` = '%s' LIMIT 1";
new string_3[sizeof(fmt_str_3) + MAX_PLAYER_NAME + 40];
mysql_format(MySQL, string_3, sizeof(string_3), fmt_str_3,
i, i+1, GetName(playerid));
mysql_tquery(MySQL, string_3, "", "");
}
}
cache_delete(result);
}

static fmt_str_4[] =
"\
INSERT INTO `"TABLE_CONNECTS"` \
(ID, \
Name, \
IP, \
Date, \
Time) \
VALUES \
('%i', \
'%e', \
'%e', \
'%02d.%02d.%02d', \
'%02d:%02d:%02d') \
";
new string_4[sizeof(fmt_str_4) + MAX_PLAYER_NAME + 100];
mysql_format(MySQL, string_4, sizeof(string_4), fmt_str_4
,
PlayerInfo[playerid][pEnter],
GetName(playerid),
ip,
day,
month,
year,
hour,
minuite,
second
);
mysql_tquery(MySQL, string_4, "", "");

if(PlayerInfo[playerid][pEnter] != 19) PlayerInfo[playerid][pEnter]++;


SetPlayerInt(GetName(playerid), "Enter", PlayerInfo[playerid][pEnter]);

if(PlayerInfo[playerid][pCheckCode] > 0)
{
SetPVarInt(playerid, "story_spawn_id", story_spawn);

for(new i = 0; i < 100; i++) SendClientMessageToAll(-1, "");

new texter_pas[5];
new digitsd[9] = {1,2,3,4,5,6,7,8,9};
for(new i, rand, old_digit; i < 9; i++)
{
while((rand = random(9)) == i) {}
old_digit = digitsd[i];
digitsd[i] = digitsd[rand];
digitsd[rand] = old_digit;
}
for(new f = 0; f < 10; f++)
{
if(f < 9)
{
mass_pass[playerid][f] = digitsd[f];
format(texter_pas,sizeof(texter_pas), "%i",
mass_pass[playerid][f]);
PlayerTextDrawSetString(playerid, SecurityCode[playerid]
[f], texter_pas);
}
PlayerTextDrawShow(playerid, SecurityCode[playerid][f]);
}
SendClientMessage(playerid, -1, "������� ������������ ����������� ����
������ ������������ �����");
PlayerInfo[playerid][pInputCode] = 0;
Ujahhs[playerid] = 1;
SelectTextDraw(playerid, -264092161);
}
else {
new admin_account;

for(new i; i < TOTALADMIN; i++)


{
if(strcmp(GetName(playerid), AdminInfo[i][a_name], false) == 0)
{
admin_account = 1;

printf("%s | %s", GetName(playerid), AdminInfo[i][a_name]);


break;
}
}

if(admin_account) ShowPlayerDialog(playerid, D_ADMIN,


DIALOG_STYLE_PASSWORD, "�����-������", ""WHITE"������� ��� ���������������� ������
�� ������������ �����-����", "������", "������");
else if(!story_spawn)
{
if(pReg[playerid] == false) ShowPlayerDialog(playerid, D_SPAWN,
DIALOG_STYLE_LIST, "����� ������", ""WHITE"1. ����� ������\n2. ���\n3. ����������\
n4. �����\n5. ������", "�����", "");
else
{
PlayerInfo[playerid][pSpawn] = 0;
SetPlayerInt(GetName(playerid), "Spawn",
PlayerInfo[playerid][pSpawn]);
SetPVarInt(playerid, "TimeLogged", -1);
SpawnPlayer(playerid);
UpdateHunger(playerid);
pReg[playerid] = false;
}
}
}
static const fmt_str_3[] = "[ADMIN]: ����� %s ���������";
new string_3[sizeof(fmt_str_3) + MAX_PLAYER_NAME];
format(string_3, sizeof(string_3), fmt_str_3, GetName(playerid),
GetPlayerIpCountry(playerid));
SendAdminMessage(c_LGREEN, string_3);

StopAudioStreamForPlayer(playerid);
return true;
}
//
void LoadAdmins()
{
if(!cache_num_rows()) return true;
new time = GetTickCount();
for(new i = 0; i < cache_num_rows(); i++)
{
cache_get_value_index_int(i, 0, AdminInfo[i][a_id]);
cache_get_value_index(i, 1, AdminInfo[i][a_name], MAX_PLAYER_NAME);
cache_get_value_index(i, 2, AdminInfo[i][a_insert], MAX_PLAYER_NAME);
cache_get_value_index_int(i, 3, AdminInfo[i][a_level]);
cache_get_value_index(i, 4, AdminInfo[i][a_password], 32);
cache_get_value_index_int(i, 5, AdminInfo[i][a_pm]);
cache_get_value_index_int(i, 6, AdminInfo[i][a_kick]);
cache_get_value_index_int(i, 7, AdminInfo[i][a_warn]);
cache_get_value_index_int(i, 8, AdminInfo[i][a_mute]);
cache_get_value_index_int(i, 9, AdminInfo[i][a_jail]);
cache_get_value_index_int(i, 10, AdminInfo[i][a_all_pm]);
cache_get_value_index_int(i, 11, AdminInfo[i][a_all_kick]);
cache_get_value_index_int(i, 12, AdminInfo[i][a_all_warn]);
cache_get_value_index_int(i, 13, AdminInfo[i][a_all_mute]);
cache_get_value_index_int(i, 14, AdminInfo[i][a_all_jail]);
cache_get_value_index_int(i, 15, AdminInfo[i][a_settings][0]);
TOTALADMIN++;
}
printf("[Load Admins]: loading %i / %i ms", TOTALADMIN, GetTickCount() -
time);
return true;
}
/*============================================================================*/
void LoadHouse()
{
if(!cache_num_rows()) return true;
new time = GetTickCount();
for(new idx = 0, ids = 1; idx < cache_num_rows(); ++idx, ++ids)
{
cache_get_value_index_float(idx, 1, HouseInfo[ids][hEntr][0]);
cache_get_value_index_float(idx, 2, HouseInfo[ids][hEntr][1]);
cache_get_value_index_float(idx, 3, HouseInfo[ids][hEntr][2]);
cache_get_value_index_float(idx, 4, HouseInfo[ids][hExit][0]);
cache_get_value_index_float(idx, 5, HouseInfo[ids][hExit][1]);
cache_get_value_index_float(idx, 6, HouseInfo[ids][hExit][2]);
cache_get_value_index_float(idx, 7, HouseInfo[ids][hCar][0]);
cache_get_value_index_float(idx, 8, HouseInfo[ids][hCar][1]);
cache_get_value_index_float(idx, 9, HouseInfo[ids][hCar][2]);
cache_get_value_index_float(idx, 10, HouseInfo[ids][hCar][3]);
cache_get_value_index(idx, 11, HouseInfo[ids][hOwner], 32);
cache_get_value_index(idx, 12, HouseInfo[ids][hDiscript], 16);
cache_get_value_index_int(idx, 13, HouseInfo[ids][hPrice]);
cache_get_value_index_int(idx, 14, HouseInfo[ids][hInt][0]);
cache_get_value_index_int(idx, 15, HouseInfo[ids][hInt][1]);
cache_get_value_index_int(idx, 16, HouseInfo[ids][hLock]);
cache_get_value_index_int(idx, 17, HouseInfo[ids][hCash]);
if(!strcmp(HouseInfo[ids][hOwner], "None", true))
{
HouseInfo[ids][hPickup][0] = CreatePickup(1273, 23, HouseInfo[ids]
[hEntr][0], HouseInfo[ids][hEntr][1], HouseInfo[ids][hEntr][2]);
static const fmt_str[] =
"\
����� ���� "GREEN"#%i\n\
"WHITE"��������� "GREEN"$%i\n\
"WHITE"����� "GREEN"%s\n\n\
"WHITE"�� ������� ������� "YL"ALT\
";
new string[sizeof(fmt_str) + 40];
format(string, sizeof(string), fmt_str
,
HouseInfo[ids][hID],
HouseInfo[ids][hPrice],
HouseInfo[ids][hDiscript]
);
LABELHOUSE[ids] = CreateDynamic3DTextLabel(string, -1, HouseInfo[ids]
[hEntr][0], HouseInfo[ids][hEntr][1], HouseInfo[ids][hEntr][2]+1.1,10.0);
}
else
{
HouseInfo[ids][hPickup][0] = CreatePickup(19523, 23, HouseInfo[ids]
[hEntr][0], HouseInfo[ids][hEntr][1], HouseInfo[ids][hEntr][2]);
static const fmt_str[] =
"\
����� ���� "GREEN"#%i\n\
"WHITE"�������� "GREEN"%s\n\
"WHITE"����� "GREEN"%s\n\n\
"WHITE"�� ����� ������� "YL"ALT\
";
new string[sizeof(fmt_str) + MAX_PLAYER_NAME + 30];
format(string, sizeof(string), fmt_str
,
HouseInfo[ids][hID],
HouseInfo[ids][hOwner],
HouseInfo[ids][hDiscript]
);
LABELHOUSE[ids] = CreateDynamic3DTextLabel(string, -1, HouseInfo[ids]
[hEntr][0], HouseInfo[ids][hEntr][1], HouseInfo[ids][hEntr][2]+1.1,10.0);
}
HouseInfo[ids][hPickup][1] = CreatePickup(19135, 23, HouseInfo[ids]
[hExit][0], HouseInfo[ids][hExit][1], HouseInfo[ids][hExit][2], HouseInfo[ids]
[hInt][1]);
++TOTALHOUSE;
}
print("\n*---------------------------------------------------------*");
printf("[Load House]: loading %i/%i ms", TOTALHOUSE, GetTickCount() - time);
return true;
}
/*============================================================================*/
void LoadGZ()
{
if(!cache_num_rows()) return true;
new time = GetTickCount();

for(new idx = 0; idx < cache_num_rows(); idx++)


{
cache_get_value_index_int(idx, 0, GZInfo[idx][gFactoryID]);
cache_get_value_index_float(idx, 1, GZInfo[idx][gCoords][0]);
cache_get_value_index_float(idx, 2, GZInfo[idx][gCoords][1]);
cache_get_value_index_float(idx, 3, GZInfo[idx][gCoords][2]);
cache_get_value_index_float(idx, 4, GZInfo[idx][gCoords][3]);
cache_get_value_index_int(idx, 5, GZInfo[idx][gFrak]);

GZInfo[idx][gID] = GangZoneCreate(GZInfo[idx][gCoords][0], GZInfo[idx]


[gCoords][1], GZInfo[idx][gCoords][2], GZInfo[idx][gCoords][3]);

TOTALGZ++;
ZoneOnBattle[idx] = 0;
GZSafeTime[idx] = 0;
}
printf("[Load Gang Zone]: loading %i/%i ms", TOTALGZ, GetTickCount() - time);
return true;
}
/*============================================================================*/
void LoadActors()
{
if(!cache_num_rows()) return true;
new time = GetTickCount();
for(new i = 0; i < cache_num_rows(); i++)
{
cache_get_value_index_int(i, 0, ActorsInfo[i][aID]);
cache_get_value_index_int(i, 1, ActorsInfo[i][aSkin]);
cache_get_value_index_float(i, 2, ActorsInfo[i][acX]);
cache_get_value_index_float(i, 3, ActorsInfo[i][acY]);
cache_get_value_index_float(i, 4, ActorsInfo[i][acZ]);
cache_get_value_index_float(i, 5, ActorsInfo[i][acFA]);
cache_get_value_index(i, 6, ActorsInfo[i][aBible], 15);
cache_get_value_index(i, 7, ActorsInfo[i][aAnim], 32);
cache_get_value_index(i, 8, ActorsInfo[i][aName], 32);
cache_get_value_index_int(i, 9, ActorsInfo[i][aType]);
cache_get_value_index_int(i, 10, ActorsInfo[i][aVirt]);

ActorsInfo[i][aID] = CreateActor(ActorsInfo[i][aSkin], ActorsInfo[i][acX],


ActorsInfo[i][acY], ActorsInfo[i][acZ], ActorsInfo[i][acFA]);
ApplyActorAnimation(ActorsInfo[i][aID], ActorsInfo[i][aBible],
ActorsInfo[i][aAnim], 4.1,1,1,1,1,1);

SetActorVirtualWorld(ActorsInfo[i][aID], ActorsInfo[i][aVirt]);
SetActorInvulnerable(ActorsInfo[i][aID], 1);

new string[80];
if(!ActorsInfo[i][aType]) format(string, 80, "NPC "WHITE"%s",
ActorsInfo[i][aName]);
else format(string, sizeof(string), "NPC "WHITE"%s\n\n����������� "YL"H
"WHITE"�� �������������", ActorsInfo[i][aName]);
LABELACTORS[i] = CreateDynamic3DTextLabel(string, c_YELLOW, ActorsInfo[i]
[acX], ActorsInfo[i][acY], ActorsInfo[i][acZ]+1.1,10.0, INVALID_PLAYER_ID,
INVALID_VEHICLE_ID, 0, ActorsInfo[i][aVirt], -1, -1, 5.0);
TOTALACTORS++;
}
printf("[Load Actors]: loading %i/%i ms", TOTALACTORS, GetTickCount() - time);
return true;
}
/*============================================================================*/
void LoadConfig()
{
new time = GetTickCount();
new rows; cache_get_row_count(rows);
if(!rows) return true;
cache_get_value_name_int(0, "password", server_password);
cache_get_value_name_int(0, "doubleexp", doubling_donate);
if(server_password == 1) SendRconCommand("password 22022014");
if(doubling_donate == 2) SendRconCommand("hostname Moutains Project | ���� �2
����� / ����");
printf("[Load Config]: loading %i ms", GetTickCount() - time);
return true;
}
/*============================================================================*/
void LoadPromo()
{
if(!cache_num_rows()) return true;
new time = GetTickCount();
for(new i = 0; i < cache_num_rows(); i++)
{
cache_get_value_index_int(i, 0, PromoInfo[i][p_ID]);
cache_get_value_index(i, 1, PromoInfo[i][p_Name], 24);
cache_get_value_index_int(i, 2, PromoInfo[i][p_Use]);

TOTALPROMO++;
}
printf("[Load Promo]: loading %i/%i ms", TOTALPROMO, GetTickCount() - time);
return true;
}
/*============================================================================*/
void LoadBizz()
{
if(!cache_num_rows()) return true;
new time = GetTickCount();
for(new idx = 0, ids = 1; idx < cache_num_rows(); ++idx, ++ids)
{
cache_get_value_index_int(idx, 0, BizzInfo[ids][bID]);
cache_get_value_index(idx, 1, BizzInfo[ids][bOwner], 32);
cache_get_value_index_int(idx, 2, BizzInfo[ids][bType]);
cache_get_value_index_int(idx, 3, BizzInfo[ids][bPrice]);
cache_get_value_index_float(idx, 4, BizzInfo[ids][bEntr][0]);
cache_get_value_index_float(idx, 5, BizzInfo[ids][bEntr][1]);
cache_get_value_index_float(idx, 6, BizzInfo[ids][bEntr][2]);
cache_get_value_index_float(idx, 7, BizzInfo[ids][bExit][0]);
cache_get_value_index_float(idx, 8, BizzInfo[ids][bExit][1]);
cache_get_value_index_float(idx, 9, BizzInfo[ids][bExit][2]);
cache_get_value_index_float(idx, 10, BizzInfo[ids][bMenu][0]);
cache_get_value_index_float(idx, 11, BizzInfo[ids][bMenu][1]);
cache_get_value_index_float(idx, 12, BizzInfo[ids][bMenu][2]);
cache_get_value_index_int(idx, 13, BizzInfo[ids][bInt][0]);
cache_get_value_index_int(idx, 14, BizzInfo[ids][bInt][1]);
cache_get_value_index_int(idx, 15, BizzInfo[ids][bMIcon][1]);
cache_get_value_index(idx, 16, BizzInfo[ids][bName], 64);
cache_get_value_index_int(idx, 17, BizzInfo[ids][bEnter]);
cache_get_value_index_int(idx, 18, BizzInfo[ids][bLock]);
cache_get_value_index_int(idx, 19, BizzInfo[ids][bProd]);
cache_get_value_index_int(idx, 20, BizzInfo[ids][bCash]);
cache_get_value_index(idx, 21, BizzInfo[ids][bBuff], 32);
sscanf(BizzInfo[ids][bBuff], "p<,>a<i>[3]", BizzInfo[ids][bFuel]);
cache_get_value_index(idx, 22, BizzInfo[ids][bBuff], 32);
sscanf(BizzInfo[ids][bBuff], "p<,>a<i>[3]", BizzInfo[ids][bFuelPrice]);
cache_get_value_index_int(idx, 23, BizzInfo[ids][bLic]);
cache_get_value_index(idx, 24, BizzInfo[ids][bBuff], 128);
sscanf(BizzInfo[ids][bBuff], "p<,>a<i>[12]", BizzInfo[ids]
[bPriceProd]);
cache_get_value_index_int(idx, 25, BizzInfo[ids][bFrac]);

if(BizzInfo[ids][bType] == 10)
{
if(!strcmp(BizzInfo[ids][bOwner], "None", true))
{
BizzInfo[ids][bPick][0] = CreatePickup(1274, 23,
BizzInfo[ids][bEntr][0],BizzInfo[ids][bEntr][1],BizzInfo[ids][bEntr][2]);
static const fmt_str[] =
"\
���� ���������� ������ (���)\n\n\
��������: "WHITE"%s\n\
"PURPLE"��������: "WHITE"�����������\n\n\
"PURPLE"�� ���������� ����������� "WHITE"ALT\
";
new string[sizeof(fmt_str) + 31];
format(string, sizeof(string), fmt_str, BizzInfo[ids]
[bName]);
LABELBIZZ[ids] = CreateDynamic3DTextLabel(string, c_PURPLE,
BizzInfo[ids][bEntr][0],BizzInfo[ids][bEntr][1],BizzInfo[ids][bEntr][2]+1.1,10.0);
}
else
{
BizzInfo[ids][bPick][0] = CreatePickup(1239, 23,
BizzInfo[ids][bEntr][0],BizzInfo[ids][bEntr][1],BizzInfo[ids][bEntr][2]);
static const fmt_str[] =
"\
���� ���������� ������ (���) \n\n\
��������: "WHITE"%s \n\
"PURPLE"��������: "WHITE"%s \n\
"PURPLE"������: "WHITE"%s \n\n\
"PURPLE"������ 92: "WHITE"$%i ( %i ������ ) \n\
"PURPLE"������ 95: "WHITE"$%i ( %i ������ ) \n\
"PURPLE"������: "WHITE"$%i ( %i ������ ) \n\n\
"PURPLE"�� ������������� �����������: "WHITE"/buy \
";
new string[sizeof(fmt_str) + MAX_PLAYER_NAME + 60];
format(string, sizeof(string), fmt_str
,
BizzInfo[ids][bName],
BizzInfo[ids][bOwner],
(BizzInfo[ids][bLock]) ? ("�������") : ("�������"),
BizzInfo[ids][bFuelPrice][0],
BizzInfo[ids][bFuel][1],
BizzInfo[ids][bFuelPrice][1],
BizzInfo[ids][bFuel][2],
BizzInfo[ids][bFuelPrice][2],
BizzInfo[ids][bFuel][0]
);
LABELBIZZ[ids] = CreateDynamic3DTextLabel(string, c_PURPLE,
BizzInfo[ids][bEntr][0],BizzInfo[ids][bEntr][1],BizzInfo[ids][bEntr][2]+1.1,10.0);
}
}
else
{
BizzInfo[ids][bPick][0] = CreatePickup(1274, 23, BizzInfo[ids]
[bEntr][0],BizzInfo[ids][bEntr][1],BizzInfo[ids][bEntr][2]);
BizzInfo[ids][bPick][1] = CreatePickup(1274, 23, BizzInfo[ids]
[bExit][0],BizzInfo[ids][bExit][1],BizzInfo[ids][bExit][2], BizzInfo[ids][bInt]
[1]);
BizzInfo[ids][bMIcon][0] = CreateDynamicMapIcon(BizzInfo[ids]
[bEntr][0],BizzInfo[ids][bEntr][1],BizzInfo[ids][bEntr][2],BizzInfo[ids][bMIcon]
[1], 0,-1,-1,-1, 1000.0);

if(!strcmp(BizzInfo[ids][bOwner], "None", true))


{
static const fmt_str[] =
"\
���������� "WHITE"#%i\n\
"ARGON"%s\n\n\
"PURPLE"��������: "WHITE"�����������\n\n\
"PURPLE"�� ���������� ����������� "WHITE"ALT\
";
new string[sizeof(fmt_str) + 100];
format(string, sizeof(string), fmt_str, BizzInfo[ids][bID],
BizzInfo[ids][bName]);
LABELBIZZ[ids] = CreateDynamic3DTextLabel(string, c_PURPLE,
BizzInfo[ids][bEntr][0],BizzInfo[ids][bEntr][1],BizzInfo[ids][bEntr][2]+1.1,10.0);
}
else
{
static const fmt_str[] =
"\
���������� "WHITE"#%i\n\
"ARGON"%s\n\n\
"PURPLE"��������: "WHITE"%s\n\
"PURPLE"������: "WHITE"%s\n\n\
"PURPLE"�� ����� ����������� "WHITE"ALT\
";
new string[sizeof(fmt_str) + MAX_PLAYER_NAME + 100];
format(string, sizeof(string), fmt_str
,
BizzInfo[ids][bID],
BizzInfo[ids][bName],
BizzInfo[ids][bOwner],
(BizzInfo[ids][bLock]) ? ("�������") : ("�������")
);
LABELBIZZ[ids] = CreateDynamic3DTextLabel(string, c_PURPLE,
BizzInfo[ids][bEntr][0],BizzInfo[ids][bEntr][1],BizzInfo[ids][bEntr][2]+1.1,10.0);
}
}
BizzInfo[ids][bPick][2] = CreatePickup(1239, 23, BizzInfo[ids][bMenu]
[0],BizzInfo[ids][bMenu][1],BizzInfo[ids][bMenu][2], BizzInfo[ids][bInt][1]);
++TOTALBIZZ;
}
printf("[Load Business]: loading %i/%i ms", TOTALBIZZ, GetTickCount() - time);
return true;
}
/*============================================================================*/
void LoadEnters()
{
if(!cache_num_rows()) return true;
new time = GetTickCount();
for(new idx = 0, ids = 1; idx < cache_num_rows(); ++idx, ++ids)
{
cache_get_value_index_int(idx, 0, EntersInfo[ids][eID]);
cache_get_value_index_float(idx, 1, EntersInfo[ids][eCord][0]);
cache_get_value_index_float(idx, 2, EntersInfo[ids][eCord][1]);
cache_get_value_index_float(idx, 3, EntersInfo[ids][eCord][2]);
cache_get_value_index_int(idx, 4, EntersInfo[ids][eNew][0]);
cache_get_value_index_int(idx, 5, EntersInfo[ids][eNew][1]);
cache_get_value_index_int(idx, 6, EntersInfo[ids][eInt][0]);
cache_get_value_index_int(idx, 7, EntersInfo[ids][eVirt][0]);
cache_get_value_index_float(idx, 8, EntersInfo[ids][ePt][0]);
cache_get_value_index_float(idx, 9, EntersInfo[ids][ePt][1]);
cache_get_value_index_float(idx, 10, EntersInfo[ids][ePt][2]);
cache_get_value_index_float(idx, 11, EntersInfo[ids][ePt][3]);
cache_get_value_index_int(idx, 12, EntersInfo[ids][eInt][1]);
cache_get_value_index_int(idx, 13, EntersInfo[ids][eVirt][1]);
cache_get_value_index(idx, 14, EntersInfo[ids][eName], 32);

EntersInfo[ids][eNew][2] = CreatePickup(EntersInfo[ids][eNew][0], 1,
EntersInfo[ids][eCord][0], EntersInfo[ids][eCord][1], EntersInfo[ids][eCord][2],
EntersInfo[ids][eVirt][0]);

new string[40];
format(string, sizeof(string), "%s\n"ORANGE"ALT", EntersInfo[ids]
[eName]);
LABELENTERS[ids] = CreateDynamic3DTextLabel(string, -1, EntersInfo[ids]
[eCord][0], EntersInfo[ids][eCord][1], EntersInfo[ids][eCord][2]+1.0, 10.0,
INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, EntersInfo[ids][eVirt][0], -1, -1, 15.0);
++TOTALENTERS;
}
printf("[Load Pickups]: loading %i/%i ms", TOTALENTERS, GetTickCount() - time);
return true;
}
/*============================================================================*/
void LoadVeh()
{
if(!cache_num_rows()) return true;

new
Model,
Float:x,
Float:y,
Float:z,
Float:fA,
Color[2],
VehicleID,
Buff[16],
time = GetTickCount()
;
for(new idx = 0; idx < cache_num_rows(); ++idx)
{
cache_get_value_index_int(idx, 1, Model);
cache_get_value_index_float(idx, 2, x);
cache_get_value_index_float(idx, 3, y);
cache_get_value_index_float(idx, 4, z);
cache_get_value_index_float(idx, 5, fA);
cache_get_value_index(idx, 6, Buff, 16);
sscanf(Buff, "p<,>a<i>[2]", Color);
VehicleID = AddStaticVehicleEx(Model, x, y, z, fA, Color[0], Color[1],
3600);
SetVehicleNumberPlate(VehicleID, "number");
VehicleInfo[VehicleID][vFuel] = TransInfo[GetVehicleModel(VehicleID)-
399][trTank];
cache_get_value_index_int(idx, 0, VehicleInfo[VehicleID][vID]);
VehicleInfo[VehicleID][vModel] = Model;
VehicleInfo[VehicleID][vPos][0] = x;
VehicleInfo[VehicleID][vPos][1] = y;
VehicleInfo[VehicleID][vPos][2] = z;
VehicleInfo[VehicleID][vPos][3] = fA;
cache_get_value_index_int(idx, 7, VehicleInfo[VehicleID][vFraction]);
VehicleInfo[VehicleID][vType] = 1;
VehicleInfo[VehicleID][vColor][0] = Color[0];
VehicleInfo[VehicleID][vColor][1] = Color[1];
VehicleInfo[VehicleID][vVehicle] = VehicleID;
++TOTALVEH;

printf("vehicleid: %d | %d | frac: %d | model: %d", VehicleID,


VehicleInfo[VehicleID][vVehicle], VehicleInfo[VehicleID][vFraction], Model);
}
printf("[Load Vehicle]: loading %i/%i ms", TOTALVEH, GetTickCount() - time);
return true;
}
/*============================================================================*/
void LoadATM()
{
if(!cache_num_rows()) return true;
new time = GetTickCount();
for(new idx = 0, ids = 1; idx < cache_num_rows(); ++idx, ++ids)
{
cache_get_value_index_int(idx, 0, ATMInfo[ids][aID]);
cache_get_value_index_float(idx, 1, ATMInfo[ids][aX]);
cache_get_value_index_float(idx, 2, ATMInfo[ids][aY]);
cache_get_value_index_float(idx, 3, ATMInfo[ids][aZ]);
cache_get_value_index_float(idx, 4, ATMInfo[ids][aFA]);
ATMInfo[ids][aATM] = CreateObject(19324, ATMInfo[ids][aX], ATMInfo[ids][aY],
ATMInfo[ids][aZ], 0.0, 0.0, ATMInfo[ids][aFA]);

static const fmt_str [] = "��������\n"WHITE"�������: N ( /atm )";


new string[sizeof(fmt_str) + 24];
format(string, sizeof(string), fmt_str);
LABELATM[idx] = CreateDynamic3DTextLabel(string, 0xAFAFAFFF,
ATMInfo[ids][aX], ATMInfo[ids][aY], ATMInfo[ids][aZ]+1.1,10.0);

++TOTALATM;
}
printf("[Load ATM]: loading %i/%i ms", TOTALATM, GetTickCount() - time);
return true;
}
/*============================================================================*/
void LoadPhone()
{
if(!cache_num_rows()) return true;
new time = GetTickCount();
for(new idx = 0, ids = 1; idx < cache_num_rows(); ++idx, ++ids)
{
cache_get_value_index_int(idx, 0, PhoneInfo[ids][pID]);
cache_get_value_index_float(idx, 1, PhoneInfo[ids][pX]);
cache_get_value_index_float(idx, 2, PhoneInfo[ids][pY]);
cache_get_value_index_float(idx, 3, PhoneInfo[ids][pZ]);
cache_get_value_index_float(idx, 4, PhoneInfo[ids][pFA]);
cache_get_value_index_int(idx, 5, PhoneInfo[ids][pNumber]);

PhoneInfo[ids][pPhone] = CreateObject(1216, PhoneInfo[ids][pX],


PhoneInfo[ids][pY], PhoneInfo[ids][pZ], 0.0, 0.0, PhoneInfo[ids][pFA]);
static const fmt_str[] = "���������� �������\n"YL"����� - %i\n\
n{AFAFAF}�������: N";
new string[sizeof(fmt_str) + 10];
format(string, sizeof(string), fmt_str, PhoneInfo[ids][pNumber]);
LABELPHONE[idx] = CreateDynamic3DTextLabel(string, 0xAFAFAFFF,
PhoneInfo[ids][pX], PhoneInfo[ids][pY], PhoneInfo[ids][pZ]+1.1,10.0);
++TOTALPHONE;
}
printf("[Load Phone]: loading %i/%i ms", TOTALPHONE, GetTickCount() - time);
return true;
}
/*============================================================================*/
void LoadFrac()
{
if(!cache_num_rows()) return true;
new
time = GetTickCount(),
Other[4]
;
for(new idx = 0, ids = 1; idx < cache_num_rows(); ++idx, ++ids)
{
cache_get_value_index_int(idx, 0, FracInfo[ids][fID]);
cache_get_value_index(idx, 1, FracInfo[ids][fName], 32);
cache_get_value_index(idx, 2, FracInfo[ids][fLeader], 32);
cache_get_value_index(idx, 3, FracInfo[ids][fAssistant], 32);
cache_get_value_index(idx, 4, FracInfo[ids][fBuff], 16);
sscanf(FracInfo[ids][fBuff], "p<,>a<i>[4]", FracInfo[ids][fHelper]);
cache_get_value_index(idx, 5, FracRank[ids][1], 32);
cache_get_value_index(idx, 6, FracRank[ids][2], 32);
cache_get_value_index(idx, 7, FracRank[ids][3], 32);
cache_get_value_index(idx, 8, FracRank[ids][4], 32);
cache_get_value_index(idx, 9, FracRank[ids][5], 32);
cache_get_value_index(idx, 10, FracRank[ids][6], 32);
cache_get_value_index(idx, 11, FracRank[ids][7], 32);
cache_get_value_index(idx, 12, FracRank[ids][8], 32);
cache_get_value_index(idx, 13, FracRank[ids][9], 32);
cache_get_value_index(idx, 14, FracRank[ids][10], 32);
cache_get_value_index(idx, 15, FracRank[ids][11], 32);
cache_get_value_index(idx, 16, FracRank[ids][12], 32);
cache_get_value_index(idx, 17, FracRank[ids][13], 32);
cache_get_value_index(idx, 18, FracRank[ids][14], 32);
cache_get_value_index(idx, 19, FracRank[ids][15], 32);
cache_get_value_index(idx, 20, FracRank[ids][16], 32);
cache_get_value_index(idx, 21, FracRank[ids][17], 32);
cache_get_value_index(idx, 22, FracRank[ids][18], 32);
cache_get_value_index(idx, 23, FracRank[ids][19], 32);
cache_get_value_index(idx, 24, FracRank[ids][20], 32);
cache_get_value_index(idx, 25, FracRank[ids][21], 32);
cache_get_value_index(idx, 26, FracInfo[ids][fPayDay], 128);
sscanf(FracInfo[ids][fPayDay], "p<,>a<i>[21]", FracInfo[ids][FracPay]);
cache_get_value_index(idx, 27, FracInfo[ids][fBuff], 64);
sscanf(FracInfo[ids][fBuff], "p<,>a<i>[4]", Other);
cache_get_value_index_float(idx, 28, FracInfo[ids][fracX]);
cache_get_value_index_float(idx, 29, FracInfo[ids][fracY]);
cache_get_value_index_float(idx, 30, FracInfo[ids][fracZ]);
cache_get_value_index_float(idx, 31, FracInfo[ids][fracFA]);
cache_get_value_index_int(idx, 32, FracInfo[ids][fInt]);
cache_get_value_index_int(idx, 33, FracInfo[ids][fVirt]);
cache_get_value_index(idx, 34, FracInfo[ids][fSkin], 128);
sscanf(FracInfo[ids][fSkin], "p<,>a<i>[21]", FracInfo[ids][FracSkin]);
cache_get_value_index(idx, 35, FracInfo[ids][fSkin], 128);
sscanf(FracInfo[ids][fSkin], "p<,>a<i>[21]", FracInfo[ids][FracSkins]);

switch(FracInfo[ids][fID])
{
case F_HOSPITAL: HealPrice = Other[0];
}

FracInfo[ids][fFactoryPick][0] = -1;
FracInfo[ids][fFactoryPick][1] = -1;
FracInfo[ids][fFactoryPick][2] = -1;

++TOTALFRAC;
}
printf("[Load Fraction]: loading %i/%i ms", TOTALFRAC, GetTickCount() - time);
return true;
}
/*============================================================================*/
void LoadGas()
{
if(!cache_num_rows()) return true;
new time = GetTickCount();
for(new idx = 0, ids = 1; idx < cache_num_rows(); ++idx, ++ids)
{
cache_get_value_index_int(idx, 0, GasInfo[ids][gsID]);
cache_get_value_index_float(idx, 1, GasInfo[ids][gsPos][0]);
cache_get_value_index_float(idx, 2, GasInfo[ids][gsPos][1]);
cache_get_value_index_float(idx, 3, GasInfo[ids][gsPos][2]);
cache_get_value_index_float(idx, 4, GasInfo[ids][gsPos][3]);
cache_get_value_index_int(idx, 5, GasInfo[ids][gsBizzID]);
cache_get_value_index_int(idx, 6, GasInfo[ids][gsType]);
cache_get_value_index_int(idx, 7, GasInfo[ids][gsUpgrade]);
if(GasInfo[ids][gsType] > 0)
{
switch(GasInfo[ids][gsUpgrade])
{
case 1: GasInfo[ids][gsGas] = CreateObject(1244,
GasInfo[ids][gsPos][0],GasInfo[ids][gsPos][1],GasInfo[ids][gsPos][2]-
0.7,0.0,0.0,GasInfo[ids][gsPos][3]+90);
case 2: GasInfo[ids][gsGas] = CreateObject(1686,
GasInfo[ids][gsPos][0],GasInfo[ids][gsPos][1],GasInfo[ids][gsPos][2]-
1.5,0.0,0.0,GasInfo[ids][gsPos][3]+90);
case 3: GasInfo[ids][gsGas] = CreateObject(1676,
GasInfo[ids][gsPos][0],GasInfo[ids][gsPos][1],GasInfo[ids][gsPos]
[2],0.0,0.0,GasInfo[ids][gsPos][3]);
}
GasInfo[ids][gsArea] = CreateDynamicSphere(GasInfo[ids][gsPos]
[0], GasInfo[ids][gsPos][1], GasInfo[ids][gsPos][2], 7.0);
}
++TOTALGAS;
}
printf("[Load Gasolines]: loading %i/%i ms", TOTALGAS, GetTickCount() - time);
return true;
}
/*============================================================================*/
void LoadTransport()
{
if(!cache_num_rows()) return true;
new time = GetTickCount();
for(new idx = 0, ids = 1; idx < cache_num_rows(); ++idx, ++ids)
{
cache_get_value_index_int(idx, 0, TransInfo[ids][trID]);
cache_get_value_index_int(idx, 1, TransInfo[ids][trModel]);
cache_get_value_index(idx, 2, TransInfo[ids][trName], 34);
cache_get_value_index_int(idx, 3, TransInfo[ids][trPrice]);
cache_get_value_index_int(idx, 4, TransInfo[ids][trTank]);
cache_get_value_index_int(idx, 5, TransInfo[ids][trConsumption]);
cache_get_value_index_int(idx, 6, TransInfo[ids][trClass]);
cache_get_value_index_int(idx, 7, TransInfo[ids][trFuelable]);
cache_get_value_index_int(idx, 8, TransInfo[ids][trFuelMark]);
++TOTALTRANSPORT;
}
forveh(Vehicleid)
{
if(Vehicleid >= SellCar[0] && Vehicleid <= SellCar[13]) continue;
if(!VehicleInfo[Vehicleid][vType] &&
TransInfo[GetVehicleModel(Vehicleid)-399][trTank] > 0)
{
SetVehicleNumberPlate(Vehicleid, "A Project");
VehicleInfo[Vehicleid][vFuel] =
TransInfo[GetVehicleModel(Vehicleid)-399][trTank];
}
}
printf("[Load Transport]: loading %i/%i ms", TOTALTRANSPORT, GetTickCount() -
time);
return true;
}
/*============================================================================*/
void LoadCars()
{
if(!cache_num_rows()) return true;
new
Model,
Float:x,
Float:y,
Float:z,
Float:fA,
Color[2],
VehicleID,
Buff[16],
Owner[MAX_PLAYER_NAME],
time = GetTickCount()
;
for(new idx = 0; idx < cache_num_rows(); ++idx)
{
cache_get_value_index(idx, 1, Owner, 34);
for(new i = 1; i <= TOTALHOUSE; ++i)
{
if(strcmp(HouseInfo[i][hOwner], Owner, false) == 0)
{
cache_get_value_index_int(idx, 2, Model);
cache_get_value_index_float(idx, 3, x);
cache_get_value_index_float(idx, 4, y);
cache_get_value_index_float(idx, 5, z);
cache_get_value_index_float(idx, 6, fA);
cache_get_value_index(idx, 11, Buff, 16);
sscanf(Buff, "p<,>a<i>[2]", Color);
VehicleID = AddStaticVehicleEx(Model, x, y, z, fA,
Color[0], Color[1], -1);
strmid(VehicleInfo[VehicleID][vOwner], Owner, 0,
strlen(Owner), MAX_PLAYER_NAME);
cache_get_value_index_int(idx, 0, VehicleInfo[VehicleID]
[vID]);
VehicleInfo[VehicleID][vModel] = Model;
VehicleInfo[VehicleID][vPos][0] = x;
VehicleInfo[VehicleID][vPos][1] = y;
VehicleInfo[VehicleID][vPos][2] = z;
VehicleInfo[VehicleID][vPos][3] = fA;
cache_get_value_index_float(idx, 7, VehicleInfo[VehicleID]
[vFuel]);
cache_get_value_index_float(idx, 8, VehicleInfo[VehicleID]
[vHeal]);
cache_get_value_index_float(idx, 9, VehicleInfo[VehicleID]
[vMileage][0]);
cache_get_value_index_int(idx, 10, VehicleInfo[VehicleID]
[vCost]);
VehicleInfo[VehicleID][vColor][0] = Color[0];
VehicleInfo[VehicleID][vColor][1] = Color[1];
cache_get_value_index_int(idx, 12, VehicleInfo[VehicleID]
[vLock]);
cache_get_value_index(idx, 13, VehicleInfo[VehicleID]
[vBuff], 128);
cache_get_value_index_int(idx, 14, VehicleInfo[VehicleID]
[vPaintjob]);
sscanf(VehicleInfo[VehicleID][vBuff], "p<,>a<i>[14]",
VehicleInfo[VehicleID][vVehcomp]);
cache_get_value_index_int(idx, 15, VehicleInfo[VehicleID]
[vNumber]);
if(!VehicleInfo[VehicleID][vNumber])
SetVehicleNumberPlate(VehicleID, "None");
else
{
static const fmt_str[] = ""RED"SA {FFFFAA}%d";
new string[sizeof(fmt_str) + 10];
format(string, sizeof(string), fmt_str,
VehicleInfo[VehicleID][vNumber]);
SetVehicleNumberPlate(VehicleID, string);
}

VehicleInfo[VehicleID][vType] = 2;
VehicleInfo[VehicleID][vVehicle] = VehicleID;
SetVehicleHealth(VehicleID, VehicleInfo[VehicleID][vHeal]);
VehicleInfo[VehicleID][vEngine] =
VehicleInfo[VehicleID][vLights] = false;
EngineVehicle(VehicleID, false);
LightVehicle(VehicleID, false);
if(!VehicleInfo[VehicleID][vLock]) DoorVehicle(VehicleID,
false);
else DoorVehicle(VehicleID, true);
++TOTALCARS;
break;
}
}
}
printf("[Load Cars]: loading %i/%i ms", TOTALCARS, GetTickCount() - time);
return true;
}
/*============================================================================*/
void LoadPlayerCar(playerid, i)
{
if(!cache_num_rows()) return true;
new
Model,
Color[2],
VehicleID,
Buff[16],
ID
;
cache_get_value_index_int(0, 0, ID);
cache_get_value_index_int(0, 2, Model);
cache_get_value_index(0, 11, Buff, 16);
sscanf(Buff, "p<,>a<i>[2]", Color);
VehicleID = CreateVehicle(Model, HouseInfo[i][hCar][0], HouseInfo[i][hCar]
[1], HouseInfo[i][hCar][2], HouseInfo[i][hCar][3], Color[0], Color[1], -1);
cache_get_value_index(0, 1, VehicleInfo[VehicleID][vOwner], 34);
VehicleInfo[VehicleID][vVehicle] = VehicleID;
VehicleInfo[VehicleID][vID] = ID;
VehicleInfo[VehicleID][vModel] = Model;
VehicleInfo[VehicleID][vPos][0] = HouseInfo[i][hCar][0];
VehicleInfo[VehicleID][vPos][1] = HouseInfo[i][hCar][1];
VehicleInfo[VehicleID][vPos][2] = HouseInfo[i][hCar][2];
VehicleInfo[VehicleID][vPos][3] = HouseInfo[i][hCar][3];
cache_get_value_index_float(0, 7, VehicleInfo[VehicleID][vFuel]);
cache_get_value_index_float(0, 8, VehicleInfo[VehicleID][vHeal]);
cache_get_value_index_float(0, 9, VehicleInfo[VehicleID][vMileage][0]);
cache_get_value_index_int(0, 10, VehicleInfo[VehicleID][vCost]);
VehicleInfo[VehicleID][vColor][0] = Color[0];
VehicleInfo[VehicleID][vColor][1] = Color[1];
cache_get_value_index_int(0, 12, VehicleInfo[VehicleID][vLock]);
cache_get_value_index(0, 13, VehicleInfo[VehicleID][vBuff], 128);
cache_get_value_index_int(0, 14, VehicleInfo[VehicleID][vPaintjob]);
sscanf(VehicleInfo[VehicleID][vBuff], "p<,>a<i>[14]", VehicleInfo[VehicleID]
[vVehcomp]);
cache_get_value_index_int(0, 15, VehicleInfo[VehicleID][vNumber]);
if(!VehicleInfo[VehicleID][vNumber]) SetVehicleNumberPlate(VehicleID,
"None");
else
{
static const fmt_str[] = ""RED"SA {FFFFAA}%d";
new string[sizeof(fmt_str) + 10];
format(string, sizeof(string), fmt_str, VehicleInfo[VehicleID]
[vNumber]);
SetVehicleNumberPlate(VehicleID, string);
}

VehicleInfo[VehicleID][vType] = 2;
SetVehicleHealth(VehicleID, VehicleInfo[VehicleID][vHeal]);
VehicleInfo[VehicleID][vEngine] =
VehicleInfo[VehicleID][vLights] = false;
EngineVehicle(VehicleID, false);
LightVehicle(VehicleID, false);
if(!VehicleInfo[VehicleID][vLock]) DoorVehicle(VehicleID, false);
else DoorVehicle(VehicleID, true);
++TOTALCARS;

static fmt_str[] =
"\
UPDATE `"TABLE_CARS"` SET \
`X` = '%f', \
`Y` = '%f', \
`Z` = '%f', \
`FA` = '%f' \
WHERE ID = '%i' \
";
new string[sizeof(fmt_str) + MAX_PLAYER_NAME + 100];
mysql_format(MySQL, string, sizeof(string), fmt_str
,
VehicleInfo[VehicleID][vPos][0],
VehicleInfo[VehicleID][vPos][1],
VehicleInfo[VehicleID][vPos][2],
VehicleInfo[VehicleID][vPos][3],
ID
);
mysql_tquery(MySQL, string, "", "");
return true;
}
/*============================================================================*/
void LoadFines()
{
if(!cache_num_rows()) return true;
new time = GetTickCount();
for(new idx = 0, ids = 1; idx < cache_num_rows(); ++idx, ++ids)
{
cache_get_value_index_int(idx, 0, Fine[ids][fnID]);
cache_get_value_index_int(idx, 1, Fine[ids][fnDate]);
cache_get_value_index_int(idx, 2, Fine[ids][fnSum]);
cache_get_value_index_int(idx, 3, Fine[ids][fnPID]);
cache_get_value_index_int(idx, 4, Fine[ids][fnType]);
}
printf("[Load Fines]: loading %i/%i ms", cache_num_rows(), GetTickCount() -
time);
return true;
}
/*============================================================================*/
void LoadTaxes()
{
if(!cache_num_rows()) return true;
new time = GetTickCount();
for(new i = 1; i < cache_num_fields(); i++)
{
cache_get_value_index_int(0, i, FracInfo[F_GOVERMENT][fTax][i-1]);
}
printf("[Load Taxes]: loading %i/%i ms",
(cache_num_rows()*cache_num_fields()), GetTickCount() - time);
return true;
}
/*============================================================================*/
void LoadWarehouse()
{
if(!cache_num_rows()) return true;
new time = GetTickCount();
for(new idx = 0, ids = 1; idx < cache_num_rows(); ++idx, ++ids)
{
cache_get_value_index_int(idx, 1, FracInfo[ids][fMoney]);
cache_get_value_index_int(idx, 2, FracInfo[ids][fDrugs]);
cache_get_value_index(idx, 3, FracInfo[ids][fBuff], 128);
sscanf(FracInfo[ids][fBuff], "p<,>a<i>[3]", FracInfo[ids]
[fAmmunition]);
cache_get_value_index(idx, 4, FracInfo[ids][fBuff], 128);
sscanf(FracInfo[ids][fBuff], "p<,>a<i>[13]", FracInfo[ids][fGuns]);
cache_get_value_index(idx, 5, FracInfo[ids][fBuff], 128);
sscanf(FracInfo[ids][fBuff], "p<,>a<i>[11]", FracInfo[ids][fAccess]);
switch(FracInfo[ids][fID])
{
case F_DRUGBARONS:
{
FracInfo[ids][fPickup] = CreatePickup(1239, 23, 1767.2604,
-1107.4171, 93.1306, 2);
static const fmt_str [] =
"\
����������� \n\n\
������ �� ������: $%i \n\
���������: %i \n\
Pistol \t %i �� \n\
SDPistol \t %i �� \n\
Deagle \t %i �� \n\
ShotGun \t %i �� \n\
UZI \t %i �� \n\
MP5 \t %i �� \n\
AK-47 \t %i �� \n\
M4A1 \t %i �� \n\
Rifle \t %i �� \n\
���������� \t %i �� \
";
new string[sizeof(fmt_str) + 100];
format(string, sizeof(string), fmt_str
,
FracInfo[ids][fMoney],
FracInfo[ids][fDrugs],
FracInfo[ids][fGuns][0],
FracInfo[ids][fGuns][1],
FracInfo[ids][fGuns][2],
FracInfo[ids][fGuns][3],
FracInfo[ids][fGuns][4],
FracInfo[ids][fGuns][5],
FracInfo[ids][fGuns][6],
FracInfo[ids][fGuns][7],
FracInfo[ids][fGuns][8],
FracInfo[ids][fGuns][9]
);
FracInfo[ids][fLabel] = CreateDynamic3DTextLabel(string, -
1, 1767.2604, -1107.4171, 93.1306, 5, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 2,
-1, -1, 5.0);
}
case F_COUNTERFEITERS:
{
FracInfo[ids][fPickup] = CreatePickup(1239, 23, 1767.2604,
-1107.4171, 93.1306, 4);
static const fmt_str [] =
"\
����������������� \n\n\
������ �� ������: $%i \n\
���������: %i \n\
Pistol \t %i �� \n\
SDPistol \t %i �� \n\
Deagle \t %i �� \n\
ShotGun \t %i �� \n\
UZI \t %i �� \n\
MP5 \t %i �� \n\
AK-47 \t %i �� \n\
M4A1 \t %i �� \n\
Rifle \t %i �� \n\
���������� \t %i �� \
";
new string[sizeof(fmt_str) + 100];
format(string, sizeof(string), fmt_str
,
FracInfo[ids][fMoney],
FracInfo[ids][fDrugs],
FracInfo[ids][fGuns][0],
FracInfo[ids][fGuns][1],
FracInfo[ids][fGuns][2],
FracInfo[ids][fGuns][3],
FracInfo[ids][fGuns][4],
FracInfo[ids][fGuns][5],
FracInfo[ids][fGuns][6],
FracInfo[ids][fGuns][7],
FracInfo[ids][fGuns][8],
FracInfo[ids][fGuns][9]
);
FracInfo[ids][fLabel] = CreateDynamic3DTextLabel(string, -
1, 1767.2604, -1107.4171, 93.1306, 5, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 4,
-1, -1, 5.0);
}
case F_GUNBARONS:
{
FracInfo[ids][fPickup] = CreatePickup(1239, 23, 1767.2604,
-1107.4171, 93.1306, 1);
static const fmt_str [] =
"\
��������� ������ \n\n\
������ �� ������: $%i \n\
���������: %i \n\
Pistol \t %i �� \n\
SDPistol \t %i �� \n\
Deagle \t %i �� \n\
ShotGun \t %i �� \n\
UZI \t %i �� \n\
MP5 \t %i �� \n\
AK-47 \t %i �� \n\
M4A1 \t %i �� \n\
Rifle \t %i �� \n\
���������� \t %i �� \
";
new string[sizeof(fmt_str) + 100];
format(string, sizeof(string), fmt_str
,
FracInfo[ids][fMoney],
FracInfo[ids][fDrugs],
FracInfo[ids][fGuns][0],
FracInfo[ids][fGuns][1],
FracInfo[ids][fGuns][2],
FracInfo[ids][fGuns][3],
FracInfo[ids][fGuns][4],
FracInfo[ids][fGuns][5],
FracInfo[ids][fGuns][6],
FracInfo[ids][fGuns][7],
FracInfo[ids][fGuns][8],
FracInfo[ids][fGuns][9]
);
FracInfo[ids][fLabel] = CreateDynamic3DTextLabel(string, -
1, 1767.2604, -1107.4171, 93.1306, 5, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 1,
-1, -1, 5.0);
}
}
++TOTALWAREHOUSE;
}
printf("[Load Warehouse]: loading %i/%i ms", TOTALWAREHOUSE, GetTickCount() -
time);
return true;
}
/*============================================================================*/
void LoadBizzStat(playerid)
{
if(!cache_num_rows()) return ShowPlayerDialog(playerid, D_NULL, 0,
"��������", ""LGREEN"��������� ���������� ��� �� ������������.", "��� ����", "");
new
Cash[2],
Date[16],
str[128],
strr[2048]
;
format(str, sizeof(str), ""WHITE"���� \t"WHITE"����� \t"WHITE"������ \
t"WHITE"����� \n");
strcat(strr, str);
for(new idx = 0; idx < cache_num_rows(); ++idx)
{
cache_get_value_index(idx, 1, Date, 16);
cache_get_value_index_int(idx, 2, Cash[0]);
cache_get_value_index_int(idx, 3, Cash[1]);
format(str, sizeof(str),""WHITE"%s \t"GREEN"$%i \t"GREEN"$%i \t"GREEN"$
%i \t"GREEN"$%i \n", Date, Cash[0], Cash[1], Cash[0]-Cash[1]);
strcat(strr, str);
}
ShowPlayerDialog(playerid, D_NULL, DIALOG_STYLE_TABLIST_HEADERS, "���.
����������", strr, "�������", "");
return true;
}
/*============================================================================*/
void DeleteBizzStat(i)
{
if(cache_num_rows() <= 30) return true;
static fmt_str[] = "DELETE FROM `"TABLE_STATS"` WHERE `BizzID` = '%i' LIMIT
%i";
new string[sizeof(fmt_str) + 50];
mysql_format(MySQL, string, sizeof(string), fmt_str, BizzInfo[i][bID],
cache_num_rows()-30);
mysql_tquery(MySQL, string, "", "");
return true;
}
/*============================================================================*/
void ClearText(playerid) ApplyAnimation(playerid, "PED", "facanger", 4.1, 0, 1, 1,
1, 1);
/*============================================================================*/
/*============================================================================*/
void OnPlayerFinishedRace(playerid)
{
TogglePlayerControllable(playerid, true);
RemovePlayerFromVehicle(GetPlayerCarPass(playerid));
return true;
}
/*============================================================================*/
void OnPlayerExitCar(playerid)
{
return true;
}
/*============================================================================*/
void StopEat(playerid)
{
if(GetPVarInt(playerid, "PLAYER_EAT") > 0)
{
RemovePlayerAttachedObject(playerid, 2);
DeletePVar(playerid, "PLAYER_EAT");
}
return true;
}
/*============================================================================*/
void WaitBizzWar(ID, Frac)
{
if(BizzInfo[ID][bWarTime] <= 1)
{
FracInfo[Frac][fWar][1] = true;
BizzInfo[ID][bWarTime] = 600;
BizzInfo[ID][bWarStart] = true;
KillTimer(BizzInfo[ID][bWarTimer][0]);
FracInfo[BizzInfo[ID][bFrac]][fWar][1] = true;
BizzInfo[ID][bWarTimer][1] = SetTimerEx("StartBizzWar", 1000, true,
"ii", ID, Frac);
}
else
{
BizzInfo[ID][bWarTime]--;
new
CB[30],
result[4]
;
result[0] = floatround(BizzInfo[ID][bWarTime] / (3600 * 24));
result[1] = floatround(BizzInfo[ID][bWarTime] / 3600);
result[2] = floatround((BizzInfo[ID][bWarTime] / 60) - (result[1] *
60));
result[3] = floatround(BizzInfo[ID][bWarTime] - ((result[1] * 3600) +
(result[2] * 60)));
format(CB, 30, "%02d:%02d", result[2], result[3]);
foreach(new p : Player)
{
if(PlayerInfo[p][pLogged] == false) continue;
if(PlayerInfo[p][pMember] == BizzInfo[ID][bFrac] || PlayerInfo[p]
[pMember] == Frac) PlayerTextDrawSetString(p, Capture[p][6], CB);
}
}
return true;
}
/*============================================================================*/
void StartBizzWar(ID, Frac)
{
if(BizzInfo[ID][bWarTime] <= 1)
{
if(BizzInfo[ID][bOwnerKill] == BizzInfo[ID][bOwnerDeath]) BizzInfo[ID]
[bWarTime] = 60;
else if(BizzInfo[ID][bOwnerKill] > BizzInfo[ID][bOwnerDeath])
{
foreach(new p : Player)
{
if(PlayerInfo[p][pLogged] == false) continue;
if(PlayerInfo[p][pMember] == BizzInfo[ID][bFrac] ||
PlayerInfo[p][pMember] == Frac)
{
for(new t = 0; t < 7; t++) PlayerTextDrawHide(p,
Capture[p][t]);
}
}
GangZoneDestroy(BizzGZ);
BizzInfo[ID][bWar] =
FracInfo[Frac][fWar][1] =
BizzInfo[ID][bWarStart] = false;
KillTimer(BizzInfo[ID][bWarTimer][1]);
FracInfo[BizzInfo[ID][bFrac]][fWar][1] = false;
SendFMes(Frac, c_ORANGE, "[������] ���� ���� �� ������ ���������
������!");
SendFMes(BizzInfo[ID][bFrac], c_ORANGE, "[������] ���� ����
������� ���� ������!");
for(new i = 0; i < 5; i++) SendDeathMessage(1001, 1001, 200);
}
else
{
BizzInfo[ID][bWar] =
FracInfo[Frac][fWar][1] =
BizzInfo[ID][bWarStart] = false;
KillTimer(BizzInfo[ID][bWarTimer][1]);
FracInfo[BizzInfo[ID][bFrac]][fWar][1] = false;
new Owner = BizzInfo[ID][bFrac];
BizzInfo[ID][bFrac] = Frac;
SendFMes(Frac, c_ORANGE, "[������] ���� ���� ������ ���������
������!");
SendFMes(Owner, c_ORANGE, "[������] ���� ���� �� ������ �������
���� ������!");
GangZoneDestroy(BizzGZ);
foreach(new p : Player)
{
if(PlayerInfo[p][pLogged] == false) continue;
if(PlayerInfo[p][pMember] == Owner || PlayerInfo[p]
[pMember] == Frac)
{
for(new t = 0; t < 7; t++) PlayerTextDrawHide(p,
Capture[p][t]);
}
}
SetBizzInt(ID, "Frac", BizzInfo[ID][bFrac]);
for(new i = 0; i < 5; i++) SendDeathMessage(1001, 1001, 200);
}
}
else
{
BizzInfo[ID][bWarTime]--;
new
CB[30],
result[4]
;
result[0] = floatround(BizzInfo[ID][bWarTime] / (3600 * 24));
result[1] = floatround(BizzInfo[ID][bWarTime] / 3600);
result[2] = floatround((BizzInfo[ID][bWarTime] / 60) - (result[1] *
60));
result[3] = floatround(BizzInfo[ID][bWarTime] - ((result[1] * 3600) +
(result[2] * 60)));
format(CB, 30, "%02d:%02d", result[2], result[3]);
foreach(new p : Player)
{
if(PlayerInfo[p][pLogged] == false) continue;
if(PlayerInfo[p][pMember] == BizzInfo[ID][bFrac] || PlayerInfo[p]
[pMember] == Frac) PlayerTextDrawSetString(p, Capture[p][6], CB);
}
}
return true;
}

void RespVeh(veh)
{
RepairVehicle(veh);
SetVehicleToRespawn(veh);
return true;
}

void Float:PointToPoint(Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2)
{
return
floatsqroot(floatpower(floatabs(floatsub(x2,x)),2)+floatpower(floatabs(floatsub(y2,
y)),2)+floatpower(floatabs(floatsub(z2,z)),2));
}
void Load_Texture(playerid)
{
if(++TextureCount[playerid] <= 100) TogglePlayerControllable(playerid, 0);
else
{
KillTimer(TextureTimer[playerid]);
TextureStatus[playerid] = false;
TextureCount[playerid] = 0;

TextDrawHideForPlayer(playerid, ltexture[0]);
TextDrawHideForPlayer(playerid, ltexture[1]);

TogglePlayerControllable(playerid, 1);
}
return true;
}

void @CarryLoad(playerid)
{
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid, -1, "");
SendClientMessage(playerid, -1, "");
SendClientMessage(playerid, c_LGREEN, "���������: �� ��������� ��������
�������� �����. ���������� �� ������ � ����� ��������.");
SendClientMessage(playerid, -1, "* ��������� � ��� �� ��������� ���������� ��
�����.");

SetPlayerCheckpoint(playerid, 844.8402, -600.7971, 18.4219, 3.0);


pCheckpointCarrier[playerid] = 3;
pCarrierGruz[playerid] = true;
return true;
}

void @CarryUnLoad(playerid)
{
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid, -1, "");
SendClientMessage(playerid, -1, "");
SendClientMessage(playerid, c_LGREEN, "���������: �������, ��� �����, ��� ���
�� �� �� ����������.");
SendClientMessage(playerid, -1, "* ������ �������� ������� � ����� � ��������
��� ��������.");

SetPlayerCheckpoint(playerid, 89.9514, -304.3614, 1.5781, 3.0);


pCheckpointCarrier[playerid] = 4;
pCarrierGruz[playerid] = false;
return true;
}

void @Key_Cand_Job(playerid)
{
if(pKeys[playerid] < 10)
{
if(!random(2))
{
pKeyNewJob[playerid] = 1;
TextDrawShowForPlayer(playerid, games_TD[3]);
TextDrawHideForPlayer(playerid, games_TD[2]);
}
else
{
pKeyNewJob[playerid] = 2;
TextDrawShowForPlayer(playerid, games_TD[2]);
TextDrawHideForPlayer(playerid, games_TD[3]);
}
pProverka[playerid] = true;
pKeyTime[playerid] = 4;

TextDrawShowForPlayer(playerid, games_TD[0]);
TextDrawShowForPlayer(playerid, games_TD[1]);
TextDrawHideForPlayer(playerid, games_TD[4]);
TextDrawHideForPlayer(playerid, games_TD[5]);

ApplyAnimation(playerid, "PED", "facanger", 4.1, 0, 1, 1, 1, 1);

}
if(pKeys[playerid] == 10)
{
TogglePlayerControllable(playerid, 1);
ClearAnimations(playerid);
DeletePVar(playerid, "PLAYER_ANIM");
pKeyTime[playerid] = 0;
SendClientMessage(playerid, c_LGREEN, "����������: �������, �� �������
�����������. ��������� � �����.");

TextDrawHideForPlayer(playerid, games_TD[0]);
TextDrawHideForPlayer(playerid, games_TD[1]);
TextDrawHideForPlayer(playerid, games_TD[2]);
TextDrawHideForPlayer(playerid, games_TD[3]);
TextDrawHideForPlayer(playerid, games_TD[4]);
PlayerTextDrawHide(playerid, games_PTD[playerid]);

PlayerTextDrawTextSize(playerid, games_PTD[playerid], 0.0, 19.0);


CheckCountGames[playerid] = 0;

pKeyNewJob[playerid] = 0;
pProverka[playerid] = false;

switch(WorkCar[playerid])
{
case 1: carjob[playerid] = CreateVehicle(552, 844.8406, -
598.0186, 18.3489, 0.5335, 6, 6, 3600);
case 2: carjob[playerid] = CreateVehicle(552, 767.0701, -
1025.0715, 23.8209, 179.7262, 6, 6, 3600);
case 3: carjob[playerid] = CreateVehicle(552, 634.1910, -
554.9521, 16.0630, 180.6239, 6, 6, 3600);
case 4: carjob[playerid] = CreateVehicle(552, 2377.5620, -
1936.2455, 13.1933, 358.3608, 6, 6, 3600);
case 5: carjob[playerid] = CreateVehicle(552, 2181.1926, -
1181.9252, 23.9747, 359.8715, 6, 6, 3600);
case 6: carjob[playerid] = CreateVehicle(552, 2300.5850, -6.4009,
26.1307, 1.3176, 6, 6, 3600);
case 7: carjob[playerid] = CreateVehicle(552, 1321.7422,
335.3309, 19.1267, 153.7530, 6, 6, 3600);
case 8: carjob[playerid] = CreateVehicle(552, 1217.3572,
317.7867, 19.2025, 335.8958, 6, 6, 3600);
case 9: carjob[playerid] = CreateVehicle(552, 248.6692, -
158.0019, 1.2213, 92.2411, 6, 6, 3600);
case 10: carjob[playerid] = CreateVehicle(552, 1359.1238, -
620.3018, 108.7806, 16.5265, 6, 6, 3600);
}
SetVehicleNumberPlate(carjob[playerid], "service");
SetCameraBehindPlayer(playerid);
pNewJob[playerid] = 3;
PutPlayerInVehicle(playerid, carjob[playerid], 0);
VehicleInfo[carjob[playerid]][vFuel] =
TransInfo[GetVehicleModel(carjob[playerid])-399][trTank];
VehicleInfo[carjob[playerid]][vEngine] = false;
EngineVehicle(carjob[playerid], false, playerid);

carID[carjob[playerid]] = playerid;
SetPlayerCheckpoint(playerid, 848.2407, -1292.9423, 13.6000, 3.0);
}
return true;
}
void @Job_Table(playerid)
{
ClearAnimations(playerid);
TogglePlayerControllable(playerid, 1);

RemovePlayerAttachedObject(playerid, 0);
RemovePlayerAttachedObject(playerid, 1);

DestroyObject(PlantObject[playerid]);
PlantObject[playerid] = -1;

new Model = FactoryWorkWeapon[random(sizeof(FactoryWorkWeapon))];


SetPlayerAttachedObject(playerid, 2, Model, 6);

switch(WorkMesto[playerid])
{
case 1: SetPlayerCheckpoint(playerid, 979.9899, 2240.1392, 10.9769,
1.0);
case 2: SetPlayerCheckpoint(playerid, 979.9092, 2236.9351, 11.1519,
1.0);
case 3: SetPlayerCheckpoint(playerid, 980.1075, 2235.8433, 11.1519,
1.0);
case 4: SetPlayerCheckpoint(playerid, 979.9623, 2232.7266, 11.1519,
1.0);
case 5: SetPlayerCheckpoint(playerid, 980.0178, 2231.6238, 11.1519,
1.0);
case 6: SetPlayerCheckpoint(playerid, 979.9091, 2228.6201, 10.9769,
1.0);
case 7: SetPlayerCheckpoint(playerid, 980.0866, 2227.5237, 11.1519,
1.0);
case 8: SetPlayerCheckpoint(playerid, 979.9557, 2224.5750, 10.9769,
1.0);
}
SendClientMessage(playerid, c_LGREEN, "����������: �� �������� ����������
�������. ������ ������ �� ���� ������ �������� �� ����� ������ �����.");
return true;
}
void @Key_Job(playerid)
{
if(pKeys[playerid] < 10)
{
if(!random(2))
{
pKeyJob[playerid] = 1;
TextDrawShowForPlayer(playerid, games_TD[3]);
TextDrawHideForPlayer(playerid, games_TD[2]);
}
else
{
pKeyJob[playerid] = 2;
TextDrawShowForPlayer(playerid, games_TD[2]);
TextDrawHideForPlayer(playerid, games_TD[3]);
}
pProverka[playerid] = true;
pKeyTime[playerid] = 4;

TextDrawShowForPlayer(playerid, games_TD[0]);
TextDrawShowForPlayer(playerid, games_TD[1]);
TextDrawHideForPlayer(playerid, games_TD[4]);
TextDrawHideForPlayer(playerid, games_TD[5]);

ApplyAnimation(playerid, "PED", "facanger", 4.1, 0, 1, 1, 1, 1);


}
if(pKeys[playerid] == 10)
{
TogglePlayerControllable(playerid, 1);

ApplyAnimation(playerid, "PED", "facanger", 4.1, 0, 1, 1, 1, 1);


SetPlayerCheckpoint(playerid, 991.8133, 2218.1445, 10.9769, 1.5);
SendClientMessage(playerid, c_LGREEN, "����������: ����� ����� ������,
������ ������ ��� �� �����.");

TextDrawHideForPlayer(playerid, games_TD[0]);
TextDrawHideForPlayer(playerid, games_TD[1]);
TextDrawHideForPlayer(playerid, games_TD[2]);
TextDrawHideForPlayer(playerid, games_TD[3]);
TextDrawHideForPlayer(playerid, games_TD[4]);

PlayerTextDrawTextSize(playerid, games_PTD[playerid], 0.0, 19.0);


CheckCountGames[playerid] = 0;
PlayerTextDrawHide(playerid, games_PTD[playerid]);

pKeyJob[playerid] =
pKeyTime[playerid] = 0;
Workpiece[playerid] = 3;

pProverka[playerid] = false;
}
return true;
}

/*void @Update_Speed(playerid, carid)


{
if(!CarSPD(GetVehicleModel(carid)))
{
new
Str[16],
SPD = GetSpeed(playerid)
;
new Float: size = 0.0;
if(GetSpeed(playerid) < 221)
{
for(new i; i < GetSpeed(playerid); i ++) size += 0.588;
}
else size = 130.0915;
PlayerTextDrawTextSize(playerid, TD_Speed[playerid][2], size, 14.0000);
PlayerTextDrawShow(playerid, TD_Speed[playerid][2]);
format(Str, sizeof(Str), "%i (km/h)", SPD);
PlayerTextDrawSetString(playerid, TD_Speed[playerid][7], Str);
}
return true;
}*/

void HideInfoForPlayer(playerid)
{
PlayerTextDrawHide(playerid, InfoText[playerid]);
TextDrawHideForPlayer(playerid, PressH[0]);
TextDrawHideForPlayer(playerid, PressH[1]);
TextDrawHideForPlayer(playerid, PressH[2]);
return true;
}

void checkStatOffline(playerid)
{
new rows; cache_get_row_count(rows);
if(!rows) return SendClientMessage(playerid, c_ARGON, "������� �� ������.");
else
{
new
name[MAX_PLAYER_NAME],
p_id,
p_lvl,
p_money,
p_bank,
p_donate,
p_warn,
p_jail,
p_mute
;
cache_get_value_name_int(0, "ID", p_id);
cache_get_value_name(0, "Name", name, MAX_PLAYER_NAME);
cache_get_value_name_int(0, "Level", p_lvl);
cache_get_value_name_int(0, "Cash", p_money);
cache_get_value_name_int(0, "Bank", p_bank);
cache_get_value_name_int(0, "Coin", p_donate);
cache_get_value_name_int(0, "Warn", p_warn);
cache_get_value_name_int(0, "JailTime", p_jail);
cache_get_value_name_int(0, "Mute", p_mute);

static const fmt_str_1[] =


"\
"WHITE"ID �������� � ���� ������: %i \n\
���: %s \n\
�������: %i \n\n\
��������: %i$ \n\
���������� ���: %i$ \n\
����� ���: %i \n\n\
�������������: %i / 3 \n\
�����: %i ����� \n\
��� ����: %i ����� \
";
new string_1[sizeof(fmt_str_1) + 10 + MAX_PLAYER_NAME + 4 + 11 + 11 +
10 + 2 + 10 + 10];
format(string_1, sizeof(string_1), fmt_str_1, p_id, name, p_lvl,
p_money, p_bank, p_donate, p_warn, p_jail, p_mute);
ShowPlayerDialog(playerid, D_NULL, 0, "������� ���������� ������",
string_1, "��� ����","");
}
return true;
}

void PromoCheck(playerid, code[])


{
new rows; cache_get_row_count(rows);
if(!rows)
{
static const fmt_str [] = "�������� %s �� ����������!";
new string[sizeof(fmt_str) + 24];
format(string, sizeof(string), fmt_str, code);
SendClientMessage(playerid, c_ARGON, string);
return true;
}
else
{
new promo_ID, promo_Name[24], promo_Use;
cache_get_value_name_int(0, "ID", promo_ID);
cache_get_value_name(0, "PromoName", promo_Name, 24);
cache_get_value_name_int(0, "p_Use", promo_Use);

promo_Use++;
strmid(PlayerInfo[playerid][pPromo], code, 0, strlen(code), 24);
SetPlayerStr(GetName(playerid), "Promo", code);

GiveMoney(playerid, 50000);
GiveDonate(playerid, 20);

static const fmt_str [] = "�� ������� ����� �������� "LGREEN"%s


"ARGON"� �������� "LGREEN"50.000$, 20 M-Coins",
fmt_str_1 [] = "UPDATE `promo` SET `p_Use` = '%d' WHERE `NamePromo` =
'%s'";

new
string[sizeof(fmt_str) + 24],
string_1[sizeof(fmt_str_1) + 24 + 5]
;

format(string, sizeof(string), fmt_str, code);


format(string_1, sizeof(string_1), fmt_str_1, promo_Use, code);

SendClientMessage(playerid, c_ARGON, string);


mysql_tquery(MySQL, string_1, "", "");
}
return true;
}

void PromoCreate(playerid, code[])


{
new rows; cache_get_row_count(rows);
if(rows)
{
static const fmt_str [] = "�������� %s ��� ����������!";
new string[sizeof(fmt_str) + 24];
format(string, sizeof(string), fmt_str, code);
SendClientMessage(playerid, -1, string);
return true;
}

TOTALPROMO++;
static const fmt_str [] = "[ADMIN]: ������������� %s ������ �������� %s[ID:
%i]";
new string[sizeof(fmt_str) + 5 + 24];
format(string, sizeof(string), fmt_str, GetName(playerid), code, TOTALPROMO);
SendAdminMessage(c_LGREEN, string);

static fmt_str_4[] =
"\
INSERT INTO `"TABLE_PROMO"` \
(ID, \
NamePromo, \
p_Use) \
VALUES \
(%d, \
'%s', \
0) \
";
new string_4[sizeof(fmt_str_4) + 5 + 24];
mysql_format(MySQL, string_4, sizeof(string_4), fmt_str_4, TOTALPROMO, code);
mysql_tquery(MySQL, string_4, "", "");
return true;
}

void PromoDelete(playerid, code[])


{
new rows; cache_get_row_count(rows);
if(!rows)
{
static const fmt_str [] = "�������� %s �� ����������!";
new string[sizeof(fmt_str) + 24];
format(string, sizeof(string), fmt_str, code);
SendClientMessage(playerid, -1, string);
return true;
}

TOTALPROMO--;
static const fmt_str [] = "[ADMIN]: ������������� %s ������ �������� %s[ID:
%i]";
new string[sizeof(fmt_str) + 5 + 24];
format(string, sizeof(string), fmt_str, GetName(playerid), code, TOTALPROMO);
SendAdminMessage(c_LGREEN, string);

static fmt_str_2 [] = "DELETE FROM `"TABLE_PROMO"` WHERE `NamePromo` = '%s'


LIMIT 1";
new string_2[sizeof(fmt_str_2) + MAX_PLAYER_NAME];
mysql_format(MySQL, string_2, sizeof(string_2), fmt_str_2, code);
mysql_tquery(MySQL, string_2, "", "");
return true;
}
/*void SecTimer()
{
gettime(gTime[0], gTime[1], gTime[2]);
if(!gTime[0] && !gTime[1] && !gTime[2]) reset_admins_stat();

return true;
}*/

You might also like