Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*-----------------------------------------------------------
- ------------------------------ BSN Park ---------------------
- --------------------------- von Ciber007 --------------------
- -------------------------------------------------------------*/
- /* Neues in Version 2.0 :
- - Aufzug nun mit Men�.
- - Pickups an den entsprechenden Men�stellen.
- Negatives:
- - Men� sieht man nur wenn man l�uft.
- - Men� wird einmal unten und Oben angezeigt aber man kann einfach weiterfahren.
- Verbesserungsvorschlag:
- - Wer will kann die Befehle von Version 1.0 einbauen sodass man im Auto nur /hoch eingeben muss.
- */
- //------------------------------- Includes -------------------------------
- #include <a_samp>
- //------------------------------- Filterscript definieren ----------------
- #define FILTERSCRIPT
- #if defined FILTERSCRIPT
- //------------------------------- Farben definieren ----------------------
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_RED 0xAA3333AA
- //------------------------------- Pickups,Men�s,Objecte ------------------
- new Park;
- new Unten;
- new Oben;
- new Menu:BSN;
- #pragma tabsize 0
- //------------------------------- PlayerToPoint ---------------------------
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- 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);
- //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- }
- return 0;
- }
- public OnFilterScriptInit()
- {
- CreateObject(971, 1181.533569, -897.506592, 47.013580, 90.2409, 4.2972, 3.4377);// BSN Park
- CreateObject(971, 1183.869263, -911.674988, 46.826981, 90.2409, 4.2972, 4.2972);//BSN Park
- CreateObject(4639, 1183.000854, -910.254700, 43.990814, 0.0000, 0.0000, 186.0934);// BSN Park
- Park = CreateObject(971, 1182.252441, -904.438293, 42.308212, 90.2409, 4.2972, 3.4377);// Aufzug
- Oben = CreatePickup(1239,1,1181.9728,-904.4827,48.1644);//Men� Pickup Oben
- Unten = CreatePickup(1239,1,1181.9728,-904.4827,43.4915);//Men� Pickup Unten
- BSN = CreateMenu("BSN", 2, 200.0, 100.0, 150.0, 150.0);//Men�
- AddMenuItem(BSN, 0 ,"Hoch fahren (100$)");//Men� Auswahl 1
- AddMenuItem(BSN, 0 ,"Runter fahren");//Men� Auswahl 2
- AddMenuItem(BSN, 0 ,"Exit");//Men� Auswahl 3
- print("\n--------------------------------------");
- print(" BSN Park v.2.0 Script von Ciber007");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- DestroyMenu(BSN);
- return 1;
- }
- #else
- main()
- #endif
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == Oben)
- {
- ShowMenuForPlayer(BSN,playerid);
- }
- if(pickupid == Unten)
- {
- ShowMenuForPlayer(BSN,playerid);
- }
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- new Menu:CurrentMenu = GetPlayerMenu(playerid);
- if(CurrentMenu == BSN)
- {
- switch(row)
- {
- case 0: //Hoch
- {
- SendClientMessage(playerid, COLOR_RED, "Der Aufzug f�hrt Hoch!");
- GivePlayerMoney(playerid,-100);
- MoveObject(Park,1182.568237, -904.536377, 46.980690, 3.5);
- }
- case 1: //Runter
- {
- SendClientMessage(playerid, COLOR_RED, "Der Aufzug f�hrt runter!");
- MoveObject(Park,1182.252441, -904.438293, 42.308212, 3.5);
- }
- case 2: //Exit
- {
- HideMenuForPlayer(BSN,playerid);
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment