Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
- *
- * SA-MP RocketScript
- *
- * (c) Copyright 2012, 946ben
- *
- * 9999999999 BBBBBBBBBBB
- * 9999999999 BBBBBBBBBBB
- * 999 999 BBB BBB
- * 999 999 BBB BBB
- * 999 999 BBB BBB
- * 9999999999 BBB BBBBB
- * 9999999999 BBB BBBBB
- * 999 BBB BBB
- * 999 BBB BBB
- * 999 BBB BBB
- * 9999999999 BBBBBBBBBBB
- * 9999999999 BBBBBBBBBBB
- *
- *
- * RRRRRRRRRR SSSSSSSSSSS
- * RRRRRRRRRR SSSSSSSSSSS
- * RRR RRR SSS
- * RRR RRR SSS
- * RRRRRRRRRR SSSSSSSSSSS
- * RRRRRRRRRR SSSSSSSSSSS
- * RRR RRR SSS
- * RRR RRR SSS
- * RRR RRR SSSSSSSSSSS
- * RRR RRR SSSSSSSSSSS
- *
- *
- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
- *
- * Voraussetzungen:
- * -ZCMD Include
- * -MapAndreas Plugin
- * -MapAndreas Include
- *
- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
- *
- * All rights reserved.
- *
- * Redistribution and use in source , with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice, this
- * list of conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
- *
- */
- // VERSION v1.1
- #include <a_samp>
- #include <mapandreas>
- #include <zcmd>
- #define RED 0xB90000FF
- new timer;
- new count;
- new Float:size;
- new obj;
- new move;
- new pickup;
- new bool:isstarting;
- new bool:playerstarting[MAX_PLAYERS];
- new bool:placed;
- new string[5];
- new Text:Textdraw1;
- new Text:Textdraw2;
- new Text:Textdraw3;
- new Text:Textdraw4;
- new Text:Textdraw5;
- new Text:Textdraw6;
- new Text:Textdraw7;
- new Text:Textdraw8;
- new Text:Textdraw9;
- public OnFilterScriptInit() {
- MapAndreas_Init(MAP_ANDREAS_MODE_FULL);
- pickup = CreatePickup(1210, 1, 212.4329,1822.8763,6.4141, -1);
- Textdraw1 = TextDrawCreate(152.000000, 320.000000, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~"); // Hintergrund
- TextDrawBackgroundColor(Textdraw1, 255);
- TextDrawFont(Textdraw1, 1);
- TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
- TextDrawColor(Textdraw1, -1);
- TextDrawSetOutline(Textdraw1, 0);
- TextDrawSetProportional(Textdraw1, 1);
- TextDrawSetShadow(Textdraw1, 1);
- TextDrawUseBox(Textdraw1, 1);
- TextDrawBoxColor(Textdraw1, 1347440790);
- TextDrawTextSize(Textdraw1, 486.000000, 0.000000);
- Textdraw2 = TextDrawCreate(170.000000, 334.000000, "~n~"); // Balken schwarz
- TextDrawBackgroundColor(Textdraw2, 255);
- TextDrawFont(Textdraw2, 1);
- TextDrawLetterSize(Textdraw2, 0.500000, 1.000000);
- TextDrawColor(Textdraw2, -1);
- TextDrawSetOutline(Textdraw2, 0);
- TextDrawSetProportional(Textdraw2, 1);
- TextDrawSetShadow(Textdraw2, 1);
- TextDrawUseBox(Textdraw2, 1);
- TextDrawBoxColor(Textdraw2, 255);
- TextDrawTextSize(Textdraw2, 470.000000, 20.000000);
- Textdraw3 = TextDrawCreate(170.000000, 334.000000, "~n~"); // Balken rot
- TextDrawBackgroundColor(Textdraw3, 255);
- TextDrawFont(Textdraw3, 1);
- TextDrawLetterSize(Textdraw3, 0.500000, 1.000000);
- TextDrawColor(Textdraw3, -1);
- TextDrawSetOutline(Textdraw3, 0);
- TextDrawSetProportional(Textdraw3, 1);
- TextDrawSetShadow(Textdraw3, 1);
- TextDrawUseBox(Textdraw3, 1);
- TextDrawBoxColor(Textdraw3, -16776961);
- TextDrawTextSize(Textdraw3, 170.000000, 20.000000);
- Textdraw4 = TextDrawCreate(304.000000, 333.000000, "100"); // Balken Zahl
- TextDrawBackgroundColor(Textdraw4, 255);
- TextDrawFont(Textdraw4, 1);
- TextDrawLetterSize(Textdraw4, 0.500000, 1.000000);
- TextDrawColor(Textdraw4, -1);
- TextDrawSetOutline(Textdraw4, 0);
- TextDrawSetProportional(Textdraw4, 1);
- TextDrawSetShadow(Textdraw4, 1);
- Textdraw5 = TextDrawCreate(168.000000, 361.000000, "Bereite Raketeneinheit vor..."); // Statusanzeige
- TextDrawBackgroundColor(Textdraw5, 255);
- TextDrawFont(Textdraw5, 1);
- TextDrawLetterSize(Textdraw5, 0.519999, 1.900000);
- TextDrawColor(Textdraw5, -1);
- TextDrawSetOutline(Textdraw5, 0);
- TextDrawSetProportional(Textdraw5, 1);
- TextDrawSetShadow(Textdraw5, 1);
- Textdraw6 = TextDrawCreate(30.000000, 130.000000, "~g~Bitte geben Sie die Position an, an der die Rakete explodieren soll.~n~~g~Verwenden Sie dazu folgende Technik:"); // Info-Text
- TextDrawBackgroundColor(Textdraw6, 255);
- TextDrawFont(Textdraw6, 1);
- TextDrawLetterSize(Textdraw6, 0.460000, 1.400000);
- TextDrawColor(Textdraw6, -1);
- TextDrawSetOutline(Textdraw6, 0);
- TextDrawSetProportional(Textdraw6, 1);
- TextDrawSetShadow(Textdraw6, 1);
- Textdraw7 = TextDrawCreate(42.000000, 161.000000, "~r~-Gehen Sie via ESC auf die Karte~n~~r~-Klicken Sie dort an der Stelle mit der rechten Maustaste"); // Info-Text
- TextDrawBackgroundColor(Textdraw7, 255);
- TextDrawFont(Textdraw7, 1);
- TextDrawLetterSize(Textdraw7, 0.460000, 1.400000);
- TextDrawColor(Textdraw7, -1);
- TextDrawSetOutline(Textdraw7, 0);
- TextDrawSetProportional(Textdraw7, 1);
- TextDrawSetShadow(Textdraw7, 1);
- Textdraw8 = TextDrawCreate(42.000000, 186.000000, "~r~-Kommen Sie dann ins Spiel zurueck"); // Info-Text
- TextDrawBackgroundColor(Textdraw8, 255);
- TextDrawFont(Textdraw8, 1);
- TextDrawLetterSize(Textdraw8, 0.460000, 1.400000);
- TextDrawColor(Textdraw8, -1);
- TextDrawSetOutline(Textdraw8, 0);
- TextDrawSetProportional(Textdraw8, 1);
- TextDrawSetShadow(Textdraw8, 1);
- Textdraw9 = TextDrawCreate(30.000000, 130.000000, "Koordinaten erfolgreich angegeben. Bitte warten!"); // Koordeingabe fertig
- TextDrawBackgroundColor(Textdraw9, 255);
- TextDrawFont(Textdraw9, 1);
- TextDrawLetterSize(Textdraw9, 0.460000, 1.400000);
- TextDrawColor(Textdraw9, -11534081);
- TextDrawSetOutline(Textdraw9, 0);
- TextDrawSetProportional(Textdraw9, 1);
- TextDrawSetShadow(Textdraw9, 1);
- return 1;
- }
- public OnFilterScriptExit() {
- DestroyPickup(pickup);
- return 1;
- }
- public OnPlayerConnect(playerid) {
- playerstarting[playerid] = false;
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == pickup) GameTextForPlayer(playerid, "/startrocket", 2000, 0);
- return 1;
- }
- forward rtimer(playerid, Float:zx, Float:zy, Float:zz);
- public rtimer(playerid, Float:zx, Float:zy, Float:zz) {
- if(count == 40) {
- PlayerPlaySound(playerid, 5201, 0.0, 0.0, 0);
- TextDrawSetString(Textdraw5, "Warte auf Koordinateneingabe...");
- TextDrawShowForPlayer(playerid, Textdraw6);
- TextDrawShowForPlayer(playerid, Textdraw7);
- TextDrawShowForPlayer(playerid, Textdraw8);
- placed = false;
- KillTimer(timer);
- return 1;
- }
- if(count == 39) {
- TextDrawSetString(Textdraw5, "Bereite Startsequenz vor...");
- }
- if(count == 16) {
- TextDrawSetString(Textdraw5, "Bereite Countdown vor...");
- }
- if(count == 11) {
- TextDrawSetString(Textdraw5, "Rakete wird gestartet...");
- }
- if(count == 0) {
- TextDrawHideForPlayer(playerid, Textdraw1);
- TextDrawHideForPlayer(playerid, Textdraw2);
- TextDrawHideForPlayer(playerid, Textdraw3);
- TextDrawHideForPlayer(playerid, Textdraw4);
- TextDrawHideForPlayer(playerid, Textdraw5);
- TextDrawSetString(Textdraw9, "Rakete erfolgreich gestartet!");
- TextDrawShowForPlayer(playerid, Textdraw9);
- KillTimer(timer);
- SetTimerEx("rtimer3", 5000, 0, "ifff", playerid, zx, zy, zz);
- new Float:x, Float:y, Float:z;
- TogglePlayerControllable(playerid, 1);
- GetPlayerPos(playerid, x, y, z);
- obj = CreateObject(354, x, y, z+10, 0.0, 0.0, 0.0);
- move = MoveObject(obj, x, y, 500, 80);
- new rand = random(2);
- if(rand == 0) {
- SendClientMessageToAll(RED, "[Raketenalarm] Die Frühwarnsysteme haben eine Rakete im Luftraum von San Andreas gemeldet");
- SendClientMessageToAll(RED, "[Raketenalarm] Bitte bewahren Sie Ruhe!");
- }
- SetTimerEx("rtimer4", 1000+move, 0, "fff", zx, zy, zz);
- return 1;
- }
- count = count-1;
- if(count == 38) PlayerPlaySound(playerid, 5201, 0.0, 0.0, 0);
- if(count == 15) PlayerPlaySound(playerid, 5201, 0.0, 0.0, 0);
- if(count < 11) PlayerPlaySound(playerid, 5201, 0.0, 0.0, 0);
- valstr(string, count);
- TextDrawSetString(Textdraw4, string);
- size = size+float(6);
- TextDrawTextSize(Textdraw3, size, 20.000000);
- TextDrawShowForPlayer(playerid, Textdraw3);
- return 1;
- }
- forward rtimer2(playerid, Float:zx, Float:zy, Float:zz);
- public rtimer2(playerid, Float:zx, Float:zy, Float:zz) {
- count = count-1;
- valstr(string, count);
- TextDrawSetString(Textdraw4, string);
- size = size+float(6);
- TextDrawTextSize(Textdraw3, size, 20.000000);
- TextDrawShowForPlayer(playerid, Textdraw3);
- timer = SetTimerEx("rtimer", 1000, 1, "ifff", playerid, zx, zy, zz);
- TextDrawHideForPlayer(playerid, Textdraw9);
- return 1;
- }
- forward rtimer3(playerid, Float:zx, Float:zy, Float:zz);
- public rtimer3(playerid, Float:zx, Float:zy, Float:zz) {
- TextDrawHideForPlayer(playerid, Textdraw9);
- playerstarting[playerid] = false;
- isstarting = false;
- return 1;
- }
- forward rtimer4(Float:zx, Float:zy, Float:zz);
- public rtimer4(Float:zx, Float:zy, Float:zz) {
- DestroyObject(obj);
- obj = CreateObject(354, zx, zy, 500, 0.0, 0.0, 0.0);
- move = MoveObject(obj, zx, zy, zz, 100);
- SetTimerEx("rtimer5", move, 0, "fff", zx, zy, zz);
- return 1;
- }
- forward rtimer5(Float:zx, Float:zy, Float:zz);
- public rtimer5(Float:zx, Float:zy, Float:zz) {
- DestroyObject(obj);
- CreateExplosion(zx, zy, zz, 0, 10.0);
- CreateExplosion(zx, zy, zz+3, 0, 10.0);
- CreateExplosion(zx-3, zy, zz, 0, 10.0);
- CreateExplosion(zx+3, zy, zz, 0, 10.0);
- CreateExplosion(zx, zy-3, zz, 0, 10.0);
- CreateExplosion(zx, zy+3, zz, 0, 10.0);
- CreateExplosion(zx-3, zy+3, zz, 0, 10.0);
- CreateExplosion(zx+3, zy-3, zz, 0, 10.0);
- CreateExplosion(zx-3, zy-3, zz, 0, 10.0);
- CreateExplosion(zx+3, zy+3, zz, 0, 10.0);
- CreateExplosion(zx-6, zy, zz, 0, 10.0);
- CreateExplosion(zx+6, zy, zz, 0, 10.0);
- CreateExplosion(zx, zy-6, zz, 0, 10.0);
- CreateExplosion(zx, zy+6, zz, 0, 10.0);
- CreateExplosion(zx-6, zy+6, zz, 0, 10.0);
- CreateExplosion(zx+6, zy-6, zz, 0, 10.0);
- CreateExplosion(zx-6, zy-6, zz, 0, 10.0);
- CreateExplosion(zx+6, zy+6, zz, 0, 10.0);
- CreateExplosion(zx-9, zy, zz, 0, 10.0);
- CreateExplosion(zx+9, zy, zz, 0, 10.0);
- CreateExplosion(zx, zy-9, zz, 0, 10.0);
- CreateExplosion(zx, zy+9, zz, 0, 10.0);
- CreateExplosion(zx-9, zy+9, zz, 0, 10.0);
- CreateExplosion(zx+9, zy-9, zz, 0, 10.0);
- CreateExplosion(zx-9, zy-9, zz, 0, 10.0);
- CreateExplosion(zx+9, zy+9, zz, 0, 10.0);
- SetTimerEx("rtimer6", 1000, 0, "fff", zx, zy, zz);
- SetTimerEx("rtimer6", 2000, 0, "fff", zx, zy, zz);
- SetTimerEx("rtimer6", 3000, 0, "fff", zx, zy, zz);
- SetTimerEx("rtimer6", 4000, 0, "fff", zx, zy, zz);
- return 1;
- }
- forward rtimer6(Float:zx, Float:zy, Float:zz);
- public rtimer6(Float:zx, Float:zy, Float:zz) {
- CreateExplosion(zx, zy, zz, 0, 10.0);
- CreateExplosion(zx, zy, zz+3, 0, 10.0);
- CreateExplosion(zx-3, zy, zz, 0, 10.0);
- CreateExplosion(zx+3, zy, zz, 0, 10.0);
- CreateExplosion(zx, zy-3, zz, 0, 10.0);
- CreateExplosion(zx, zy+3, zz, 0, 10.0);
- CreateExplosion(zx-3, zy+3, zz, 0, 10.0);
- CreateExplosion(zx+3, zy-3, zz, 0, 10.0);
- CreateExplosion(zx-3, zy-3, zz, 0, 10.0);
- CreateExplosion(zx+3, zy+3, zz, 0, 10.0);
- CreateExplosion(zx-6, zy, zz, 0, 10.0);
- CreateExplosion(zx+6, zy, zz, 0, 10.0);
- CreateExplosion(zx, zy-6, zz, 0, 10.0);
- CreateExplosion(zx, zy+6, zz, 0, 10.0);
- CreateExplosion(zx-6, zy+6, zz, 0, 10.0);
- CreateExplosion(zx+6, zy-6, zz, 0, 10.0);
- CreateExplosion(zx-6, zy-6, zz, 0, 10.0);
- CreateExplosion(zx+6, zy+6, zz, 0, 10.0);
- CreateExplosion(zx-9, zy, zz, 0, 10.0);
- CreateExplosion(zx+9, zy, zz, 0, 10.0);
- CreateExplosion(zx, zy-9, zz, 0, 10.0);
- CreateExplosion(zx, zy+9, zz, 0, 10.0);
- CreateExplosion(zx-9, zy+9, zz, 0, 10.0);
- CreateExplosion(zx+9, zy-9, zz, 0, 10.0);
- CreateExplosion(zx-9, zy-9, zz, 0, 10.0);
- CreateExplosion(zx+9, zy+9, zz, 0, 10.0);
- return 1;
- }
- public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ) {
- if(playerstarting[playerid] == false) return 0;
- if(placed == true) return 0;
- placed = true;
- TextDrawSetString(Textdraw9, "Koordinaten erfolgreich angegeben. Bitte warten!");
- TextDrawHideForPlayer(playerid, Textdraw6);
- TextDrawHideForPlayer(playerid, Textdraw7);
- TextDrawHideForPlayer(playerid, Textdraw8);
- TextDrawShowForPlayer(playerid, Textdraw9);
- MapAndreas_FindZ_For2DCoord(fX, fY, fZ);
- SetTimerEx("rtimer2", 5000, 0, "ifff", playerid, fX, fY, fZ);
- return 1;
- }
- COMMAND:startrocket(playerid,params[]) {
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, 212.4329,1822.8763,6.4141)) return 1;
- if(isstarting) return 0;
- TogglePlayerControllable(playerid, 0);
- isstarting = true;
- playerstarting[playerid] = true;
- TextDrawTextSize(Textdraw3, 170.000000, 20.000000);
- TextDrawSetString(Textdraw4, "50");
- TextDrawSetString(Textdraw5, "Bereite Raketeneinheit vor...");
- size = float(170);
- count = 50;
- TextDrawShowForPlayer(playerid, Textdraw1);
- TextDrawShowForPlayer(playerid, Textdraw2);
- TextDrawShowForPlayer(playerid, Textdraw3);
- TextDrawShowForPlayer(playerid, Textdraw4);
- TextDrawShowForPlayer(playerid, Textdraw5);
- timer = SetTimerEx("rtimer", 1000, 1, "ifff", playerid, float(1), float(1), float(1));
- return 1;
- }
- // Testing commands
- COMMAND:goto(playerid,params[]) {
- SetPlayerPos(playerid,217.8016,1823.1212,6.4141);
- return 1;
- }
- COMMAND:top(playerid,params[]) {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- MapAndreas_FindZ_For2DCoord(x, y, z);
- SetPlayerPos(playerid, x, y, z);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement