Advertisement
Guest User

[FS] Dialog Teleport

a guest
Sep 27th, 2012
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.46 KB | None | 0 0
  1. //>> [Tutorial]:How to make a "Teleport in Dialog" - ZCMD
  2. //>> Credit to , Zeex -ZCMD , SA-MP Dev Team - a_samp
  3.  
  4. //>> include's
  5. #include a_samp
  6. #include zcmd
  7.  
  8. //>> color's define
  9. #define COLOR_GRAY 0xCECECEFF
  10.  
  11. #if defined FILTERSCRIPT
  12.  
  13. public OnFilterScriptInit()
  14. {
  15. print("\n--------------------------------------");
  16. print(" Teleport in Dialog");
  17. print("--------------------------------------\n");
  18. return 1;
  19. }
  20.  
  21. public OnFilterScriptExit()
  22. {
  23. return 1;
  24. }
  25.  
  26. #endif
  27.  
  28. //------------------------------< ZEEXCOMMANDS >------------------------------//
  29. CMD:teleport(playerid, params[])
  30. {
  31. ShowPlayerDialog(playerid, 1997, DIALOG_STYLE_LIST, "Teleport System by Sanel", "San Fierro\nLos Santos\nLas Venturas", "Teleport", "Izadji"); // Dialogid 1997 ? you can change it or maybe define it . .
  32. //ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[]);
  33. return 1;
  34. }
  35. //----------------------------------------------------------------------------//
  36. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  37. {
  38. if(dialogid == 1997) // Check the Dialogid
  39. {
  40. switch(listitem) //the list of the item you have in the Dialog ..
  41. {
  42. case 0: // case 0; is for San Fierro teleport . .
  43. {
  44. new vehicleid = GetPlayerVehicleID(playerid); // check the vehicleID
  45. new State = GetPlayerState(playerid); // Get the playerState
  46. if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER) // this will teleport you & your car if you are the driver...
  47. //if you are not the driver or you maybe a passenger u will just teleport without car ..
  48. {
  49. LinkVehicleToInterior(vehicleid,0); //Linkvehicle to interior,this is like SetPlayerInterior . .
  50. SetPlayerInterior(playerid,0); //this will set the playerinterior
  51. SetVehicleZAngle(vehicleid,227.2756); //this is the angle of your vehicle
  52. SetCameraBehindPlayer(playerid); //this will set the camera behind you
  53. SetVehiclePos(vehicleid,-1986.5483,305.5474,35.0071); //this is the vehicle Pos , Float:X , Float:Y , Float:Z
  54. return SendClientMessage(playerid, COLOR_GRAY, "[BG-RP]:Teleportovo si se do San Fierro!");//this will send u a Message when u was Teleported!. .
  55. }
  56. SetPlayerPos(playerid,-1969.0593,294.0901,35.1719);//this is the Player Pos , Float:X , Float:Y , Float:Z
  57. SetPlayerFacingAngle(playerid,89.9102); //this is the angle of your player
  58. SetPlayerInterior(playerid,0);//this will set the playerinterior
  59. SetCameraBehindPlayer(playerid);//this will set the camera behind you
  60. SendClientMessage(playerid, COLOR_GRAY, "[BG-RP]:Teleportovo si se do San Fierro!"); //this will send u a Message when u was Teleported!. .
  61. }
  62. case 1: // case 1; is for Los Santos teleport . .
  63. {
  64. new vehicleid = GetPlayerVehicleID(playerid);// check the vehicleID
  65. new State = GetPlayerState(playerid);// Get the playerState
  66. if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER) // this will teleport you & your car if you are the driver...
  67. //if you are not the driver or you maybe a passenger u will just teleport without car ..
  68. {
  69. LinkVehicleToInterior(vehicleid,0);//Linkvehicle to interior,this is like SetPlayerInterior . .
  70. SetPlayerInterior(playerid,0);//this will set the playerinterior
  71. SetVehicleZAngle(vehicleid,179.2136);//this is the angle of your vehicle
  72. SetCameraBehindPlayer(playerid);//this will set the camera behind you
  73. SetVehiclePos(vehicleid,1608.3900,-1719.7670,13.3786); //this is the vehicle Pos , Float:X , Float:Y , Float:Z
  74. return SendClientMessage(playerid, COLOR_GRAY, "[BG-RP]:Teleportovo si se do Los Santos!");//this will send u a Message when u was Teleported!. .
  75. }
  76. SetPlayerPos(playerid,1606.3514,-1739.5194,13.5469);//this is the Player Pos , Float:X , Float:Y , Float:Z
  77. SetPlayerFacingAngle(playerid,42.2198); //this is the angle of your player
  78. SetPlayerInterior(playerid,0);//this will set the playerinterior
  79. SetCameraBehindPlayer(playerid);//this will set the camera behind you
  80. SendClientMessage(playerid, COLOR_GRAY, "[BG-RP]:Teleportovo si se do Los Santos!");//this will send u a Message when u was Teleported!. .
  81. }
  82. case 2: // case 2; is for Las Venturas teleport . .
  83. {
  84. new vehicleid = GetPlayerVehicleID(playerid);// check the vehicleID
  85. new State = GetPlayerState(playerid);// Get the playerState
  86. if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)// this will teleport you & your car if you are the driver...
  87. //if you are not the driver or you maybe a passenger u will just teleport without car ..
  88. {
  89. LinkVehicleToInterior(vehicleid,0);//Linkvehicle to interior,this is like SetPlayerInterior . .
  90. SetPlayerInterior(playerid,0);//this will set the playerinterior
  91. SetVehicleZAngle(vehicleid,88.7952);//this is the angle of your vehicle
  92. SetCameraBehindPlayer(playerid);//this will set the camera behind you
  93. SetVehiclePos(vehicleid,2128.2754,1333.6340,10.6558);//this is the vehicle Pos , Float:X , Float:Y , Float:Z
  94. return SendClientMessage(playerid, COLOR_GRAY, "[BG-RP]:Teleportovo si se do Las Venturas!");//this will send u a Message when u was Teleported!. .
  95. }
  96. SetPlayerPos(playerid,2096.9543,1322.6205,10.8203);//this is the Player Pos , Float:X , Float:Y , Float:Z
  97. SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
  98. SetPlayerInterior(playerid,0);//this will set the playerinterior
  99. SetCameraBehindPlayer(playerid);//this will set the camera behind you
  100. SendClientMessage(playerid, COLOR_GRAY, "[BG-RP]:Teleportovo si se do Las Venturas!");//this will send u a Message when u was Teleported!. .
  101. }
  102. //Case 3: //add your other tp
  103. }
  104. //your code
  105. }
  106. return 1;
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement