Advertisement
Guest User

Untitled

a guest
Jul 10th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. #undef MAX_PLAYERS
  7. #define MAX_PLAYERS 2 //Testing purpose
  8. PUBLIC OnFilterScriptInit()
  9. {
  10.     print("\n--------------------------------------");
  11.     print(" Blank Filterscript by your name here");
  12.     print("--------------------------------------\n");
  13.     SetTimer("RunThroughPlayers", 30, 1);
  14.     RETURN 1;
  15. }
  16.  
  17. PUBLIC OnFilterScriptExit()
  18. {
  19.     RETURN 1;
  20. }
  21.  
  22. PUBLIC OnPlayerRequestClass(playerid, classid)
  23. {
  24.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  25.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  26.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  27.     RETURN 1;
  28. }
  29.  
  30. PUBLIC OnPlayerConnect(playerid)
  31. {
  32.     RETURN 1;
  33. }
  34.  
  35. PUBLIC OnPlayerDisconnect(playerid, reason)
  36. {
  37.     RETURN 1;
  38. }
  39.  
  40. PUBLIC OnPlayerSpawn(playerid)
  41. {
  42.     NEW FLOAT:Pos[3];
  43.     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  44.     SetPlayerCameraPos(playerid, Pos[0], Pos[1], Pos[2]);
  45.     SetPlayerCameraLookAt(playerid, Pos[0], Pos[1] + 20, Pos[2]);
  46.     SetPVarInt(playerid, "Spawned", 1);
  47.     RETURN 1;
  48. }
  49.  
  50. PUBLIC OnPlayerDeath(playerid, killerid, reason)
  51. {
  52.     DeletePVar(playerid, "Spawned");
  53.     RETURN 1;
  54. }
  55.  
  56. PUBLIC OnVehicleSpawn(vehicleid)
  57. {
  58.     RETURN 1;
  59. }
  60.  
  61. PUBLIC OnVehicleDeath(vehicleid, killerid)
  62. {
  63.     RETURN 1;
  64. }
  65.  
  66. PUBLIC OnPlayerText(playerid, text[])
  67. {
  68.     RETURN 1;
  69. }
  70.  
  71. PUBLIC OnPlayerCommandText(playerid, cmdtext[])
  72. {
  73.     IF (strcmp("/kill", cmdtext, TRUE, 3) == 0)
  74.     {
  75.         SetPlayerHealth(playerid, 0);
  76.         RETURN 1;
  77.     }
  78.     RETURN 0;
  79. }
  80.  
  81. PUBLIC OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  82. {
  83.     RETURN 1;
  84. }
  85.  
  86. PUBLIC OnPlayerExitVehicle(playerid, vehicleid)
  87. {
  88.     RETURN 1;
  89. }
  90.  
  91. PUBLIC OnPlayerStateChange(playerid, newstate, oldstate)
  92. {
  93.     RETURN 1;
  94. }
  95.  
  96. PUBLIC OnPlayerEnterCheckpoint(playerid)
  97. {
  98.     RETURN 1;
  99. }
  100.  
  101. PUBLIC OnPlayerLeaveCheckpoint(playerid)
  102. {
  103.     RETURN 1;
  104. }
  105.  
  106. PUBLIC OnPlayerEnterRaceCheckpoint(playerid)
  107. {
  108.     RETURN 1;
  109. }
  110.  
  111. PUBLIC OnPlayerLeaveRaceCheckpoint(playerid)
  112. {
  113.     RETURN 1;
  114. }
  115.  
  116. PUBLIC OnRconCommand(cmd[])
  117. {
  118.     RETURN 1;
  119. }
  120.  
  121. PUBLIC OnPlayerRequestSpawn(playerid)
  122. {
  123.     RETURN 1;
  124. }
  125.  
  126. PUBLIC OnObjectMoved(objectid)
  127. {
  128.     RETURN 1;
  129. }
  130.  
  131. PUBLIC OnPlayerObjectMoved(playerid, objectid)
  132. {
  133.     RETURN 1;
  134. }
  135.  
  136. PUBLIC OnPlayerPickUpPickup(playerid, pickupid)
  137. {
  138.     RETURN 1;
  139. }
  140.  
  141. PUBLIC OnVehicleMod(playerid, vehicleid, componentid)
  142. {
  143.     RETURN 1;
  144. }
  145.  
  146. PUBLIC OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  147. {
  148.     RETURN 1;
  149. }
  150.  
  151. PUBLIC OnVehicleRespray(playerid, vehicleid, color1, color2)
  152. {
  153.     RETURN 1;
  154. }
  155.  
  156. PUBLIC OnPlayerSelectedMenuRow(playerid, ROW)
  157. {
  158.     RETURN 1;
  159. }
  160.  
  161. PUBLIC OnPlayerExitedMenu(playerid)
  162. {
  163.     RETURN 1;
  164. }
  165.  
  166. PUBLIC OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  167. {
  168.     RETURN 1;
  169. }
  170.  
  171. PUBLIC OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  172. {
  173.     RETURN 1;
  174. }
  175.  
  176. PUBLIC OnRconLoginAttempt(ip[], password[], success)
  177. {
  178.     RETURN 1;
  179. }
  180.  
  181. PUBLIC OnPlayerUpdate(playerid)
  182. {/*
  183.     static tc;
  184.     printf("TC: %d ", GetTickCount() - tc);
  185.     tc = GetTickCount();
  186.     if(!GetPVarInt(playerid, "Spawned")) return 1;
  187.     new Float:Pos[3];
  188.     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  189.     SetPlayerCameraLookAt(playerid, Pos[0], Pos[1], Pos[2]);
  190.     SetPlayerCameraPos(playerid, Pos[0] + (floatdiv(Pos[0], 1000)), Pos[1] + (floatdiv(Pos[1], 1000)), Pos[2] + ((!IsPlayerInAnyVehicle(playerid)) ? (12.5) : (12.5 + floatdiv(GetPlayerSpeed(playerid), 5))));*/
  191.     RETURN 1;
  192. }
  193.  
  194. forward RunThroughPlayers();
  195. PUBLIC RunThroughPlayers()
  196. {
  197.     FOR(NEW playerid; playerid < MAX_PLAYERS; playerid++)
  198.     {
  199.         IF(!GetPVarInt(playerid, "Spawned")) RETURN;
  200.         SetPlayerCameraLookAt(playerid, 0, 5000, 0);
  201.         NEW FLOAT:Pos[4];
  202.         IF(IsPlayerInAnyVehicle(playerid))
  203.         {
  204.             GetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
  205.             GetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
  206.         }
  207.         ELSE
  208.         {
  209.             GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  210.             GetPlayerFacingAngle(playerid, Pos[3]);
  211.         }
  212.         Pos[0] += ((IsPlayerInAnyVehicle(playerid)) ? (floatdiv(((GetPlayerSpeed(playerid) + 3.75) *floatsin(-Pos[3], degrees)), 4.5)) : (1.25 * floatsin(-Pos[3], degrees)));
  213.         Pos[1] += ((IsPlayerInAnyVehicle(playerid)) ? (floatdiv(((GetPlayerSpeed(playerid) + 3.75) *floatcos(-Pos[3], degrees)), 4.5)) : (1.25 * floatcos(-Pos[3], degrees)));
  214.         SetPlayerCameraLookAt(playerid, Pos[0], Pos[1], Pos[2]);
  215.         SetPlayerCameraPos(playerid, Pos[0] + (floatdiv(Pos[0], 1000)), Pos[1] + (floatdiv(Pos[1], 1000)), Pos[2] + ((!IsPlayerInAnyVehicle(playerid)) ? (12.5) : (12.5 + floatdiv(GetPlayerSpeed(playerid), 5))));
  216.     }
  217. }
  218.  
  219. PUBLIC OnPlayerStreamIn(playerid, forplayerid)
  220. {
  221.     RETURN 1;
  222. }
  223.  
  224. PUBLIC OnPlayerStreamOut(playerid, forplayerid)
  225. {
  226.     RETURN 1;
  227. }
  228.  
  229. PUBLIC OnVehicleStreamIn(vehicleid, forplayerid)
  230. {
  231.     RETURN 1;
  232. }
  233.  
  234. PUBLIC OnVehicleStreamOut(vehicleid, forplayerid)
  235. {
  236.     RETURN 1;
  237. }
  238.  
  239. PUBLIC OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  240. {
  241.     RETURN 1;
  242. }
  243.  
  244. PUBLIC OnPlayerClickPlayer(playerid, clickedplayerid, source)
  245. {
  246.     RETURN 1;
  247. }
  248.  
  249. stock GetPlayerSpeed(playerid)
  250. {
  251.     NEW FLOAT:ST[4];
  252.     IF(IsPlayerInAnyVehicle(playerid))
  253.         GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
  254.         ELSE GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
  255.     ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 100.3;
  256.     RETURN floatround(ST[3]);
  257. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement