02.02.2016, 00:08
I have a filterscript called oupdates. I have it in server.cfg, everything good. I compile the script and get no warnings or errors. However as soon as I launch samp-server.exe.
It loads, but then for whatever reason it gets unloaded?
Here is the code of the whole filterscript.
Ask always who ever helps gets +1 Rep.
Thanks for your time.
Код:
[14:05:03] [14:05:03] Filterscripts [14:05:03] --------------- [14:05:03] Loading filterscript 'oupdates.amx'... [14:05:03] OnFilter [14:05:03] Loaded 1 filterscripts. [14:05:03] SSCANF2 Loaded [14:05:04] Filterscript 'oupdates.amx' load failed. [14:05:04] SSCANF2 Loaded [14:05:04] Number of vehicle models: 132
Here is the code of the whole filterscript.
PHP код:
#include <a_samp>
#include <Dini>
#include <utils>
#include <vehicles>
#include <zcmd>
#define gates 10
#define sapd 1
#define agency 7
#define army 3
new gateids[gates][2];
new gateopen[gates];
new gatetype[18];
new s1, s2;
//new p1;
new v1, v2, v3, v4, v5, v6, v7, v8;
new gtimer;
forward org_gatesF();
public OnFilterScriptInit()
{
gateids[0][0] = CreateObject(2927, 215.941, 1874.571, 13.903, 0.0, 0.0, 0.0); // army
gateids[0][1] = army;
gateids[1][0] = CreateObject(2929, 211.842, 1874.571, 13.903, 0.0, 0.0, 0.0); // army
gateids[1][1] = army;
gateids[2][0] = CreateObject(19313, 134.912, 1941.522, 21.775, 0.0, 0.0, 0.0); // army
gateids[2][1] = army;
gateids[3][0] = CreateObject(19313, 285.990, 1822.312, 20.095, 0.0, 0.0, 270.0); // army
gateids[3][1] = army;
gateids[4][0] = CreateObject(2951, 268.66, 1864.059, 7.5, 0.0, 0.0, 0.0); // army
gateids[4][1] = army;
gateids[5][0] = CreateObject(3055, 2293.83, 2498.804, 4.4414, 0.0, 0.0, 90.0); // sapd
gateids[5][1] = sapd;
gateids[6][0] = CreateObject(3055, 2335.178, 2443.621, 6.9743, 0.0, 0.0, 59.9993); // sapd
gateids[6][1] = sapd;
gateids[7][0] = CreateObject(985, 2497.4063, 2777.0703, 11.5313, 0.0, 0.0, 90.0); // agency
gateids[7][1] = agency;
gateids[8][0] = CreateObject(986, 2497.4063, 2769.1094, 11.5313, 0.0, 0.0, 90.0); // agency
gateids[8][1] = agency;
gateids[9][0] = CreateObject(3055, 1588.503, -1637.872, 14.5641, 0.0, 0.0, 0.0); // sapd
gateids[9][1] = sapd;
new string[64];
for (new i = 1, d = dini_Int("orgfiles/O/orgstats.ini", "max_org"); i <= d; i++)
{
format(string, 64, "orgfiles/O/ORG%d.ini", i);
if (!dini_Exists(string)) continue;
gatetype[i-1] = dini_Int(string, "gatetype");
}
s1 = CreateObject(1500, 2293.817, 2494.451, 2.360, 0.0, 0.0, 270.0); // sapd
s2 = CreateObject(1500, 1584.140, -1637.850, 12.483, 0.0, 0.0, 180.0); // sapd
// p1 = CreatePickup(356, 19, 2545.418, -1300.735, 1031.421, 255-orgid); // orgid
v1 = CreateVehicle2(435, 1062.8109, 1298.1058, 11.4588, 270.0000, 400);
v2 = CreateVehicle2(435, 1062.8109, 1288.1058, 11.4403, 270.0000, 400);
v3 = CreateVehicle2(435, 1062.8109, 1278.1058, 11.9663, 270.0000, 400);
v4 = CreateVehicle2(435, 1062.8109, 1268.1058, 11.9642, 270.0000, 400);
v5 = CreateVehicle2(435, 1062.8109, 1258.1058, 11.4588, 270.0000, 400);
v6 = CreateVehicle2(435, 1062.8109, 1248.1058, 11.4403, 270.0000, 400);
v7 = CreateVehicle2(435, 1062.8109, 1238.1058, 11.9663, 270.0000, 400);
v8 = CreateVehicle2(435, 1062.8109, 1228.1058, 11.9642, 270.0000, 400);
gtimer = SetTimer("org_gatesF", 500, 1);
return 1;
}
public OnFilterScriptExit()
{
DestroyObject(gateids[0][0]);
DestroyObject(gateids[1][0]);
DestroyObject(gateids[2][0]);
DestroyObject(gateids[3][0]);
DestroyObject(gateids[4][0]);
DestroyObject(gateids[5][0]);
DestroyObject(gateids[6][0]);
DestroyObject(gateids[7][0]);
DestroyObject(gateids[8][0]);
DestroyObject(gateids[9][0]);
DestroyObject(s1);
DestroyObject(s2);
// DestroyPickup(p1);
DestroyVehicle2(v1);
DestroyVehicle2(v2);
DestroyVehicle2(v3);
DestroyVehicle2(v4);
DestroyVehicle2(v5);
DestroyVehicle2(v6);
DestroyVehicle2(v7);
DestroyVehicle2(v8);
KillTimer(gtimer);
return 1;
}
/*
new weapslots2[] = {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, 10, 10, 8, 8, 8, 0, 0, 0, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 4, 6, 6, 7, 7, 7, 7, 8, 12, 9, 9, 9, 11, 11, 11};
GivePlayerWeapon3(playerid, weaponid, ammo)
{
new w, a;
GetPlayerWeaponData(playerid, weapslots2[weaponid], w, a);
GivePlayerWeapon(playerid, weaponid, a + ammo > 9999 && ((weapslots2[weaponid] != 2 && weapslots2[weaponid] != 6 && weapslots2[weaponid] != 7 && weapslots2[weaponid] != 8 && weapslots2[weaponid] != 9) || weaponid == w) ? 9999 - a : ammo);
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if (pickupid == p1)
{
GivePlayerWeapon3(playerid, 31, 500);
}
return 1;
}
*/
public org_gatesF()
{
for (new i = 0; i < PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
new tvar, Float:z;
for (new g = 0; g < gates; g++)
{
tvar = 0;
if (g == 1 || g == 8 || gatetype[gateids[g][1]-1] != 1) continue;
if (GetPlayerState(i) == PLAYER_STATE_SPECTATING || GetPVarInt(i, "playerorg") != gateids[g][1]) continue;
GetPlayerPos(i, z, z, z);
if (g == 0)
{
if (IsPlayerInAreaEx(i, 207.994, 1891.140, 219.605, 1891.136, 217.563, 1875.891, 217.563, 1865.891, 210.236, 1865.954, 210.236, 1875.954) && (z >= 12.141 && z <= 16.641))
{
if (gateopen[g] == 0)
{
StopObject(gateids[g][0]);
StopObject(gateids[1][0]);
MoveObject(gateids[g][0], 219.941, 1874.571, 13.903, 1.0);
MoveObject(gateids[1][0], 207.842, 1874.571, 13.903, 1.0);
gateopen[g] = 1;
}
tvar ++;
}
}
else if (g == 2)
{
if (IsPlayerInAreaEx(i, 141.889, 1925.978, 141.889, 1955.978, 128.329, 1955.978, 128.329, 1925.978) && (z >= 18.312 && z <= 23.312))
{
if (gateopen[g] == 0)
{
StopObject(gateids[g][0]);
MoveObject(gateids[g][0], 123.412, 1941.522, 21.775, 1.7);
gateopen[g] = 1;
}
tvar ++;
}
}
else if (g == 3)
{
if (IsPlayerInAreaEx(i, 270.275, 1827.311, 300.275, 1827.311, 300.275, 1815.416, 270.275, 1815.416) && (z >= 16.648 && z <= 21.648))
{
if (gateopen[g] == 0)
{
StopObject(gateids[g][0]);
MoveObject(gateids[g][0], 285.990, 1832.248, 20.095, 1.7);
gateopen[g] = 1;
}
tvar ++;
}
}
else if (g == 4)
{
if (IsPlayerInAreaEx(i, 267.321, 1868.394, 270.033, 1868.394, 270.033, 1858.394, 267.321, 1858.394) && (z >= 7.757 && z <= 11.257))
{
if (gateopen[g] == 0)
{
StopObject(gateids[g][0]);
MoveObject(gateids[g][0], 268.66, 1864.059, 10.5, 0.6);
gateopen[g] = 1;
}
tvar ++;
}
}
else if (g == 5)
{
if (IsPlayerInAreaEx(i, 2306.976, 2492.599, 2279.976, 2492.599, 2279.976, 2502.404, 2306.976, 2502.404) && (z >= 2.273 && z <= 9.613))
{
if (gateopen[g] == 0)
{
StopObject(gateids[g][0]);
MoveObject(gateids[g][0], 2293.83, 2498.804, 8.4414, 1.0);
gateopen[g] = 1;
}
tvar ++;
}
}
else if (g == 6)
{
if (IsPlayerInAreaEx(i, 2351.216, 2432.937, 2340.626, 2429.053, 2319.332, 2440.480, 2319.314, 2452.331, 2346.757, 2455.847) && (z >= 2.273 && z <= 11.266))
{
if (gateopen[g] == 0)
{
StopObject(gateids[g][0]);
MoveObject(gateids[g][0], 2335.178, 2443.621, 10.9743, 1.0);
gateopen[g] = 1;
}
tvar ++;
}
}
else if (g == 7)
{
if (IsPlayerInAreaEx(i, 2482.921, 2780.974, 2512.921, 2780.974, 2512.921, 2765.149, 2482.921, 2765.149) && (z >= 9.820 && z <= 14.820))
{
if (gateopen[g] == 0)
{
StopObject(gateids[g][0]);
StopObject(gateids[8][0]);
MoveObject(gateids[g][0], 2497.4063, 2782.5703, 11.5313, 1.2);
MoveObject(gateids[8][0], 2497.4063, 2763.6094, 11.5313, 1.2);
gateopen[g] = 1;
}
tvar ++;
}
}
else if (g == 9)
{
if (IsPlayerInAreaEx(i, 1584.627, -1623.722, 1592.439, -1623.722, 1592.439, -1653.722, 1584.627, -1653.722) && (z >= 7.294 && z <= 17.382))
{
if (gateopen[g] == 0)
{
StopObject(gateids[g][0]);
MoveObject(gateids[g][0], 1595.503, -1637.872, 14.5641, 1.0);
gateopen[g] = 1;
}
tvar ++;
}
}
if (tvar == 0)
{
if (gateopen[g] == 1)
{
if (g == 0)
{
StopObject(gateids[g][0]);
StopObject(gateids[1][0]);
MoveObject(gateids[g][0], 215.941, 1874.571, 13.903, 1.0);
MoveObject(gateids[1][0], 211.842, 1874.571, 13.903, 1.0);
}
else if (g == 2)
{
StopObject(gateids[g][0]);
MoveObject(gateids[g][0], 134.912, 1941.522, 21.775, 1.7);
}
else if (g == 3)
{
StopObject(gateids[g][0]);
MoveObject(gateids[g][0], 285.990, 1822.312, 20.095, 1.7);
}
else if (g == 4)
{
StopObject(gateids[g][0]);
MoveObject(gateids[g][0], 268.66, 1864.059, 7.5, 0.6);
}
else if (g == 5)
{
StopObject(gateids[g][0]);
MoveObject(gateids[g][0], 2293.83, 2498.804, 4.4414, 1.0);
}
else if (g == 6)
{
StopObject(gateids[g][0]);
MoveObject(gateids[g][0], 2335.178, 2443.621, 6.9743, 1.0);
}
else if (g == 7)
{
StopObject(gateids[g][0]);
StopObject(gateids[8][0]);
MoveObject(gateids[g][0], 2497.4063, 2777.0703, 11.5313, 1.2);
MoveObject(gateids[8][0], 2497.4063, 2769.1094, 11.5313, 1.2);
}
else if (g == 9)
{
StopObject(gateids[g][0]);
MoveObject(gateids[g][0], 1588.503, -1637.872, 14.5641, 1.0);
}
gateopen[g] = 0;
}
}
}
}
}
return 1;
}
new string5[64], temp1, temp2;
CMD:gatemode(playerid, params[ ])
{
if(isnull(params))
{
SendClientMessage(playerid, 0xFFFF00FF, "Usage: /gatemode 0 = commands, 1 = automatic");
return 1;
}
temp1 = strval(params);
if (temp1 != 0 && temp1 != 1)
{
SendClientMessage(playerid, 0xFFFF00FF, "Usage: /gatemode 0 = commands, 1 = automatic");
return 1;
}
GetPlayerName(playerid, string5, 24);
format(string5, 64, "userfiles/%c/%s.ini", string5[0] != '.' ? string5[0] : '#', string5);
if (dini_Int(string5, "orgleader") == 0)
{
SendClientMessage(playerid, 0xFF0000FF, "Error: You aren't the (co)leader of an organization.");
return 1;
}
temp2 = GetPVarInt(playerid, "playerorg");
if (temp2 != sapd && temp2 != army && temp2 != agency)
{
SendClientMessage(playerid, 0xFF0000FF, "Your organization doesn't have a gate.");
return 1;
}
gatetype[temp2-1] = temp1;
format(string5, 64, "orgfiles/O/ORG%d.ini", temp2);
dini_IntSet(string5, "gatetype", temp1);
if (temp1 == 0)
{
SendClientMessage(playerid, 0xFFFFFFFF, "You have changed your organizations gate mode to commands.");
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "You have changed your organizations gate mode to automatic.");
}
return 1;
}
CMD:open(playerid, params[])
{
if (GetPlayerState(playerid) == PLAYER_STATE_NONE || GetPlayerState(playerid) == PLAYER_STATE_WASTED || GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
{
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You must spawn to use this command!");
return 1;
}
temp1 = GetPVarInt(playerid, "playerorg");
new Float:z;
GetPlayerPos(playerid, z, z, z);
if (temp1 == 0)
{
SendClientMessage(playerid, 0xFF0000FF, "Error: You aren't in an organization!");
return 1;
}
if (temp1 == army)
{
if (gatetype[temp1-1] == 1)
{
SendClientMessage(playerid, 0xFF0000FF, "Your organizations gate mode is set as automatic.");
return 1;
}
if (IsPlayerInAreaEx(playerid, 207.994, 1891.140, 219.605, 1891.136, 217.563, 1875.891, 217.563, 1865.891, 210.236, 1865.954, 210.236, 1875.954) && (z >= 12.141 && z <= 16.641))
{
if (gateopen[0] == 0)
{
StopObject(gateids[0][0]);
StopObject(gateids[1][0]);
MoveObject(gateids[0][0], 219.941, 1874.571, 13.903, 1.0);
MoveObject(gateids[1][0], 207.842, 1874.571, 13.903, 1.0);
gateopen[0] = 1;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate open.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already open.");
}
}
else if (IsPlayerInAreaEx(playerid, 141.889, 1925.978, 141.889, 1955.978, 128.329, 1955.978, 128.329, 1925.978) && (z >= 18.312 && z <= 23.312))
{
if (gateopen[2] == 0)
{
StopObject(gateids[2][0]);
MoveObject(gateids[2][0], 123.412, 1941.522, 21.775, 1.7);
gateopen[2] = 1;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate open.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already open.");
}
}
else if (IsPlayerInAreaEx(playerid, 270.275, 1827.311, 300.275, 1827.311, 300.275, 1815.416, 270.275, 1815.416) && (z >= 16.648 && z <= 21.648))
{
if (gateopen[3] == 0)
{
StopObject(gateids[3][0]);
MoveObject(gateids[3][0], 285.990, 1832.248, 20.095, 1.7);
gateopen[3] = 1;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate open.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already open.");
}
}
else if (IsPlayerInAreaEx(playerid, 267.321, 1868.394, 270.033, 1868.394, 270.033, 1858.394, 267.321, 1858.394) && (z >= 7.757 && z <= 11.257))
{
if (gateopen[4] == 0)
{
StopObject(gateids[4][0]);
MoveObject(gateids[4][0], 268.66, 1864.059, 10.5, 0.6);
gateopen[4] = 1;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate open.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already open.");
}
}
else {
SendClientMessage(playerid, 0xFF0000FF, "You must be at a gate to open it.");
}
}
else if (temp1 == sapd)
{
if (gatetype[temp1-1] == 1)
{
SendClientMessage(playerid, 0xFF0000FF, "Your organizations gate mode is set as automatic.");
return 1;
}
if (IsPlayerInAreaEx(playerid, 2306.976, 2492.599, 2279.976, 2492.599, 2279.976, 2502.404, 2306.976, 2502.404) && (z >= 2.273 && z <= 9.613))
{
if (gateopen[5] == 0)
{
StopObject(gateids[5][0]);
MoveObject(gateids[5][0], 2293.83, 2498.804, 8.4414, 1.0);
gateopen[5] = 1;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate open.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already open.");
}
}
else if (IsPlayerInAreaEx(playerid, 2351.216, 2432.937, 2340.626, 2429.053, 2319.332, 2440.480, 2319.314, 2452.331, 2346.757, 2455.847) && (z >= 2.273 && z <= 11.266))
{
if (gateopen[6] == 0)
{
StopObject(gateids[6][0]);
MoveObject(gateids[6][0], 2335.178, 2443.621, 10.9743, 1.0);
gateopen[6] = 1;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate open.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already open.");
}
}
else if (IsPlayerInAreaEx(playerid, 1584.627, -1623.722, 1592.439, -1623.722, 1592.439, -1653.722, 1584.627, -1653.722) && (z >= 7.294 && z <= 17.382))
{
if (gateopen[9] == 0)
{
StopObject(gateids[9][0]);
MoveObject(gateids[9][0], 1595.503, -1637.872, 14.5641, 1.0);
gateopen[9] = 1;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate open.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already open.");
}
}
else {
SendClientMessage(playerid, 0xFF0000FF, "You must be at a gate to open it.");
}
}
else if (temp1 == agency)
{
if (gatetype[temp1-1] == 1)
{
SendClientMessage(playerid, 0xFF0000FF, "Your organizations gate mode is set as automatic.");
return 1;
}
if (IsPlayerInAreaEx(playerid, 2482.921, 2780.974, 2512.921, 2780.974, 2512.921, 2765.149, 2482.921, 2765.149) && (z >= 9.820 && z <= 14.820))
{
if (gateopen[7] == 0)
{
StopObject(gateids[7][0]);
StopObject(gateids[8][0]);
MoveObject(gateids[7][0], 2497.4063, 2782.5703, 11.5313, 1.2);
MoveObject(gateids[8][0], 2497.4063, 2763.6094, 11.5313, 1.2);
gateopen[7] = 1;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate open.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already open.");
}
}
else {
SendClientMessage(playerid, 0xFF0000FF, "You must be at a gate to open it.");
}
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "Your organization doesn't have a gate.");
}
return 1;
}
CMD:close(playerid, params[])
{
if (GetPlayerState(playerid) == PLAYER_STATE_NONE || GetPlayerState(playerid) == PLAYER_STATE_WASTED || GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
{
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You must spawn to use this command!");
return 1;
}
temp1 = GetPVarInt(playerid, "playerorg");
new Float:z;
GetPlayerPos(playerid, z, z, z);
if (temp1 == 0)
{
SendClientMessage(playerid, 0xFF0000FF, "Error: You aren't in an organization!");
}
if (temp1 == army)
{
if (gatetype[temp1-1] == 1)
{
SendClientMessage(playerid, 0xFF0000FF, "Your organizations gate mode is set as automatic.");
return 1;
}
if (IsPlayerInAreaEx(playerid, 207.994, 1891.140, 219.605, 1891.136, 217.563, 1875.891, 217.563, 1865.891, 210.236, 1865.954, 210.236, 1875.954) && (z >= 12.141 && z <= 16.641))
{
if (gateopen[0] == 1)
{
StopObject(gateids[0][0]);
StopObject(gateids[1][0]);
MoveObject(gateids[0][0], 215.941, 1874.571, 13.903, 1.0);
MoveObject(gateids[1][0], 211.842, 1874.571, 13.903, 1.0);
gateopen[0] = 0;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate closed.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already closed.");
}
}
else if (IsPlayerInAreaEx(playerid, 141.889, 1925.978, 141.889, 1955.978, 128.329, 1955.978, 128.329, 1925.978) && (z >= 18.312 && z <= 23.312))
{
if (gateopen[2] == 1)
{
StopObject(gateids[2][0]);
MoveObject(gateids[2][0], 134.912, 1941.522, 21.775, 1.7);
gateopen[2] = 0;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate closed.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already closed.");
}
}
else if (IsPlayerInAreaEx(playerid, 270.275, 1827.311, 300.275, 1827.311, 300.275, 1815.416, 270.275, 1815.416) && (z >= 16.648 && z <= 21.648))
{
if (gateopen[3] == 1)
{
StopObject(gateids[3][0]);
MoveObject(gateids[3][0], 285.990, 1822.312, 20.095, 1.7);
gateopen[3] = 0;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate closed.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already closed.");
}
}
else if (IsPlayerInAreaEx(playerid, 267.321, 1868.394, 270.033, 1868.394, 270.033, 1858.394, 267.321, 1858.394) && (z >= 7.757 && z <= 11.257))
{
if (gateopen[4] == 1)
{
StopObject(gateids[4][0]);
MoveObject(gateids[4][0], 268.66, 1864.059, 7.5, 0.6);
gateopen[4] = 0;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate closed.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already closed.");
}
}
else {
SendClientMessage(playerid, 0xFF0000FF, "You must be at a gate to close it.");
}
}
else if (temp1 == sapd)
{
if (gatetype[temp1-1] == 1)
{
SendClientMessage(playerid, 0xFF0000FF, "Your organizations gate mode is set as automatic.");
return 1;
}
if (IsPlayerInAreaEx(playerid, 2306.976, 2492.599, 2279.976, 2492.599, 2279.976, 2502.404, 2306.976, 2502.404) && (z >= 2.273 && z <= 9.613))
{
if (gateopen[5] == 1)
{
StopObject(gateids[5][0]);
MoveObject(gateids[5][0], 2293.83, 2498.804, 4.4414, 1.0);
gateopen[5] = 0;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate closed.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already closed.");
}
}
else if (IsPlayerInAreaEx(playerid, 2351.216, 2432.937, 2340.626, 2429.053, 2319.332, 2440.480, 2319.314, 2452.331, 2346.757, 2455.847) && (z >= 2.273 && z <= 11.266))
{
if (gateopen[6] == 1)
{
StopObject(gateids[6][0]);
MoveObject(gateids[6][0], 2335.178, 2443.621, 6.9743, 1.0);
gateopen[6] = 0;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate closed.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already closed.");
}
}
else if (IsPlayerInAreaEx(playerid, 1584.627, -1623.722, 1592.439, -1623.722, 1592.439, -1653.722, 1584.627, -1653.722) && (z >= 7.294 && z <= 17.382))
{
if (gateopen[9] == 1)
{
StopObject(gateids[9][0]);
MoveObject(gateids[9][0], 1588.503, -1637.872, 14.5641, 1.0);
gateopen[9] = 0;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate closed.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already closed.");
}
}
else {
SendClientMessage(playerid, 0xFF0000FF, "You must be at a gate to close it.");
}
}
else if (temp1 == agency)
{
if (gatetype[temp1-1] == 1)
{
SendClientMessage(playerid, 0xFF0000FF, "Your organizations gate mode is set as automatic.");
return 1;
}
if (IsPlayerInAreaEx(playerid, 2482.921, 2780.974, 2512.921, 2780.974, 2512.921, 2765.149, 2482.921, 2765.149) && (z >= 9.820 && z <= 14.820))
{
if (gateopen[7] == 1)
{
StopObject(gateids[7][0]);
StopObject(gateids[8][0]);
MoveObject(gateids[7][0], 2497.4063, 2777.0703, 11.5313, 1.2);
MoveObject(gateids[8][0], 2497.4063, 2769.1094, 11.5313, 1.2);
gateopen[7] = 0;
SendClientMessage(playerid, 0xFFFFFFFF, "Gate closed.");
}
else {
SendClientMessage(playerid, 0xFF0000FF, "This gate is already closed.");
}
}
else {
SendClientMessage(playerid, 0xFF0000FF, "You must be at a gate to close it.");
}
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "Your organization doesn't have a gate.");
}
return 1;
}
Thanks for your time.