// This is a comment // uncomment the line below if you want to write a filterscript //#define FILTERSCRIPT #include <a_samp> #if defined FILTERSCRIPT new gate; // use it on the top of the script!! new gate1; public OnFilterScriptInit() { gate = CreateObject(980, 1792.6700439453, -1284.7282714844, 15.406204223633, 0, 0, 0); //GATE! CreateObject(987, 1798.8885498047, -1296.3529052734, 12.544774055481, 0, 0, 94); CreateObject(987, 1776.6673583984, -1290.5843505859, 12.6328125, 0, 0, 271.9990234375); CreateObject(980, 1792.6700439453, -1284.7282714844, 15.406204223633, 0, 0, 0); CreateObject(987, 1787.1528320313, -1284.6828613281, 12.752249717712, 0, 0, 209.99401855469); CreateObject(638, 1770.9407958984, -1302.5523681641, 49.126628875732, 0, 0, 180); CreateObject(16151, 1817.3671875, -1294.1584472656, 48.787979125977, 0, 0, 0); CreateObject(1978, 1826.3927001953, -1271.7930908203, 49.445430755615, 0, 0, 0); CreateObject(2188, 1825.5853271484, -1291.2224121094, 49.374271392822, 0, 0, 92); CreateObject(2785, 1824.7265625, -1298.9467773438, 49.250728607178, 0, 0, 88); CreateObject(2773, 1824.6099853516, -1289.9552001953, 48.946002960205, 0, 0, 88.25); CreateObject(2773, 1824.6708984375, -1292.3682861328, 48.943355560303, 0, 0, 88.247680664063); CreateObject(3881, 1800.3692626953, -1281.5466308594, 14.48787689209, 0, 0, 0); gate1 = CreateObject(980, 1788.2348632813, -1298.3057861328, 14.098407745361, 0, 0, 0); //GATE2! CreateObject(987, 1805.8101806641, -1298.9328613281, 12.355841636658, 0, 0, 178); CreateObject(987, 1782.4714355469, -1298.142578125, 12.375, 0, 0, 177.99499511719); print("\n--------------------------------------"); print(" Blank Filterscript by your name here"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/open", true) == 0) { MoveObject(gate,1792.6700439453, -1284.7282714844, 15.406204223633, 0, 0, 0); //GATE!// You need to get the gate coordinates using samp debug and /save or to any server use /save name for the coordinates or the place that you want the gate go on SendClientMessage(playerid, COLOR_RED, "The gate is open"); return 1; } if(strcmp(cmdtext, "/close", true) == 0) { MoveObject(gate, 1792.6700439453, -1284.7282714844, 8.7312259674072, 0, 0, 0); SendClientMessage(playerid, COLOR_RED, "The Gate Is closed Now"); return 1; } if(strcmp(cmdtext, "/open1", true) == 0) { MoveObject(gate1,1799.7746582031, -1298.7623291016, 14.098407745361, 0, 0, 0); //GATE!// You need to get the gate coordinates using samp debug and /save or to any server use /save name for the coordinates or the place that you want the gate go on SendClientMessage(playerid, COLOR_RED, "The gate is open"); return 1; } if(strcmp(cmdtext, "/close1", true) == 0) { MoveObject(gate1, 1788.2348632813, -1298.3057861328, 14.098407745361, 0, 0, 0); SendClientMessage(playerid, COLOR_RED, "The Gate Is closed Now"); return 1; } return 0; } #endif
You have got the wrong opening co-ords, the opening ones are where the object moves. You have them the same as the /close.
|
You have got the wrong opening co-ords, the opening ones are where the object moves. You have them the same as the /close.
|
MoveObject(gate,1792.6700439453, -1284.7282714844, 15.406204223633, 0, 0, 0); 15.406204223633
MoveObject(gate, 1792.6700439453, -1284.7282714844, 8.7312259674072, 0, 0, 0); 8.7312259674072
new opened1;
new opened2;
new gate1;
new gate2;
gate1 = CreateObject(980, 1792.6700439453, -1284.7282714844, 15.406204223633, 0, 0, 0); //GATE1!
gate2 = CreateObject(980, 1788.2348632813, -1298.3057861328, 14.098407745361, 0, 0, 0); //GATE2!
if(strcmp("/gate1", cmdtext, true, 6) == 0) {/////WITH ONLY ONE COMMAND!
if(opened1 == 0) {
new name[MAX_PLAYER_NAME+1];
new String128[128];
GetPlayerName(playerid, name, sizeof(name));
format(String128, sizeof(String128), "%s has opened the gate!", name);
SendClientMessageToAll(0x33AA33AA, String128);
SendClientMessage(playerid, 0x33AA33AA,"Gate Opened!");
MoveObject(gate1,1792.6700439453, -1284.7282714844, 15.406204223633, 2.5);//OPEN
opened1 = 1;
} else if(opened1 == 1) {
new name[MAX_PLAYER_NAME+1];
new String128[128];
GetPlayerName(playerid, name, sizeof(name));
format(String128, sizeof(String128), "%s has closed the gate!", name);
SendClientMessageToAll(0xAA3333AA, String128);
SendClientMessage(playerid, 0xAA3333AA,"Gate Closed!");
MoveObject(gate1, 1792.6700439453, -1284.7282714844, 8.7312259674072, 2.5);//CLOSE
opened1 = 0;
}
return 1;
}
if(strcmp("/gate2", cmdtext, true, 6) == 0) {/////WITH ONLY ONE COMMAND!
if(opened2 == 0) {
new name[MAX_PLAYER_NAME+1];
new String128[128];
GetPlayerName(playerid, name, sizeof(name));
format(String128, sizeof(String128), "%s has opened the gate 2!", name);
SendClientMessageToAll(0x33AA33AA, String128);
SendClientMessage(playerid, 0x33AA33AA,"Gate 2 Opened!");
MoveObject(gate1,1799.7746582031, -1298.7623291016, 14.098407745361, 2.5);//OPEN1
opened1 = 1;
} else if(opened2 == 1) {
new name[MAX_PLAYER_NAME+1];
new String128[128];
GetPlayerName(playerid, name, sizeof(name));
format(String128, sizeof(String128), "%s has closed the gate 2!", name);
SendClientMessageToAll(0xAA3333AA, String128);
SendClientMessage(playerid, 0xAA3333AA,"Gate 2 Closed!");
MoveObject(gate1, 1788.2348632813, -1298.3057861328, 14.098407745361, 2.5);//CLOSE
opened2 = 0;
}
return 1;
}