Guest User

Untitled

a guest
Mar 8th, 2015
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.64 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.  
  7. #define DIALOG_SAVE 2932
  8.  
  9. new Float:position1x[MAX_PLAYERS], Float:position1y[MAX_PLAYERS], Float:position1z[MAX_PLAYERS];
  10. new Float:position2x[MAX_PLAYERS], Float:position2y[MAX_PLAYERS], Float:position2z[MAX_PLAYERS];
  11. new Float:position3x[MAX_PLAYERS], Float:position3y[MAX_PLAYERS], Float:position3z[MAX_PLAYERS];
  12.  
  13. #if defined FILTERSCRIPT
  14.  
  15. public OnFilterScriptInit()
  16. {
  17.     print("\n--------------------------------------");
  18.     print(" Blank Filterscript by your name here");
  19.     print("--------------------------------------\n");
  20.     return 1;
  21. }
  22.  
  23. public OnFilterScriptExit()
  24. {
  25.     return 1;
  26. }
  27.  
  28. #else
  29.  
  30. main()
  31. {
  32.     print("\n----------------------------------");
  33.     print(" Blank Gamemode by your name here");
  34.     print("----------------------------------\n");
  35. }
  36.  
  37. #endif
  38.  
  39. public OnGameModeInit()
  40. {
  41.     // Don't use these lines if it's a filterscript
  42.     SetGameModeText("Blank Script");
  43.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  44.     return 1;
  45. }
  46.  
  47. public OnGameModeExit()
  48. {
  49.     return 1;
  50. }
  51.  
  52. public OnPlayerRequestClass(playerid, classid)
  53. {
  54.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  55.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  56.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  57.     return 1;
  58. }
  59.  
  60. public OnPlayerConnect(playerid)
  61. {
  62.     return 1;
  63. }
  64.  
  65. public OnPlayerDisconnect(playerid, reason)
  66. {
  67.     return 1;
  68. }
  69.  
  70. public OnPlayerSpawn(playerid)
  71. {
  72.     return 1;
  73. }
  74.  
  75. public OnPlayerDeath(playerid, killerid, reason)
  76. {
  77.     return 1;
  78. }
  79.  
  80. public OnVehicleSpawn(vehicleid)
  81. {
  82.     return 1;
  83. }
  84.  
  85. public OnVehicleDeath(vehicleid, killerid)
  86. {
  87.     return 1;
  88. }
  89.  
  90. public OnPlayerText(playerid, text[])
  91. {
  92.     return 1;
  93. }
  94.  
  95. public OnPlayerCommandText(playerid, cmdtext[])
  96. {
  97.     if (strcmp("/savepos", cmdtext, true, 8) == 0)
  98.     {
  99.         ShowPlayerDialog(playerid, DIALOG_SAVE, DIALOG_STYLE_LIST, "Position saver", "Save to position 1\nSave to position 2\nSave to position 3", "Save!", "Cancel");
  100.         return 1;
  101.     }
  102.     else if (strcmp("/pos1", cmdtext, true, 5) == 0)
  103.     {
  104.         SetPlayerPos(playerid, position1x[playerid], position1y[playerid], position1z[playerid]);
  105.         SendClientMessage(playerid, -1, "You were teleported to position 1");
  106.         return 1;
  107.     }
  108.     else if (strcmp("/pos2", cmdtext, true, 5) == 0)
  109.     {
  110.         SetPlayerPos(playerid, position2x[playerid], position2y[playerid], position2z[playerid]);
  111.         SendClientMessage(playerid, -1, "You were teleported to position 2");
  112.         return 1;
  113.     }
  114.     else if (strcmp("/pos3", cmdtext, true, 5) == 0)
  115.     {
  116.         SetPlayerPos(playerid, position3x[playerid], position3y[playerid], position3z[playerid]);
  117.         SendClientMessage(playerid, -1, "You were teleported to position 3");
  118.         return 1;
  119.     }
  120.     return 0;
  121. }
  122.  
  123. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  124. {
  125.     return 1;
  126. }
  127.  
  128. public OnPlayerExitVehicle(playerid, vehicleid)
  129. {
  130.     return 1;
  131. }
  132.  
  133. public OnPlayerStateChange(playerid, newstate, oldstate)
  134. {
  135.     return 1;
  136. }
  137.  
  138. public OnPlayerEnterCheckpoint(playerid)
  139. {
  140.     return 1;
  141. }
  142.  
  143. public OnPlayerLeaveCheckpoint(playerid)
  144. {
  145.     return 1;
  146. }
  147.  
  148. public OnPlayerEnterRaceCheckpoint(playerid)
  149. {
  150.     return 1;
  151. }
  152.  
  153. public OnPlayerLeaveRaceCheckpoint(playerid)
  154. {
  155.     return 1;
  156. }
  157.  
  158. public OnRconCommand(cmd[])
  159. {
  160.     return 1;
  161. }
  162.  
  163. public OnPlayerRequestSpawn(playerid)
  164. {
  165.     return 1;
  166. }
  167.  
  168. public OnObjectMoved(objectid)
  169. {
  170.     return 1;
  171. }
  172.  
  173. public OnPlayerObjectMoved(playerid, objectid)
  174. {
  175.     return 1;
  176. }
  177.  
  178. public OnPlayerPickUpPickup(playerid, pickupid)
  179. {
  180.     return 1;
  181. }
  182.  
  183. public OnVehicleMod(playerid, vehicleid, componentid)
  184. {
  185.     return 1;
  186. }
  187.  
  188. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  189. {
  190.     return 1;
  191. }
  192.  
  193. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  194. {
  195.     return 1;
  196. }
  197.  
  198. public OnPlayerSelectedMenuRow(playerid, row)
  199. {
  200.     return 1;
  201. }
  202.  
  203. public OnPlayerExitedMenu(playerid)
  204. {
  205.     return 1;
  206. }
  207.  
  208. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  209. {
  210.     return 1;
  211. }
  212.  
  213. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  214. {
  215.     return 1;
  216. }
  217.  
  218. public OnRconLoginAttempt(ip[], password[], success)
  219. {
  220.     return 1;
  221. }
  222.  
  223. public OnPlayerUpdate(playerid)
  224. {
  225.     return 1;
  226. }
  227.  
  228. public OnPlayerStreamIn(playerid, forplayerid)
  229. {
  230.     return 1;
  231. }
  232.  
  233. public OnPlayerStreamOut(playerid, forplayerid)
  234. {
  235.     return 1;
  236. }
  237.  
  238. public OnVehicleStreamIn(vehicleid, forplayerid)
  239. {
  240.     return 1;
  241. }
  242.  
  243. public OnVehicleStreamOut(vehicleid, forplayerid)
  244. {
  245.     return 1;
  246. }
  247.  
  248. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  249. {
  250.     if(dialogid == DIALOG_SAVE)
  251.     {
  252.         if(response)
  253.         {
  254.             new Float:x, Float:y, Float:z;
  255.             GetPlayerPos(playerid, x, y, z);
  256.        
  257.             if(listitem == 0) // Save to position 1
  258.             {
  259.                 position1x[playerid] = x;
  260.                 position1y[playerid] = y;
  261.                 position1z[playerid] = z;
  262.                 SendClientMessage(playerid, -1, "Your position was saved to slot 1");
  263.             }
  264.             else if(listitem == 1) // Save to position 2
  265.             {
  266.                 position2x[playerid] = x;
  267.                 position2y[playerid] = y;
  268.                 position2z[playerid] = z;
  269.                 SendClientMessage(playerid, -1, "Your position was saved to slot 2");
  270.             }
  271.             else if(listitem == 2) // Save to position 3
  272.             {
  273.                 position3x[playerid] = x;
  274.                 position3y[playerid] = y;
  275.                 position3z[playerid] = z;
  276.                 SendClientMessage(playerid, -1, "Your position was saved to slot 3");
  277.             }
  278.         }
  279.     }
  280.     return 1;
  281. }
  282.  
  283. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  284. {
  285.     return 1;
  286. }
Advertisement
Add Comment
Please, Sign In to add comment