Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Teleport Con dialogos
- Desarrollado por Gonzalo293
- */
- #define FILTERSCRIPT
- #include <a_samp> //SA-MP Team
- #define Teleport 6000
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n-----------------------------------------");
- print(" Teleport en dialog iniciado correctamente ");
- print(" | Gonzalo 293 | ");
- print("-----------------------------------------\n");
- }
- #endif
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/teles", cmdtext, true, 10) == 0)
- {
- ShowPlayerDialog(playerid, Teleport, DIALOG_STYLE_LIST, "{80FF00}Teleports","{FFFFFF}Los Santos\n{FFFFFF}Las Venturas\n{FFFFFF}San Fierro","Elegir","Cancelar");
- /*
- Para Agregar otro teleport solo tienen que seguir estos pasos
- 1) En ShowPlayerDialog que se encuentra en OnPlayerCommandText en el comando /teles agregan entre las comillas otro teleport con este formato
- \n{FFFFFF}AreoLS"
- 2) Para que tenga una funcion debemos ir a OnDialogResponse y agregar en "switch (listitem)"
- case 3://En orden cronologico
- {
- SetPlayerPos(playerid,2070.808837, -2540.801269, 13.546875);//AREOLS
- }
- Si desean un GameText en la pantalla pueden agregar esta linea
- Ej:
- case 3://En orden cronologico
- {
- SetPlayerPos(playerid,2070.808837, -2540.801269, 13.546875);//AREOLS
- GameTextForPlayer(playerid,"_~n~_~n~_~n~_~n~_~n~~w~Bienvenido a ~g~ Areopuerto Los Santos",2000,6);
- }
- Si quieren la funcion de Vehiculo solo agregen esta linea
- TeleportConVehiculo(playerid,2070.808837, -2540.801269, 13.546875);
- Ej:
- case 3://En orden cronologico
- {
- SetPlayerPos(playerid,2070.808837, -2540.801269, 13.546875);//AREOLS
- GameTextForPlayer(playerid,"_~n~_~n~_~n~_~n~_~n~~w~Bienvenido a ~g~ Areopuerto Los Santos",2000,6);
- TeleportConVehiculo(playerid,2070.808837, -2540.801269, 13.546875);
- }
- */
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == Teleport)
- {
- if(response)
- {
- switch (listitem)
- {
- case 0:
- {
- GameTextForPlayer(playerid,"_~n~_~n~_~n~_~n~_~n~~w~Bienvenido a ~r~ Los Santos",2000,6);
- SetPlayerPos(playerid,2488.967285, -1660.400878, 13.335947);//Los Santos
- //TeleportConVehiculo(playerid,-1982.059326, 141.511825, 27.687500);//Descomentar si quieren la funcion de tp con vehiculo activada
- }
- case 1:
- {
- GameTextForPlayer(playerid,"_~n~_~n~_~n~_~n~_~n~~w~Bienvenido a ~g~ Las Venturas",2000,6);
- SetPlayerPos(playerid,2056.747802, 843.434692, 6.703125);//Las Venturas
- //TeleportConVehiculo(playerid,-1982.059326, 141.511825, 27.687500);//Descomentar si quieren la funcion de tp con vehiculo activada
- }
- case 2:
- {
- GameTextForPlayer(playerid,"_~n~_~n~_~n~_~n~_~n~~w~Bienvenido a ~y~ San Fierro",2000,6);
- SetPlayerPos(playerid,-1982.059326, 141.511825, 27.687500);//San Fierro
- //TeleportConVehiculo(playerid,-1982.059326, 141.511825, 27.687500);//Descomentar si quieren la funcion de tp con vehiculo activada
- }
- }
- }
- }
- return 1;
- }
- stock TeleportConVehiculo(playerid, Float:x,Float:y,Float:z)
- {
- new cartype = GetPlayerVehicleID(playerid);
- new State=GetPlayerState(playerid);
- if(State!=PLAYER_STATE_DRIVER)
- {
- SetPlayerPos(playerid,x,y,z);
- }
- else if(IsPlayerInVehicle(playerid, cartype) == 1)
- {
- SetVehiclePos(cartype,x,y,z);
- }
- else
- {
- SetPlayerPos(playerid,x,y,z);
- }
- }
- /*
- Teleport Con dialogos, echo y realizado por: Gonzalo293 :D
- Por favor no remover creditos, encerio.
- 2016
- */
Advertisement
Add Comment
Please, Sign In to add comment