Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Jack Sparrow's AKA Castle Area 51 Gates V2
- if you are using this Filterscript Please leave credit
- */
- #include <a_samp>
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- forward ObjectTimers();
- #define COLOR_LIGHTRED 0xFF6347AA//LightRed
- //#define COLOR_GREED 0x33AA33AA//Greed
- new aGate, agStatus = 1;//Area 51 Entrance Gate
- new aGate2, ag2Status = 1;//Area 51 Garage Shutter
- new aLift, aLift2, aLift3, aLift4, alStatus = 1;//Area 51 Lift
- new aObj1, aObj2;//Area 51 Objects: Guard Tower, Eastern Blockade
- public OnFilterScriptInit()
- {
- print(" ");
- print("______________________________");
- print("| |");
- print("| ==>Castle<== |");
- print("| [FS]Area51 |");
- print("| Filter Script Loaded |");
- print("| |");
- print("|____________________________|");
- print(" ");
- aGate = CreateObject(985, 96.669350, 1920.033936, 18.855873, 0.0000, 0.0000, 90.0000);//Area 51 Entrance Gate
- aGate2 = CreateObject(10184, 214.337631, 1875.739136, 13.162411, 0.0000, 0.0000, 270.0000);//Area 51 Garage Shutter
- aLift = CreateObject(985, 281.667694, 1821.519043, 16.701317, 270.6186, 0.0000, 270.0000);//Area 51 Lift Object1
- aLift2 = CreateObject(986, 290.248383, 1821.519043, 16.651318, 270.6186, 0.0000, 90.0000);//Area 51 Lift Object2
- aLift3 = CreateObject(985, 275.712830, 1821.519043, 16.701317, 270.6186, 0.0000, 270.0000);//Area 51 Lift Object3
- aLift4 = CreateObject(986, 296.168213, 1821.519043, 16.701317, 270.6186, 0.0000, 90.0000);//Area 51 Lift Object4
- aObj1 = CreateObject(3279, 103.999695, 1932.790771, 16.758234, 0.0000, 0.0000, 0.0000);//Area 51 Guard Tower
- aObj2 = CreateObject(987, 340.080139, 1794.643188, 15.133865, 0.0000, 0.0000, 33.7500);//Area 51 Eastern Blockade
- return 1;
- }
- public OnFilterScriptExit()
- {
- print(" ");
- print("______________________________");
- print("| |");
- print("| ==>Castle<== |");
- print("| [FS]Area51 |");
- print("| Filter Script Unloaded |");
- print("| |");
- print("|____________________________|");
- print(" ");
- DestroyObject(aGate);
- DestroyObject(aGate2);
- DestroyObject(aLift);
- DestroyObject(aLift2);
- DestroyObject(aLift3);
- DestroyObject(aLift4);
- DestroyObject(aObj1);
- DestroyObject(aObj2);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext, "/gate", true) == 0)
- {
- if(GetPlayerSkin(playerid) == 287)
- {
- if(PlayerToPoint(15, playerid, 96.669350, 1920.033936, 18.855873))//Aread 51 Entrance Gate
- {
- if(agStatus == 1)
- {
- MoveObject(aGate, 96.669350, 1925.953735, 18.855873, 4);
- SendClientMessage(playerid, 0x33AA33AA, "Area51 Gate Open, don't forget to close it!");
- agStatus = 0;
- SetTimer("ObjectTimers", 5000, false);
- return 1;
- }
- }
- if(PlayerToPoint(10, playerid, 214.337631, 1875.739136, 13.162411))//Area 51 Garage Shutter
- {
- if(ag2Status == 1)
- {
- MoveObject(aGate2, 214.337631, 1875.739136, 9.000, 4);
- SendClientMessage(playerid, 0x33AA33AA, "Area51 Garage Open, don't forget to close it!");
- ag2Status = 0;
- SetTimer("ObjectTimers", 5000, false);
- return 1;
- }
- }
- else{ SendClientMessage(playerid, COLOR_LIGHTRED, "You are too far away from the Gate/Garage"); return 1; }
- }
- else{ SendClientMessage(playerid, COLOR_LIGHTRED, "You aren't a Soldier"); return 1; }
- }
- if(strcmp(cmdtext, "/lift", true) == 0)
- {
- if(GetPlayerSkin(playerid) == 287)
- {
- if(PlayerToPoint(25, playerid, 281.667694, 1821.519043, 16.701317))//Area 51 Lift
- {
- if(alStatus == 1)
- {
- MoveObject(aLift, 281.667694, 1821.519043, 23.451214, 4);
- MoveObject(aLift2, 290.248383, 1821.519043, 23.451214, 4);
- MoveObject(aLift3, 275.712830, 1821.519043, 23.451214, 4);
- MoveObject(aLift4, 296.168213, 1821.519043, 23.451214, 4);
- SendClientMessage(playerid, 0x33AA33AA, "Area51 Lift Going Up");
- alStatus = 0;
- SetTimer("ObjectTimers", 5000, false);
- return 1;
- }
- }
- else{ SendClientMessage(playerid, COLOR_LIGHTRED, "You are too far away from the Elevator"); return 1; }
- }
- else{ SendClientMessage(playerid, COLOR_LIGHTRED, "You aren't a Soldier"); return 1; }
- }
- /* if(strcmp(cmdtext, "/area51", true) == 0)
- {
- SetPlayerPos(playerid, 90.669350, 1920.033936, 18.855873);
- return 1;
- }*/
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys == KEY_FIRE)//RMB or Ctrl
- {
- if(GetPlayerSkin(playerid) == 287)
- {
- if(PlayerToPoint(15, playerid, 96.669350, 1920.033936, 18.855873))//Aread 51 Entrance Gate
- {
- if(agStatus == 1)
- {
- MoveObject(aGate, 96.669350, 1925.953735, 18.855873, 4);
- SendClientMessage(playerid, 0x33AA33AA, "Area51 Gate Open, don't forget to close it!");
- agStatus = 0;
- SetTimer("ObjectTimers", 5000, false);
- return 1;
- }
- }
- if(PlayerToPoint(10, playerid, 214.337631, 1875.739136, 13.162411))//Area 51 Garage Shutter
- {
- if(ag2Status == 1)
- {
- MoveObject(aGate2, 214.337631, 1875.739136, 9.000, 4);
- SendClientMessage(playerid, 0x33AA33AA, "Area51 Garage Open, don't forget to close it!");
- ag2Status = 0;
- SetTimer("ObjectTimers", 5000, false);
- return 1;
- }
- }
- if(PlayerToPoint(25, playerid, 281.667694, 1821.519043, 16.701317))//Area 51 Lift
- {
- if(alStatus == 1)
- {
- MoveObject(aLift, 281.667694, 1821.519043, 23.451214, 4);
- MoveObject(aLift2, 290.248383, 1821.519043, 23.451214, 4);
- MoveObject(aLift3, 275.712830, 1821.519043, 23.451214, 4);
- MoveObject(aLift4, 296.168213, 1821.519043, 23.451214, 4);
- SendClientMessage(playerid, 0x33AA33AA, "Area51 Lift Going Up");
- alStatus = 0;
- SetTimer("ObjectTimers", 5000, false);
- return 1;
- }
- }
- else{ SendClientMessage(playerid, COLOR_LIGHTRED, "You are too far away from the Gate/Garage/Elevator"); return 1; }
- }
- else{ SendClientMessage(playerid, COLOR_LIGHTRED, "You aren't a Soldier"); return 1; }
- }
- return 1;
- }
- public ObjectTimers()
- {
- if(agStatus == 0)
- {
- MoveObject(aGate, 96.669350, 1920.033936, 18.855873, 4);
- agStatus = 1;
- return 1;
- }
- if(ag2Status == 0)
- {
- MoveObject(aGate2, 214.337631, 1875.739136, 13.162411, 4);
- ag2Status = 1;
- return 1;
- }
- if(alStatus == 0)
- {
- MoveObject(aLift, 281.667694, 1821.519043, 16.701317, 4);
- MoveObject(aLift2, 290.248383, 1821.519043, 16.701317, 4);
- MoveObject(aLift3, 275.712830, 1821.519043, 16.701317, 4);
- MoveObject(aLift4, 296.168213, 1821.519043, 16.701317, 4);
- alStatus = 1;
- return 1;
- }
- return 1;
- }
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment