Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**********************************
- -----------------------------------
- Super Cannon LS Beach
- Map by Stunterx
- Script by Stunterx
- Translated By Sig Hansen
- -----------------------------------
- **********************************/
- #include <a_samp>
- #define COLOR_GREEN 0x00FF00FF
- #define COLOR_RED 0xF60000AA
- forward controlloCannon();
- forward CannonUnfreeze();
- new
- bool:inCannon[MAX_PLAYERS],
- CannonObj,
- timerControlloCannon,
- maxPlayers;
- public OnFilterScriptInit()
- {
- print("\n========================================");
- print("|- Super Cannon LS Beach -|");
- print("|- Map by Stunterx -|");
- print("|- Script by Stunterx -|");
- print("|- Loaded! -|");
- print("========================================\n");
- maxPlayers = GetMaxPlayers();
- CannonObj = CreateObject(3865, 839.52935791016, -2059.0070800781, 13.726110458374, 0, 358.5, 1);
- CreateObject(2909, 837.38903808594, -2062.2612304688, 11.973615646362, 270, 180.00152587891, 179.2568359375);
- CreateObject(2909, 841.45599365234, -2064.8791503906, 11.923616409302, 270, 179.99450683594, 180.99975585938);
- CreateObject(2909, 841.40991210938, -2062.2963867188, 11.923616409302, 270, 179.99450683594, 180.99975585938);
- CreateObject(2909, 837.35803222656, -2064.884765625, 11.973615646362, 270, 180, 179.2529296875);
- CreateObject(2909, 841.37908935547, -2059.6853027344, 11.923616409302, 270, 179.99450683594, 180.99975585938);
- CreateObject(2909, 841.37628173828, -2057.0959472656, 11.923616409302, 270, 179.99853515625, 181.00370788574);
- CreateObject(2909, 841.32800292969, -2054.5610351563, 11.923616409302, 270, 179.99450683594, 180.99975585938);
- CreateObject(2909, 837.42462158203, -2059.6506347656, 11.973615646362, 270, 180, 179.2529296875);
- CreateObject(2909, 837.46789550781, -2057.05078125, 11.973615646362, 270, 180, 179.2529296875);
- CreateObject(2909, 837.50793457031, -2054.5615234375, 11.973615646362, 270, 180, 179.2529296875);
- CreateObject(2909, 839.45349121094, -2054.5439453125, 16.198608398438, 0, 270, 270.00524902344);
- CreateObject(2909, 839.42291259766, -2057.130859375, 16.198608398438, 0, 270, 270);
- CreateObject(2909, 839.39526367188, -2059.7426757813, 16.198608398438, 0, 270, 270);
- CreateObject(2909, 839.40631103516, -2062.3911132813, 16.198608398438, 0, 270, 270);
- CreateObject(2909, 839.40454101563, -2064.9912109375, 16.198608398438, 0, 270, 270);
- CreateObject(9131, 843.236328125, -2053.4609375, 15.071090698242, 0, 0, 0);
- CreateObject(9131, 841.77862548828, -2053.4812011719, 15.071090698242, 0, 0, 0);
- CreateObject(9131, 842.51306152344, -2053.5234375, 12.821105957031, 0, 0, 0);
- CreateObject(9131, 841.77233886719, -2053.5302734375, 12.821109771729, 0, 0, 0);
- CreateObject(9131, 843.24682617188, -2053.509765625, 12.821105957031, 0, 0, 0);
- CreateObject(9131, 837.0009765625, -2053.4619140625, 15.021102905273, 0, 0, 358.24768066406);
- CreateObject(9131, 835.67163085938, -2053.4172363281, 12.796117782593, 0, 0, 359.24768066406);
- CreateObject(9131, 837.0009765625, -2053.4619140625, 12.796125411987, 0, 0, 358.24768066406);
- CreateObject(9131, 835.67346191406, -2053.4130859375, 15.046113967896, 0, 0, 359.24743652344);
- CreateObject(9131, 836.38482666016, -2053.4375, 12.796125411987, 0, 0, 358.24768066406);
- CreateObject(2909, 838.67102050781, -2054.2685546875, 11.998615264893, 270.69775390625, 44.994750976563, 315.74642944336);
- CreateObject(2909, 841.123046875, -2054.1782226563, 11.998615264893, 270.69763183594, 44.994506835938, 315.74157714844);
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n========================================");
- print("|- Super Cannon LS Beach -|");
- print("|- Map by Stunterx -|");
- print("|- Script by Stunterx -|");
- print("|- Unloaded! -|");
- print("========================================\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- inCannon[playerid] = false;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new
- pName[24],
- string[128];
- GetPlayerName(playerid, pName, 24);
- if(strcmp("/cannon", cmdtext, true) == 0)
- {
- if(inCannon[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "|- You are already inside the cannon.");
- SetPlayerInterior(playerid, 0);
- SetPlayerPos(playerid, 839.1580, -2057.2214, 13.2710);
- TogglePlayerControllable(playerid, 0);
- inCannon[playerid] = true;
- format(string, 128, "* %s č went inside the Super Cannon! (/ cannon)", pName);
- SendClientMessageToAll(COLOR_GREEN, string);
- SendClientMessage(playerid, COLOR_GREEN, "|- You have entered the Super Cannon and you have been immobilized.");
- SendClientMessage(playerid, COLOR_GREEN, "|- Remember that you can use / startcannon to go.");
- SendClientMessage(playerid, COLOR_GREEN, "|- If you want to quit using / esccannon");
- return 1;
- }
- if(strcmp("/esccannon", cmdtext, true) == 0)
- {
- if(inCannon[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "|- You are already out of the Cannon.");
- SpawnPlayer(playerid);
- inCannon[playerid] = false;
- TogglePlayerControllable(playerid, 1);
- format(string, 128, "* %s č went out of the Super Cannon!! (/esccannon)", pName);
- SendClientMessageToAll(COLOR_GREEN, string);
- SendClientMessage(playerid, COLOR_GREEN, "[INFO:] You have left the super-cannon, and six free again.");
- SendClientMessage(playerid, COLOR_GREEN, "[INFO:] Remember that you can use / entcannon to get back into the Cannon.");
- return 1;
- }
- if(strcmp("/startcannon", cmdtext, true) == 0)
- {
- if(inCannon[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "|- You are not in the Cannon. Get in in using / entcannon.");
- CreateExplosion(835.5359, -2054.8293, 12.8672, 2, 5);
- CreateExplosion(843.1001, -2055.0627, 12.8672, 2, 5);
- CreateExplosion(839.4694, -2051.5188, 12.8672, 2, 5);
- MoveObject(CannonObj, 835.7650, -2594.9653, 13.1358, 50);
- SetTimer("cannonUnfreeze", 3000, false);
- timerControlloCannon = SetTimer("controlloCannon", 250, true);
- format(string, 128, "* %s has started the Super Cannon! (/ startcannon)", pName);
- SendClientMessageToAll(COLOR_GREEN, string);
- return 1;
- }
- return 0;
- }
- public controlloCannon()
- {
- new
- Float:rPos[3],
- Float:pPos[3];
- GetObjectPos(CannonObj, rPos[0], rPos[1], rPos[2]);
- if(rPos[0] == 835.7650 && rPos[1] == -2594.9653 && rPos[2] == 13.1358)
- {
- for(new i = 0; i != MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && inCannon[i] == true)
- {
- inCannon[i] = false;
- GetPlayerPos(i, pPos[0], pPos[1], pPos[2]);
- SetPlayerPos(i, pPos[0] + 5, pPos[1] + 5, pPos[2] + 5);
- CreateExplosion(pPos[0] + 5, pPos[1] + 5, pPos[2] - 5, 11, 5);
- SendClientMessage(i, COLOR_GREEN, "|- ou have been kicked from Cannon. Use /cannon to return to Cannon.");
- }
- }
- KillTimer(timerControlloCannon);
- CreateExplosion(836.0727, -2602.4878, 14.0880, 2, 5);
- MoveObject(CannonObj, 839.52935791016, -2059.0070800781, 13.726110458374, 50);
- }
- }
- public CannonUnfreeze()
- {
- for(new i = 0; i < maxPlayers; i++) if(IsPlayerConnected(i) && inCannon[i] == true) TogglePlayerControllable(i, 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement