16.09.2018, 19:12
(
Последний раз редактировалось Varg; 16.09.2018 в 20:17.
)
PHP код:
public OnPlayerConnect(playerid)
{
if (IsPlayerNPC(playerid))
return 1;
if ((GetTickCount() - PlayerData[playerid][pLeaveTime]) < 2000 && !strcmp(ReturnIP(playerid), PlayerData[playerid][pLeaveIP]))
{
SendAdminAlert(COLOR_LIGHTRED, "[ADMIN]: %s (%s) was kicked for possible rejoin hacks.", ReturnName(playerid), ReturnIP(playerid));
Kick(playerid);
return 1;
}
new
str[128];
ResetPlayerWeapons(playerid);
SetPlayerArmedWeapon(playerid, 0);
PreloadAnimations(playerid);
if (g_ServerRestart) {
TextDrawShowForPlayer(playerid, gServerTextdraws[3]);
}
for (new i = 0; i != MAX_PLAYER_ATTACHED_OBJECTS; i ++) {
RemovePlayerAttachedObject(playerid, i);
}
// Gas pumps
RemoveBuildingForPlayer(playerid, 1676, 1941.6563, -1767.2891, 14.1406, 6000.00);
RemoveBuildingForPlayer(playerid, 3465, 2120.8203, 914.7188, 11.2578, 6000.00);
RemoveBuildingForPlayer(playerid, 1686, -1610.6172, -2721.0000, 47.9297, 6000.00);
// LS mall
RemoveBuildingForPlayer(playerid, 6130, 1117.5859, -1490.0078, 32.7188, 10.0);
RemoveBuildingForPlayer(playerid, 6255, 1117.5859, -1490.0078, 32.7188, 10.0);
RemoveBuildingForPlayer(playerid, 762, 1175.3594, -1420.1875, 19.8828, 0.25);
RemoveBuildingForPlayer(playerid, 615, 1166.3516, -1417.6953, 13.9531, 0.25);
// Sprunk machines
RemoveBuildingForPlayer(playerid, 1302, 0.0, 0.0, 0.0, 6000.0);
RemoveBuildingForPlayer(playerid, 1209, 0.0, 0.0, 0.0, 6000.0);
RemoveBuildingForPlayer(playerid, 955, 0.0, 0.0, 0.0, 6000.0);
RemoveBuildingForPlayer(playerid, 956, 0.0, 0.0, 0.0, 6000.0);
RemoveBuildingForPlayer(playerid, 1775, 0.0, 0.0, 0.0, 6000.0);
RemoveBuildingForPlayer(playerid, 1776, 0.0, 0.0, 0.0, 6000.0);
RemoveBuildingForPlayer(playerid, 1977, 0.0, 0.0, 0.0, 6000.0);
// Fire station
RemoveBuildingForPlayer(playerid, 717, 1703.9922, -1150.1484, 23.0938, 0.25);
RemoveBuildingForPlayer(playerid, 717, 1721.2344, -1150.1484, 23.0938, 0.25);
RemoveBuildingForPlayer(playerid, 1300, 1715.4922, -1037.9766, 23.2656, 0.25);
RemoveBuildingForPlayer(playerid, 1294, 1734.9531, -1156.9922, 27.3516, 0.25);
RemoveBuildingForPlayer(playerid, 717, 1738.7813, -1150.1484, 23.0938, 0.25);
RemoveBuildingForPlayer(playerid, 1227, 1789.7734, -1116.0625, 23.8906, 0.25);
RemoveBuildingForPlayer(playerid, 1227, 1789.9063, -1112.6406, 23.8906, 0.25);
RemoveBuildingForPlayer(playerid, 717, 1726.0000, -1064.8828, 23.1563, 0.25);
RemoveBuildingForPlayer(playerid, 4640, 1728.7891, -1065.0938, 24.5000, 0.25);
RemoveBuildingForPlayer(playerid, 1300, 1730.6328, -1033.6719, 23.2656, 0.25);
RemoveBuildingForPlayer(playerid, 4598, 1737.2031, -1052.8203, 23.3359, 0.25);
RemoveBuildingForPlayer(playerid, 4599, 1738.1875, -1044.9922, 22.9844, 0.25);
RemoveBuildingForPlayer(playerid, 1300, 1747.8594, -1063.2969, 23.2656, 0.25);
RemoveBuildingForPlayer(playerid, 717, 1758.3828, -1066.3594, 23.1797, 0.25);
RemoveBuildingForPlayer(playerid, 1300, 1758.0781, -1064.5547, 23.2656, 0.25);
RemoveBuildingForPlayer(playerid, 717, 1765.1563, -1042.5234, 23.1797, 0.25);
RemoveBuildingForPlayer(playerid, 1300, 1764.8594, -1040.7188, 23.2656, 0.25);
RemoveBuildingForPlayer(playerid, 4641, 1788.5391, -1026.3516, 24.5000, 0.25);
// Prison exterior
RemoveBuildingForPlayer(playerid, 3682, 247.9297, 1461.8594, 33.4141, 0.25);
RemoveBuildingForPlayer(playerid, 3682, 192.2734, 1456.1250, 33.4141, 0.25);
RemoveBuildingForPlayer(playerid, 3682, 199.7578, 1397.8828, 33.4141, 0.25);
RemoveBuildingForPlayer(playerid, 3683, 133.7422, 1356.9922, 17.0938, 0.25);
RemoveBuildingForPlayer(playerid, 3683, 166.7891, 1356.9922, 17.0938, 0.25);
RemoveBuildingForPlayer(playerid, 3683, 166.7891, 1392.1563, 17.0938, 0.25);
RemoveBuildingForPlayer(playerid, 3683, 133.7422, 1392.1563, 17.0938, 0.25);
RemoveBuildingForPlayer(playerid, 3683, 166.7891, 1426.9141, 17.0938, 0.25);
RemoveBuildingForPlayer(playerid, 3683, 133.7422, 1426.9141, 17.0938, 0.25);
RemoveBuildingForPlayer(playerid, 3288, 221.5703, 1374.9688, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3289, 212.0781, 1426.0313, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3290, 218.2578, 1467.5391, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3291, 246.5625, 1435.1953, 9.6875, 0.25);
RemoveBuildingForPlayer(playerid, 3291, 246.5625, 1410.5391, 9.6875, 0.25);
RemoveBuildingForPlayer(playerid, 3291, 246.5625, 1385.8906, 9.6875, 0.25);
RemoveBuildingForPlayer(playerid, 3291, 246.5625, 1361.2422, 9.6875, 0.25);
RemoveBuildingForPlayer(playerid, 3290, 190.9141, 1371.7734, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3289, 183.7422, 1444.8672, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3289, 222.5078, 1444.6953, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3289, 221.1797, 1390.2969, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3288, 223.1797, 1421.1875, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3683, 133.7422, 1459.6406, 17.0938, 0.25);
RemoveBuildingForPlayer(playerid, 3289, 207.5391, 1371.2422, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3424, 220.6484, 1355.1875, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3424, 221.7031, 1404.5078, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3424, 210.4141, 1444.8438, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3424, 262.5078, 1465.2031, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3259, 220.6484, 1355.1875, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3636, 133.7422, 1356.9922, 17.0938, 0.25);
RemoveBuildingForPlayer(playerid, 3636, 166.7891, 1356.9922, 17.0938, 0.25);
RemoveBuildingForPlayer(playerid, 3256, 190.9141, 1371.7734, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3636, 166.7891, 1392.1563, 17.0938, 0.25);
RemoveBuildingForPlayer(playerid, 3636, 133.7422, 1392.1563, 17.0938, 0.25);
RemoveBuildingForPlayer(playerid, 3258, 207.5391, 1371.2422, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 205.6484, 1394.1328, 10.1172, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 205.6484, 1392.1563, 16.2969, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 205.6484, 1394.1328, 23.7813, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 207.3594, 1390.5703, 19.1484, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 206.5078, 1387.8516, 27.4922, 0.25);
RemoveBuildingForPlayer(playerid, 3673, 199.7578, 1397.8828, 33.4141, 0.25);
RemoveBuildingForPlayer(playerid, 3257, 221.5703, 1374.9688, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3258, 221.1797, 1390.2969, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 203.9531, 1409.9141, 16.2969, 0.25);
RemoveBuildingForPlayer(playerid, 3674, 199.3828, 1407.1172, 35.8984, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 204.6406, 1409.8516, 11.4063, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 206.5078, 1404.2344, 18.2969, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 206.5078, 1400.6563, 22.4688, 0.25);
RemoveBuildingForPlayer(playerid, 3259, 221.7031, 1404.5078, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 207.3594, 1409.0000, 19.7578, 0.25);
RemoveBuildingForPlayer(playerid, 3257, 223.1797, 1421.1875, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3258, 212.0781, 1426.0313, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3636, 166.7891, 1426.9141, 17.0938, 0.25);
RemoveBuildingForPlayer(playerid, 3636, 133.7422, 1426.9141, 17.0938, 0.25);
RemoveBuildingForPlayer(playerid, 3255, 246.5625, 1361.2422, 9.6875, 0.25);
RemoveBuildingForPlayer(playerid, 3255, 246.5625, 1385.8906, 9.6875, 0.25);
RemoveBuildingForPlayer(playerid, 3255, 246.5625, 1410.5391, 9.6875, 0.25);
RemoveBuildingForPlayer(playerid, 3258, 183.7422, 1444.8672, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3259, 210.4141, 1444.8438, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3258, 222.5078, 1444.6953, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 16086, 232.2891, 1434.4844, 13.5000, 0.25);
RemoveBuildingForPlayer(playerid, 3673, 192.2734, 1456.1250, 33.4141, 0.25);
RemoveBuildingForPlayer(playerid, 3674, 183.0391, 1455.7500, 35.8984, 0.25);
RemoveBuildingForPlayer(playerid, 3636, 133.7422, 1459.6406, 17.0938, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 196.0234, 1462.0156, 10.1172, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 198.0000, 1462.0156, 16.2969, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 196.0234, 1462.0156, 23.7813, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 180.2422, 1460.3203, 16.2969, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 180.3047, 1461.0078, 11.4063, 0.25);
RemoveBuildingForPlayer(playerid, 3256, 218.2578, 1467.5391, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 199.5859, 1463.7266, 19.1484, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 181.1563, 1463.7266, 19.7578, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 185.9219, 1462.8750, 18.2969, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 202.3047, 1462.8750, 27.4922, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 189.5000, 1462.8750, 22.4688, 0.25);
RemoveBuildingForPlayer(playerid, 3255, 246.5625, 1435.1953, 9.6875, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 254.6797, 1451.8281, 27.4922, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 253.8203, 1458.1094, 23.7813, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 255.5313, 1454.5469, 19.1484, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 253.8203, 1456.1328, 16.2969, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 253.8203, 1458.1094, 10.1172, 0.25);
RemoveBuildingForPlayer(playerid, 3259, 262.5078, 1465.2031, 9.5859, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 254.6797, 1468.2109, 18.2969, 0.25);
RemoveBuildingForPlayer(playerid, 3673, 247.9297, 1461.8594, 33.4141, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 254.6797, 1464.6328, 22.4688, 0.25);
RemoveBuildingForPlayer(playerid, 3674, 247.5547, 1471.0938, 35.8984, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 255.5313, 1472.9766, 19.7578, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 252.8125, 1473.8281, 11.4063, 0.25);
RemoveBuildingForPlayer(playerid, 3675, 252.1250, 1473.8906, 16.2969, 0.25);
RemoveBuildingForPlayer(playerid, 16089, 342.1250, 1431.0938, 5.2734, 0.25);
RemoveBuildingForPlayer(playerid, 16090, 315.7734, 1431.0938, 5.2734, 0.25);
RemoveBuildingForPlayer(playerid, 16091, 289.7422, 1431.0938, 5.2734, 0.25);
RemoveBuildingForPlayer(playerid, 16087, 358.6797, 1430.4531, 11.6172, 0.25);
RemoveBuildingForPlayer(playerid, 16088, 368.4297, 1431.0938, 5.2734, 0.25);
RemoveBuildingForPlayer(playerid, 16092, 394.1563, 1431.0938, 5.2734, 0.25);
CancelSelectTextDraw(playerid);
GetPlayerIp(playerid, PlayerData[playerid][pIP], 16);
GetPlayerName(playerid, PlayerData[playerid][pUsername], MAX_PLAYER_NAME + 1);
ResetStatistics(playerid);
CreateTextDraws(playerid);
format(str, sizeof(str), "SELECT * FROM `blacklist` WHERE `Username` = '%s' OR `IP` = '%s'", ReturnName(playerid), PlayerData[playerid][pIP]);
mysql_tquery(g_iHandle, str, "OnQueryFinished", "dd", playerid, THREAD_BAN_LOOKUP);
return 1;
}
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
PlayerData[playerid][pLeaveTime] = GetTickCount();
format(PlayerData[playerid][pLeaveIP], 16, PlayerData[playerid][pIP]);
TerminateConnection(playerid);
return 1;
}
PHP код:
stock TerminateConnection(playerid)
{
if (BoomboxData[playerid][boomboxPlaced])
Boombox_Destroy(playerid);
if (PlayerData[playerid][pRangeBooth] != -1)
Booth_Leave(playerid);
if (PlayerData[playerid][pFirstAid])
KillTimer(PlayerData[playerid][pAidTimer]);
if (PlayerData[playerid][pDrivingTest])
DestroyVehicle(PlayerData[playerid][pTestCar]);
if (PlayerData[playerid][pShowFooter])
KillTimer(PlayerData[playerid][pFooterTimer]);
if (PlayerData[playerid][pTaxiPlayer] != INVALID_PLAYER_ID)
LeaveTaxi(playerid, PlayerData[playerid][pTaxiPlayer]);
if (PlayerData[playerid][pDragged])
KillTimer(PlayerData[playerid][pDragTimer]);
if (PlayerData[playerid][pFreeze])
KillTimer(PlayerData[playerid][pFreezeTimer]);
foreach (new i : Player)
{
if (PlayerData[i][pLastShot] == playerid) {
PlayerData[i][pLastShot] = INVALID_PLAYER_ID;
}
if (PlayerData[i][pHouseSeller] == playerid) {
PlayerData[i][pHouseSeller] = INVALID_PLAYER_ID;
PlayerData[i][pHouseOffered] = -1;
}
if (PlayerData[i][pBusinessSeller] == playerid) {
PlayerData[i][pBusinessSeller] = INVALID_PLAYER_ID;
PlayerData[i][pBusinessOffered] = -1;
}
if (PlayerData[i][pCarSeller] == playerid) {
PlayerData[i][pCarSeller] = INVALID_PLAYER_ID;
PlayerData[i][pCarOffered] = -1;
}
if (PlayerData[i][pShakeOffer] == playerid) {
PlayerData[i][pShakeOffer] = INVALID_PLAYER_ID;
PlayerData[i][pShakeType] = 0;
}
if (PlayerData[i][pFriskOffer] == playerid) {
PlayerData[i][pFriskOffer] = INVALID_PLAYER_ID;
}
if (PlayerData[i][pFoodSeller] == playerid) {
PlayerData[i][pFoodSeller] = INVALID_PLAYER_ID;
PlayerData[i][pFoodType] = 0;
}
if (PlayerData[i][pFactionOffer] == playerid) {
PlayerData[i][pFactionOffer] = INVALID_PLAYER_ID;
PlayerData[i][pFactionOffered] = -1;
}
if (PlayerData[i][pDraggedBy] == playerid) {
KillTimer(PlayerData[i][pDragTimer]);
PlayerData[i][pDragged] = 0;
PlayerData[i][pDraggedBy] = INVALID_PLAYER_ID;
}
if (PlayerData[i][pMDCPlayer] == playerid) {
PlayerData[i][pMDCPlayer] = INVALID_PLAYER_ID;
PlayerData[i][pTrackTime] = 0;
}
if (PlayerData[i][pNewsGuest] == playerid) {
PlayerData[i][pNewsGuest] = INVALID_PLAYER_ID;
}
if (PlayerData[i][pGiveItem] == playerid) {
PlayerData[i][pGiveItem] = INVALID_PLAYER_ID;
}
if (PlayerData[i][pTakeItems] == playerid) {
PlayerData[i][pTakeItems] = INVALID_PLAYER_ID;
}
}
SQL_SaveCharacter(playerid);
ResetNameTag(playerid);
Report_Clear(playerid);
ResetStatistics(playerid);
return 1;
}