Advertisement
Guest User

Simple Teleport Filterscript [SAMP]

a guest
Apr 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.05 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6. #include <a_samp>
  7. #include <zcmd>
  8. #include <sscanf>
  9.  
  10. enum Locations{
  11. Float:l1x,
  12. Float:l1y,
  13. Float:l1z,
  14. Float:l2x,
  15. Float:l2y,
  16. Float:l2z,
  17. Float:l3x,
  18. Float:l3y,
  19. Float:l3z,
  20. Float:l4x,
  21. Float:l4y,
  22. Float:l4z,
  23. Float:l5x,
  24. Float:l5y,
  25. Float:l5z
  26. };
  27.  
  28. new PlayerLocation[MAX_PLAYERS][Locations];
  29.  
  30. #define FILTERSCRIPT
  31. #if defined FILTERSCRIPT
  32.  
  33. public OnFilterScriptInit()
  34. {
  35. print("\n--------------------------------------");
  36. print(" TP Filterscript by Akib Khan");
  37. print("--------------------------------------\n");
  38. return 1;
  39. }
  40.  
  41. public OnFilterScriptExit()
  42. {
  43. return 1;
  44. }
  45.  
  46. #else
  47.  
  48. main()
  49. {
  50. print("\n----------------------------------");
  51. print(" Blank Gamemode by your name here");
  52. print("----------------------------------\n");
  53. }
  54.  
  55. #endif
  56.  
  57. COMMAND:gotolocation(playerid,params[])
  58. {
  59. new locationid;
  60. if(sscanf(params,"i",locationid))
  61. {
  62. SendClientMessage(playerid, -1, "Usage : /gotolocation [Slot it]");
  63. SendClientMessage(playerid, -1, "Slots:");
  64. new m[126];
  65. format(m, sizeof(m), "Slot 1 : %f,%f,%f", PlayerLocation[playerid][l1x],PlayerLocation[playerid][l1y],PlayerLocation[playerid][l1z]);
  66. SendClientMessage(playerid, -1, m);
  67.  
  68. format(m, sizeof(m), "Slot 2 : %f,%f,%f", PlayerLocation[playerid][l2x],PlayerLocation[playerid][l2y],PlayerLocation[playerid][l2z]);
  69. SendClientMessage(playerid, -1, m);
  70.  
  71. format(m, sizeof(m), "Slot 3 : %f,%f,%f", PlayerLocation[playerid][l3x],PlayerLocation[playerid][l3y],PlayerLocation[playerid][l3z]);
  72. SendClientMessage(playerid, -1, m);
  73.  
  74. format(m, sizeof(m), "Slot 4 : %f,%f,%f", PlayerLocation[playerid][l4x],PlayerLocation[playerid][l4y],PlayerLocation[playerid][l4z]);
  75. SendClientMessage(playerid, -1, m);
  76.  
  77. format(m, sizeof(m), "Slot 5 : %f,%f,%f", PlayerLocation[playerid][l5x],PlayerLocation[playerid][l5y],PlayerLocation[playerid][l5z]);
  78. SendClientMessage(playerid, -1, m);
  79. }
  80. if(locationid==1)
  81. {
  82. if(PlayerLocation[playerid][l1x]==0.000 && PlayerLocation[playerid][l1y]==0.000 && PlayerLocation[playerid][l1z]==0.000)
  83. {
  84. SendClientMessage(playerid, -1, "No location are saved on this slot.");
  85. }
  86. SetPlayerPos(playerid,PlayerLocation[playerid][l1x],PlayerLocation[playerid][l1y],PlayerLocation[playerid][l1z]);
  87. }
  88. if(locationid==2)
  89. {
  90. if(PlayerLocation[playerid][l2x]==0.000 && PlayerLocation[playerid][l2y]==0.000 && PlayerLocation[playerid][l2z]==0.000)
  91. {
  92. SendClientMessage(playerid, -1, "No location are saved on this slot.");
  93. }
  94. SetPlayerPos(playerid,PlayerLocation[playerid][l2x],PlayerLocation[playerid][l2y],PlayerLocation[playerid][l2z]);
  95. }
  96. if(locationid==3)
  97. {
  98. if(PlayerLocation[playerid][l3x]==0.000 && PlayerLocation[playerid][l3y]==0.000 && PlayerLocation[playerid][l3z]==0.000)
  99. {
  100. SendClientMessage(playerid, -1, "No location are saved on this slot.");
  101. }
  102. SetPlayerPos(playerid,PlayerLocation[playerid][l3x],PlayerLocation[playerid][l3y],PlayerLocation[playerid][l3z]);
  103. }
  104. if(locationid==4)
  105. {
  106. if(PlayerLocation[playerid][l4x]==0.000 && PlayerLocation[playerid][l4y]==0.000 && PlayerLocation[playerid][l4z]==0.000)
  107. {
  108. SendClientMessage(playerid, -1, "No location are saved on this slot.");
  109. }
  110. SetPlayerPos(playerid,PlayerLocation[playerid][l4x],PlayerLocation[playerid][l4y],PlayerLocation[playerid][l4z]);
  111. }
  112. if(locationid==5)
  113. {
  114. if(PlayerLocation[playerid][l5x]==0.000 && PlayerLocation[playerid][l5y]==0.000 && PlayerLocation[playerid][l5z]==0.000)
  115. {
  116. SendClientMessage(playerid, -1, "No location are saved on this slot.");
  117. }
  118. SetPlayerPos(playerid,PlayerLocation[playerid][l5x],PlayerLocation[playerid][l5y],PlayerLocation[playerid][l5z]);
  119. }
  120. return 1;
  121. }
  122.  
  123. COMMAND:savelocation(playerid,params[])
  124. {
  125. new locationid;
  126. if(sscanf(params,"i",locationid))
  127. {
  128. SendClientMessage(playerid, -1, "Usage : /savelocation [Slot it]");
  129. SendClientMessage(playerid, -1, "Slots:");
  130. new m[126];
  131. format(m, sizeof(m), "Slot 1 : %f,%f,%f", PlayerLocation[playerid][l1x],PlayerLocation[playerid][l1y],PlayerLocation[playerid][l1z]);
  132. SendClientMessage(playerid, -1, m);
  133.  
  134. format(m, sizeof(m), "Slot 2 : %f,%f,%f", PlayerLocation[playerid][l2x],PlayerLocation[playerid][l2y],PlayerLocation[playerid][l2z]);
  135. SendClientMessage(playerid, -1, m);
  136.  
  137. format(m, sizeof(m), "Slot 3 : %f,%f,%f", PlayerLocation[playerid][l3x],PlayerLocation[playerid][l3y],PlayerLocation[playerid][l3z]);
  138. SendClientMessage(playerid, -1, m);
  139.  
  140. format(m, sizeof(m), "Slot 4 : %f,%f,%f", PlayerLocation[playerid][l4x],PlayerLocation[playerid][l4y],PlayerLocation[playerid][l4z]);
  141. SendClientMessage(playerid, -1, m);
  142.  
  143. format(m, sizeof(m), "Slot 5 : %f,%f,%f", PlayerLocation[playerid][l5x],PlayerLocation[playerid][l5y],PlayerLocation[playerid][l5z]);
  144. SendClientMessage(playerid, -1, m);
  145. }
  146. new Float:t_x,Float:t_y,Float:t_z;
  147. GetPlayerPos(playerid, Float:t_x, Float:t_y, Float:t_z);
  148. if(locationid==1)
  149. {
  150. PlayerLocation[playerid][l1x] = Float:t_x;
  151. PlayerLocation[playerid][l1y] = Float:t_y;
  152. PlayerLocation[playerid][l1z] = Float:t_z;
  153. SendClientMessage(playerid, -1, "Location Saved!");
  154. }
  155. if(locationid==2)
  156. {
  157. PlayerLocation[playerid][l2x] = Float:t_x;
  158. PlayerLocation[playerid][l2y] = Float:t_y;
  159. PlayerLocation[playerid][l2z] = Float:t_z;
  160. SendClientMessage(playerid, -1, "Location Saved!");
  161. }
  162. if(locationid==3)
  163. {
  164. PlayerLocation[playerid][l3x] = Float:t_x;
  165. PlayerLocation[playerid][l3y] = Float:t_y;
  166. PlayerLocation[playerid][l3z] = Float:t_z;
  167. SendClientMessage(playerid, -1, "Location Saved!");
  168. }
  169. if(locationid==4)
  170. {
  171. PlayerLocation[playerid][l4x] = Float:t_x;
  172. PlayerLocation[playerid][l4y] = Float:t_y;
  173. PlayerLocation[playerid][l4z] = Float:t_z;
  174. SendClientMessage(playerid, -1, "Location Saved!");
  175. }
  176. if(locationid==5)
  177. {
  178. PlayerLocation[playerid][l5x] = Float:t_x;
  179. PlayerLocation[playerid][l5y] = Float:t_y;
  180. PlayerLocation[playerid][l5z] = Float:t_z;
  181. SendClientMessage(playerid, -1, "Location Saved!");
  182. }
  183.  
  184.  
  185. return 1;
  186. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement