gonzalo293

FS - Teleports con dialog

Feb 6th, 2016
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.97 KB | None | 0 0
  1. /*
  2.  
  3.                                         Teleport Con dialogos
  4.  
  5.                                     Desarrollado por Gonzalo293
  6.  
  7. */
  8.  
  9. #define FILTERSCRIPT
  10.  
  11. #include <a_samp> //SA-MP Team
  12. #define Teleport 6000
  13. #if defined FILTERSCRIPT
  14.  
  15. public OnFilterScriptInit()
  16. {
  17.     return 1;
  18. }
  19.  
  20. public OnFilterScriptExit()
  21. {
  22.     return 1;
  23. }
  24.  
  25. #else
  26.  
  27. main()
  28. {
  29.     print("\n-----------------------------------------");
  30.     print(" Teleport en dialog iniciado correctamente ");
  31.     print("           |    Gonzalo 293       |        ");
  32.     print("-----------------------------------------\n");
  33. }
  34.  
  35. #endif
  36. public OnPlayerCommandText(playerid, cmdtext[])
  37. {
  38.     if (strcmp("/teles", cmdtext, true, 10) == 0)
  39.     {
  40.         ShowPlayerDialog(playerid, Teleport, DIALOG_STYLE_LIST, "{80FF00}Teleports","{FFFFFF}Los Santos\n{FFFFFF}Las Venturas\n{FFFFFF}San Fierro","Elegir","Cancelar");
  41.         /*
  42.         Para Agregar otro teleport solo tienen que seguir estos pasos
  43.          1) En ShowPlayerDialog que se encuentra en OnPlayerCommandText en el comando /teles agregan entre las comillas otro teleport con este formato
  44.          \n{FFFFFF}AreoLS"
  45.          2) Para que tenga una funcion debemos ir a OnDialogResponse y agregar en "switch (listitem)"
  46.              case 3://En orden cronologico
  47.             {
  48.             SetPlayerPos(playerid,2070.808837, -2540.801269, 13.546875);//AREOLS
  49.             }
  50.  
  51.         Si desean un GameText en la pantalla pueden agregar esta linea
  52.        
  53.  
  54.         Ej:
  55.  
  56.          case 3://En orden cronologico
  57.             {
  58.             SetPlayerPos(playerid,2070.808837, -2540.801269, 13.546875);//AREOLS
  59.             GameTextForPlayer(playerid,"_~n~_~n~_~n~_~n~_~n~~w~Bienvenido a ~g~ Areopuerto Los Santos",2000,6);
  60.             }
  61.         Si quieren la funcion de Vehiculo solo agregen esta linea
  62.         TeleportConVehiculo(playerid,2070.808837, -2540.801269, 13.546875);
  63.  
  64.         Ej:
  65.         case 3://En orden cronologico
  66.             {
  67.             SetPlayerPos(playerid,2070.808837, -2540.801269, 13.546875);//AREOLS
  68.             GameTextForPlayer(playerid,"_~n~_~n~_~n~_~n~_~n~~w~Bienvenido a ~g~ Areopuerto Los Santos",2000,6);
  69.             TeleportConVehiculo(playerid,2070.808837, -2540.801269, 13.546875);
  70.             }
  71.  
  72.         */
  73.         return 1;
  74.     }
  75.     return 0;
  76. }
  77. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  78. {
  79. if(dialogid == Teleport)
  80. {
  81. if(response)
  82. {
  83. switch (listitem)
  84. {
  85.     case 0:
  86.     {
  87.     GameTextForPlayer(playerid,"_~n~_~n~_~n~_~n~_~n~~w~Bienvenido a ~r~ Los Santos",2000,6);
  88.     SetPlayerPos(playerid,2488.967285, -1660.400878, 13.335947);//Los Santos
  89.     //TeleportConVehiculo(playerid,-1982.059326, 141.511825, 27.687500);//Descomentar si quieren la funcion de tp con vehiculo activada
  90.     }
  91.     case 1:
  92.     {
  93.     GameTextForPlayer(playerid,"_~n~_~n~_~n~_~n~_~n~~w~Bienvenido a ~g~ Las Venturas",2000,6);
  94.     SetPlayerPos(playerid,2056.747802, 843.434692, 6.703125);//Las Venturas
  95.     //TeleportConVehiculo(playerid,-1982.059326, 141.511825, 27.687500);//Descomentar si quieren la funcion de tp con vehiculo activada
  96.     }
  97.     case 2:
  98.     {
  99.     GameTextForPlayer(playerid,"_~n~_~n~_~n~_~n~_~n~~w~Bienvenido a ~y~ San Fierro",2000,6);
  100.     SetPlayerPos(playerid,-1982.059326, 141.511825, 27.687500);//San Fierro
  101.     //TeleportConVehiculo(playerid,-1982.059326, 141.511825, 27.687500);//Descomentar si quieren la funcion de tp con vehiculo activada
  102.     }
  103.     }
  104.     }
  105. }
  106. return 1;
  107. }
  108. stock TeleportConVehiculo(playerid, Float:x,Float:y,Float:z)
  109. {
  110. new cartype = GetPlayerVehicleID(playerid);
  111. new State=GetPlayerState(playerid);
  112. if(State!=PLAYER_STATE_DRIVER)
  113. {
  114. SetPlayerPos(playerid,x,y,z);
  115. }
  116. else if(IsPlayerInVehicle(playerid, cartype) == 1)
  117. {
  118. SetVehiclePos(cartype,x,y,z);
  119. }
  120. else
  121. {
  122. SetPlayerPos(playerid,x,y,z);
  123. }
  124. }
  125. /*
  126.  
  127.                         Teleport Con dialogos, echo y realizado por: Gonzalo293 :D
  128.  
  129.                                   Por favor no remover creditos, encerio.
  130.  
  131.                                                 2016
  132. */
Advertisement
Add Comment
Please, Sign In to add comment