Advertisement
xTurbox

Interior Teleport System v2.0

Sep 10th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 13.80 KB | None | 0 0
  1. /*==============================================================================
  2. Credits
  3. ==============================================================================
  4. http://boylett.com/scripts/autoindent.php       <--- For fixing 3 loose intended warnings, thus making the script look more neater and readable
  5. http://weedarr.wikidot.com/interior             <--- For interior IDs
  6. http://wiki.sa-mp.com/                          <--- For the usage of GameTextForPlayer,public OnDialogResponse and a lot more
  7. http://forum.sa-mp.com/showthread.php?t=91354   <--- Zeex For ZCMD
  8. http://forum.sa-mp.com/showthread.php?t=576114  <--- Yashas For I-ZCMD(which i used)*/
  9.  
  10. //==============================================================================
  11. // Includes
  12. //==============================================================================
  13.  
  14. #include <a_samp>
  15. #include <izcmd>
  16. #include <sscanf2>
  17. //==============================================================================
  18. // Defines
  19. //==============================================================================
  20.  
  21. #define FILTERSCRIPT
  22.  
  23. //_________________________________Options______________________________________
  24. #define ADMIN       IsPlayerAdmin(playerid)//change line to match your admin system at the moment it is rcon admin
  25. #define ONLY_ADMIN  true //Change true to false if you want every one to use the cmds
  26. #define TELE_DIALOG 7323//Change this number to change the dialog number
  27.  
  28. //________________________________COLORS________________________________________
  29. #define RED     0xFF0000FF
  30. #define GREEN   0x00FF00FF
  31. #define BLUE    0x0000FFFF
  32.  
  33.  
  34. //_____________________________Short forms______________________________________
  35. #define SCM         SendClientMessage
  36. #define VEH         IsPlayerInAnyVehicle
  37. #define SPP         SetPlayerPos
  38. #define SPI         SetPlayerInterior
  39. #define GT          GameTextForPlayer
  40. #define RPW         ResetPlayerWeapons
  41.  
  42. #if defined FILTERSCRIPT
  43.  
  44. //==============================================================================
  45. // Call Backs
  46. //==============================================================================
  47.  
  48. public OnFilterScriptInit()
  49. {
  50.     print("\n===================================================================");
  51.     print("____________Interior Teleport system by TURBO loading....____________");
  52.     print("________Interior Teleport system by TURBO Successfully Loaded________");
  53.     print("=====================================================================\n");
  54.     return 1;
  55. }
  56.  
  57. public OnFilterScriptExit()
  58. {
  59.     print("\n===================================================================");
  60.     print("____________Interior Teleport system by TURBO Unloading....____________");
  61.     print("________Interior Teleport system by TURBO Successfully Unloaded________");
  62.     print("=====================================================================\n");
  63.     return 1;
  64. }
  65. #endif
  66. //commands
  67. CMD:intcredits(playerid,params[])
  68. {
  69.     SCM(playerid,BLUE,"Interior Teleport System FS(filterscript)");
  70.     SCM(playerid,BLUE,"Was made by Turbo");
  71.     SCM(playerid,BLUE,"Special thanks to: http://weedarr.wikidot.com for interior ids");
  72.     SCM(playerid,BLUE,"Special thanks to: Zeex for zcmd(Yashas for i-zcmd)");
  73.     return 1;
  74.  
  75. }
  76. CMD:inttele(playerid,params[])
  77. {
  78.     #if ONLY_ADMIN == true
  79.     if(!ADMIN) return 0;
  80.     #endif
  81.     ShowPlayerDialog(playerid,TELE_DIALOG,DIALOG_STYLE_LIST,"Interior Teleports","Shamal\nAndromeda\nAmmunation booths\nAmmunation range\nArea51\nlibertycityoutside\nlibertycityinside\nwarehouse 1\nwarehouse 2\nbank\ndirt track\npleasure domes\nbattle field\nSan Fierro Police HQ\nLos Santos Police HQ\nLas Ventras Police HQ\n8track\nBlood bowl\nKickstart\nHiddenroom","Select","Close");
  82.     return 1;
  83.  
  84. }
  85. CMD:intcmds(playerid,params[])
  86. {
  87.     SCM(playerid,BLUE,"/inttele:    Displays the list of teleports");
  88.     SCM(playerid,BLUE,"/intcmds:    Displays the interior teleport related commands");
  89.     SCM(playerid,BLUE,"/killme:     Kills yourself(once you teleport you cannot come back, use this cmd instead");
  90.     SCM(playerid,BLUE,"/intcredits: Displays the credits of interior teleport");
  91.     SCM(playerid,BLUE,"/adminkill:  kills the player specified");
  92.     return 1;
  93.  
  94. }
  95.  
  96. CMD:killme(playerid,params[])
  97. {
  98.     SetPlayerHealth(playerid,0);
  99.     SendClientMessage(playerid,RED,"You have killed your self");
  100.     GameTextForPlayer(playerid,"~r~You killed your self",10000,2);
  101.     return 1;
  102.  
  103. }
  104. CMD:adminkill(playerid,params[])
  105. {
  106.     if(!ADMIN) return 0;
  107.  
  108.  
  109.     {
  110.         new id,string[128];
  111.         if(sscanf(params, "u", id)) return SCM(playerid,RED, "[ERROR]:/adminkill [ID]");
  112.         if(!IsPlayerConnected(id)) return SCM(playerid,RED, "[ERROR]: Wrong ID!");
  113.         SetPlayerHealth(id,0);
  114.         GameTextForPlayer(id,"Admin killed you",10000,2);
  115.         SCM(id,GREEN,"Admin has killed you");
  116.         format(string,sizeof(string),"You killed player %s!",GetName(playerid));
  117.         SCM(playerid,BLUE,string);
  118.         format(string,sizeof(string),"[ADMIN]Has killed %s!",GetName(id));
  119.         SendClientMessageToAll(GREEN,string);
  120.  
  121.  
  122.     }
  123.     return 1;
  124. }
  125. stock GetName(playerid)
  126. {
  127.     new name[MAX_PLAYER_NAME];
  128.     GetPlayerName(playerid, name, sizeof(name));
  129.     return name;
  130. }
  131. CMD:gotopos(playerid, params[])
  132. {
  133.     if(!ADMIN) return 0;
  134.     new Float:POS[3];
  135.     if(sscanf(params, "fff", POS[0], POS[1], POS[2])) return SendClientMessage(playerid,RED, "[ERROR]: /gotopos X Y Z (note just spaces no , or - between coordinates");
  136.     SetPlayerPos(playerid, POS[0], POS[1], POS[2]);
  137.     return 1;
  138. }
  139. // Functions of dialogs
  140. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  141. {
  142.     if(dialogid == TELE_DIALOG)
  143.  
  144.  
  145.     {
  146.         if(response)
  147.  
  148.  
  149.         {
  150.             switch(listitem)
  151.  
  152.  
  153.             {
  154.                 case 0:
  155.  
  156.  
  157.                 {
  158.                     if(VEH(playerid))
  159.  
  160.  
  161.                     {
  162.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  163.  
  164.  
  165.                     }
  166.                     else
  167.  
  168.  
  169.                     {
  170.                         SPP(playerid,1.808619,32.384357,1199.59375);
  171.                         SPI(playerid,1);
  172.                         SCM(playerid,GREEN,"You have teleported to shamal interior successfully");
  173.                         GT(playerid,"~b~Welcome to~r~ shamal",5000,3);
  174.  
  175.  
  176.                     }
  177.  
  178.  
  179.                 }
  180.                 case 1:
  181.  
  182.  
  183.                 {
  184.                     if(VEH(playerid))
  185.  
  186.  
  187.                     {
  188.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  189.  
  190.  
  191.                     }
  192.                     else
  193.  
  194.  
  195.                     {
  196.                         SPP(playerid,315.745086,984.969299,1958.919067);
  197.                         SPI(playerid,9);
  198.                         SCM(playerid,GREEN,"You have teleported to andromada interior successfully");
  199.                         GT(playerid,"~b~Welcome to~r~ andromada",5000,3);
  200.  
  201.  
  202.                     }
  203.  
  204.  
  205.                 }
  206.                 case 2:
  207.  
  208.  
  209.                 {
  210.                     if(VEH(playerid))
  211.  
  212.  
  213.                     {
  214.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  215.  
  216.  
  217.                     }
  218.                     else
  219.  
  220.  
  221.                     {
  222.                         SPP(playerid,302.292877,-143.139099,1004.062500);
  223.                         SPI(playerid,7);
  224.                         SCM(playerid,GREEN,"You have teleported to ammunation booths successfully");
  225.                         GT(playerid,"~b~Welcome to~r~ ammunation booths",5000,3);
  226.  
  227.  
  228.                     }
  229.  
  230.  
  231.                 }
  232.                 case 3:
  233.  
  234.  
  235.                 {
  236.                     if(VEH(playerid))
  237.  
  238.  
  239.                     {
  240.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  241.  
  242.  
  243.                     }
  244.                     else
  245.  
  246.  
  247.                     {
  248.                         SPP(playerid,298.507934,-141.647048,1004.054748);
  249.                         SPI(playerid,7);
  250.                         SCM(playerid,GREEN,"You have teleported to ammunation range successfully");
  251.                         GT(playerid,"~b~Welcome to~r~ ammunation range",5000,3);
  252.  
  253.  
  254.                     }
  255.  
  256.  
  257.                 }
  258.                 case 4:
  259.  
  260.  
  261.                 {
  262.                     if(VEH(playerid))
  263.  
  264.  
  265.                     {
  266.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  267.  
  268.  
  269.                     }
  270.                     else
  271.  
  272.  
  273.                     {
  274.                         SPP(playerid,223.431976,1872.400268,13.73437);
  275.                         SPI(playerid,0);
  276.                         SCM(playerid,GREEN,"You have teleported to Area 51 successfully");
  277.                         GT(playerid,"~b~Welcome to~r~ area 51",5000,3);
  278.  
  279.  
  280.                     }
  281.  
  282.  
  283.                 }
  284.                 case 5:
  285.  
  286.  
  287.                 {
  288.                     if(VEH(playerid))
  289.  
  290.  
  291.                     {
  292.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  293.  
  294.  
  295.                     }
  296.                     else
  297.  
  298.  
  299.                     {
  300.                         SPP(playerid,-729.276000,503.086944,1371.971801);
  301.                         SPI(playerid,1);
  302.                         SCM(playerid,GREEN,"You have teleported to Liberty City Outside successfully");
  303.                         GT(playerid,"~b~Welcome to~r~ Liberty City ~n~ ~g~Outside",5000,3);
  304.  
  305.  
  306.                     }
  307.  
  308.  
  309.                 }
  310.                 case 6:
  311.  
  312.  
  313.                 {
  314.                     if(VEH(playerid))
  315.  
  316.  
  317.                     {
  318.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  319.  
  320.  
  321.                     }
  322.                     else
  323.  
  324.  
  325.                     {
  326.                         SPP(playerid,-794.806396,497.738037,1376.195312);
  327.                         SPI(playerid,1);
  328.                         SCM(playerid,GREEN,"You have teleported to Liberty City Inside successfully");
  329.                         GT(playerid,"~b~Welcome to~r~ Liberty City ~n~ ~g~Inside",5000,3);
  330.  
  331.  
  332.                     }
  333.  
  334.  
  335.                 }
  336.                 case 7:
  337.  
  338.  
  339.                 {
  340.                     if(VEH(playerid))
  341.  
  342.  
  343.                     {
  344.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  345.  
  346.  
  347.                     }
  348.                     else
  349.  
  350.  
  351.                     {
  352.                         SPP(playerid,1412.639892,-1.787510,1000.924377);
  353.                         SPI(playerid,1);
  354.                         SCM(playerid,GREEN,"You have teleported to WareHouse 1 successfully");
  355.                         GT(playerid,"~b~Welcome to~r~ WareHouse 1",5000,3);
  356.  
  357.  
  358.                     }
  359.  
  360.  
  361.                 }
  362.                 case 8:
  363.  
  364.  
  365.                 {
  366.                     if(VEH(playerid))
  367.  
  368.  
  369.                     {
  370.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  371.  
  372.  
  373.                     }
  374.                     else
  375.  
  376.  
  377.                     {
  378.                         SPP(playerid,1302.519897,-1.787510,1001.028259);
  379.                         SPI(playerid,18);
  380.                         SCM(playerid,GREEN,"You have teleported to WareHouse 2 successfully");
  381.                         GT(playerid,"~b~Welcome to~r~ WareHouse 2",5000,3);
  382.  
  383.  
  384.                     }
  385.  
  386.  
  387.                 }
  388.                 case 9:
  389.  
  390.  
  391.                 {
  392.                     if(VEH(playerid))
  393.  
  394.  
  395.                     {
  396.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  397.  
  398.  
  399.                     }
  400.                     else
  401.  
  402.  
  403.                     {
  404.                         SPP(playerid,2315.952880,-1.618174,26.742187);
  405.                         SPI(playerid,0);
  406.                         SCM(playerid,GREEN,"You have teleported to Bank interior successfully");
  407.                         GT(playerid,"~b~Welcome to~r~ Bank",5000,3);
  408.  
  409.  
  410.                     }
  411.  
  412.  
  413.                 }
  414.                 case 10:
  415.  
  416.  
  417.                 {
  418.                     if(VEH(playerid))
  419.  
  420.  
  421.                     {
  422.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  423.  
  424.  
  425.                     }
  426.                     else
  427.  
  428.  
  429.                     {
  430.                         SPP(playerid,-1444.645507,-664.526000,1053.572998);
  431.                         SPI(playerid,4);
  432.                         SCM(playerid,GREEN,"You have teleported to Dirt Track successfully");
  433.                         GT(playerid,"~b~Welcome to~r~ Dirt Track",5000,3);
  434.  
  435.  
  436.                     }
  437.  
  438.  
  439.                 }
  440.                 case 11:
  441.  
  442.  
  443.                 {
  444.                     if(VEH(playerid))
  445.  
  446.  
  447.                     {
  448.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  449.  
  450.  
  451.                     }
  452.                     else
  453.  
  454.  
  455.                     {
  456.                         SPP(playerid,-2640.762939,1406.682006,906.460937);
  457.                         SPI(playerid,3);
  458.                         SCM(playerid,GREEN,"You have teleported to Pleasure Domes successfully");
  459.                         GT(playerid,"~b~Welcome to~r~ Pleasure Domes",5000,3);
  460.  
  461.  
  462.                     }
  463.  
  464.  
  465.                 }
  466.                 case 12:
  467.  
  468.  
  469.                 {
  470.                     if(VEH(playerid))
  471.  
  472.  
  473.                     {
  474.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  475.  
  476.  
  477.                     }
  478.                     else
  479.  
  480.  
  481.                     {
  482.                         SPP(playerid,-975.975708,1060.983032,1345.671875);
  483.                         SPI(playerid,10);
  484.                         SCM(playerid,GREEN,"You have teleported to RC battle field successfully");
  485.                         GT(playerid,"~b~Welcome to~r~ Battle field",5000,3);
  486.  
  487.  
  488.                     }
  489.  
  490.  
  491.                 }
  492.                 case 13:
  493.  
  494.  
  495.                 {
  496.                     if(VEH(playerid))
  497.  
  498.  
  499.                     {
  500.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  501.  
  502.  
  503.                     }
  504.                     else
  505.  
  506.  
  507.                     {
  508.                         SPP(playerid,246.375991,109.245994,1003.218750);
  509.                         SPI(playerid,10);
  510.                         SCM(playerid,GREEN,"You have teleported to Sanfierro Police HQ successfully");
  511.                         GT(playerid,"~b~Welcome to~r~ SF Police HQ",5000,3);
  512.  
  513.  
  514.                     }
  515.  
  516.  
  517.                 }
  518.                 case 14:
  519.  
  520.  
  521.                 {
  522.                     if(VEH(playerid))
  523.  
  524.  
  525.                     {
  526.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  527.  
  528.  
  529.                     }
  530.                     else
  531.  
  532.  
  533.                     {
  534.                         SPP(playerid,246.783996,63.900199,1003.640625);
  535.                         SPI(playerid,6);
  536.                         SCM(playerid,GREEN,"You have teleported to Los Santos Police HQ successfully");
  537.                         GT(playerid,"~b~Welcome to~r~ LS Police HQ",5000,3);
  538.  
  539.  
  540.                     }
  541.  
  542.  
  543.                 }
  544.                 case 15:
  545.  
  546.  
  547.                 {
  548.                     if(VEH(playerid))
  549.  
  550.  
  551.                     {
  552.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  553.  
  554.  
  555.                     }
  556.                     else
  557.  
  558.  
  559.                     {
  560.                         SPP(playerid,288.745971,169.350997,1007.171875);
  561.                         SPI(playerid,3);
  562.                         SCM(playerid,GREEN,"You have teleported to Las Venturas Police HQ successfully");
  563.                         GT(playerid,"~b~Welcome to~r~ LV Police HQ",5000,3);
  564.  
  565.  
  566.                     }
  567.  
  568.  
  569.                 }
  570.                 case 16:
  571.  
  572.  
  573.                 {
  574.                     if(VEH(playerid))
  575.  
  576.  
  577.                     {
  578.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  579.  
  580.  
  581.                     }
  582.                     else
  583.  
  584.  
  585.                     {
  586.                         SPP(playerid,-1398.065307,-217.028900,1051.115844);
  587.                         SPI(playerid,7);
  588.                         SCM(playerid,GREEN,"You have teleported to 8-Track successfully");
  589.                         GT(playerid,"~b~Welcome to~r~ 8-Track",5000,3);
  590.  
  591.  
  592.                     }
  593.  
  594.  
  595.                 }
  596.                 case 17:
  597.  
  598.  
  599.                 {
  600.                     if(VEH(playerid))
  601.  
  602.  
  603.                     {
  604.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  605.  
  606.  
  607.                     }
  608.                     else
  609.  
  610.  
  611.                     {
  612.                         SPP(playerid,-1398.103515,937.631164,1036.479125);
  613.                         SPI(playerid,15);
  614.                         SCM(playerid,GREEN,"You have teleported to BloodBowl successfully");
  615.                         GT(playerid,"~b~Welcome to~r~ BloodBowl",5000,3);
  616.  
  617.  
  618.                     }
  619.  
  620.  
  621.                 }
  622.                 case 18:
  623.  
  624.                 {
  625.                     if(VEH(playerid))
  626.  
  627.                     {
  628.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  629.  
  630.                     }
  631.                     else
  632.  
  633.                     {
  634.                         SPP(playerid,-1465.268676,1557.868286,1052.531250);
  635.                         SPI(playerid,14);
  636.                         SCM(playerid,GREEN,"You have teleported to KickStart successfully");
  637.                         GT(playerid,"~b~Welcome to~r~ KickStart",5000,3);
  638.  
  639.                     }
  640.  
  641.                 }
  642.                 case 19:
  643.  
  644.                 {
  645.                     if(VEH(playerid))
  646.  
  647.                     {
  648.                         SCM(playerid,RED,"[ERROR]:You cannot use this command while in a vehicle");
  649.  
  650.                     }
  651.                     else
  652.  
  653.                     {
  654.                         SPP(playerid,2131.507812,1600.818481,1008.359375);
  655.                         SPI(playerid,1);
  656.                         SCM(playerid,GREEN,"You have teleported to hidden room successfully");
  657.                         GT(playerid,"~b~Welcome to~r~ Hidden Room",5000,3);
  658.  
  659.                     }
  660.  
  661.                 }
  662.  
  663.  
  664.  
  665.  
  666.             }
  667.             return 1;
  668.  
  669.         }
  670.  
  671.     }
  672.     return 0;
  673.  
  674. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement