Advertisement
Guest User

CrapYoPants

a guest
Feb 22nd, 2013
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  
  3.     Inspired by Hiddos's filterscript http://forum.sa-mp.com/showthread.php?t=235383
  4.     Thanks to hiddos for correcting me on some things. Now going to read up on pawn pdf's!
  5.     This shows the true strength of boredom
  6. */
  7.  
  8. #include <a_samp>
  9.  
  10. enum PlayerI
  11. {
  12.     PWeather,
  13.     PTimeMin,
  14.     PTimeHour
  15. }
  16.  
  17. new PlayerInfo[MAX_PLAYERS][PlayerI];
  18.  
  19. //Variables
  20.  
  21. new ScaryCow;
  22. new ScaredPlayer;
  23. new player =-1;
  24. new timers[2];
  25. //Forwards
  26.  
  27. forward ScarePlayer();
  28. forward Destroy();
  29.  
  30. //Functions
  31.  
  32. GetPlayerID() {
  33.  
  34.     new count, Players[MAX_PLAYERS];
  35.     for(new i = 0; i < MAX_PLAYERS; i++) {
  36.    
  37.         if(IsPlayerConnected(i)) {
  38.        
  39.             Players[count] = i;
  40.             count++;
  41.         }
  42.     }
  43.     if(count == 0) return -1;
  44.     return Players[random(count)];
  45. }
  46.  
  47. GetXYInFrontOfPlayer(playerid, &Float:XP, &Float:YP, Float:distance)
  48. {   // Created by Y_Less
  49.  
  50.     new Float:a;
  51.  
  52.     GetPlayerPos(playerid, XP, YP, a);
  53.     GetPlayerFacingAngle(playerid, a);
  54.  
  55.     if (GetPlayerVehicleID(playerid)) {
  56.         GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  57.     }
  58.  
  59.     XP += (distance * floatsin(-a, degrees));
  60.     YP += (distance * floatcos(-a, degrees));
  61. }
  62.  
  63. //------------------------------------------------
  64.  
  65. public OnFilterScriptInit()
  66. {
  67.     print("Welcome to the most useless filterscript you will ever see.");
  68.     print("Why did you even download this crap?");
  69.    
  70.     ScaryCow = CreateObject(16442, 0, 0, 0, 0, 0, 0);
  71.    
  72.     timers[0] = SetTimer("ScarePlayer", 30000, true);
  73.    
  74.     return 1;
  75. }
  76.  
  77. //------------------------------------------------
  78.  
  79. public OnFilterScriptExit()
  80. {
  81.     KillTimer(timers[0]);
  82.     KillTimer(timers[1]);
  83.    
  84.     DestroyObject(ScaryCow);
  85.    
  86.     return 1;
  87. }
  88.  
  89. //------------------------------------------------
  90.  
  91. public OnPlayerDisconnect(playerid, reason)
  92. {
  93.     if(playerid == ScaredPlayer) ScarePlayer();
  94.    
  95.     return 1;
  96. }
  97.  
  98. //------------------------------------------------
  99.  
  100. public ScarePlayer()
  101. {
  102.     player = GetPlayerID();
  103.     new Float:pos[4], Hour, Min;
  104.    
  105.     if(player == 0) {}
  106.    
  107.    
  108.     if(IsPlayerInAnyVehicle(player)) GetVehiclePos(GetPlayerVehicleID(player), pos[0], pos[1], pos[2]);
  109.     else GetPlayerPos(player, pos[0], pos[1], pos[2]);
  110.    
  111.     GetPlayerFacingAngle(player, pos[3]);
  112.     GetXYInFrontOfPlayer(player, pos[0], pos[1], 3);
  113.    
  114.     PlayAudioStreamForPlayer(player, "http://sf-cnr.co.uk/lul.mp3");
  115.    
  116.     SetObjectPos(ScaryCow, pos[0], pos[1], pos[2]);
  117.     SetObjectRot(ScaryCow, 0, 0, pos[3]-90);
  118.    
  119.     GetPlayerTime(player, Hour, Min);
  120.     PlayerInfo[player][PTimeHour] = Hour;
  121.     PlayerInfo[player][PTimeMin] = Min;
  122.    
  123.     SetPlayerTime(player,0,0);
  124.     SetPlayerWeather(player, 8);
  125.    
  126.     timers[1] = SetTimer("Destroy", 4000, false);
  127.    
  128.     return 1;
  129. }
  130.  
  131. //------------------------------------------------
  132.  
  133. public Destroy()
  134. {
  135.     SetObjectPos(ScaryCow, 0, 0, 0);
  136.     PlayAudioStreamForPlayer(player, "stap");
  137.     SetPlayerTime(player,PlayerInfo[player][PTimeHour],PlayerInfo[player][PTimeMin]);
  138.     SetPlayerWeather(player, 0);
  139. }/*
  140.  
  141.     Inspired by Hiddos's filterscript http://forum.sa-mp.com/showthread.php?t=235383
  142.  
  143.     This shows the true strength of boredom
  144. */
  145.  
  146. #include <a_samp>
  147.  
  148. enum PlayerI
  149. {
  150.     PWeather,
  151.     PTimeMin,
  152.     PTimeHour
  153. }
  154.  
  155. new PlayerInfo[MAX_PLAYERS][PlayerI];
  156.  
  157. //Variables
  158.  
  159. new ScaryCow;
  160. new ScaredPlayer;
  161. new player =-1;
  162. new timers[2];
  163. //Forwards
  164.  
  165. forward ScarePlayer();
  166. forward Destroy();
  167.  
  168. //Functions
  169.  
  170. GetPlayerID() {
  171.  
  172.     new count, Players[MAX_PLAYERS];
  173.     for(new i = 0; i < MAX_PLAYERS; i++) {
  174.    
  175.         if(IsPlayerConnected(i)) {
  176.        
  177.             Players[count] = i;
  178.             count++;
  179.         }
  180.     }
  181.     if(count == 0) return -1;
  182.     return Players[random(count)];
  183. }
  184.  
  185. GetXYInFrontOfPlayer(playerid, &Float:XP, &Float:YP, Float:distance)
  186. {   // Created by Y_Less
  187.  
  188.     new Float:a;
  189.  
  190.     GetPlayerPos(playerid, XP, YP, a);
  191.     GetPlayerFacingAngle(playerid, a);
  192.  
  193.     if (GetPlayerVehicleID(playerid)) {
  194.         GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  195.     }
  196.  
  197.     XP += (distance * floatsin(-a, degrees));
  198.     YP += (distance * floatcos(-a, degrees));
  199. }
  200.  
  201. //------------------------------------------------
  202.  
  203. public OnFilterScriptInit()
  204. {
  205.     print("Welcome to the most useless filterscript you will ever see.");
  206.     print("Why did you even download this crap?");
  207.    
  208.     ScaryCow = CreateObject(16442, 0, 0, 0, 0, 0, 0);
  209.    
  210.     timers[0] = SetTimer("ScarePlayer", 30000, true);
  211.    
  212.     return 1;
  213. }
  214.  
  215. //------------------------------------------------
  216.  
  217. public OnFilterScriptExit()
  218. {
  219.     KillTimer(timers[0]);
  220.     KillTimer(timers[1]);
  221.    
  222.     DestroyObject(ScaryCow);
  223.    
  224.     return 1;
  225. }
  226.  
  227. //------------------------------------------------
  228.  
  229. public OnPlayerDisconnect(playerid, reason)
  230. {
  231.     if(playerid == ScaredPlayer) ScarePlayer();
  232.    
  233.     return 1;
  234. }
  235.  
  236. //------------------------------------------------
  237.  
  238. public ScarePlayer()
  239. {
  240.     player = GetPlayerID();
  241.     new Float:pos[4], Hour, Min;
  242.    
  243.     if(player == 0) {}
  244.    
  245.    
  246.     if(IsPlayerInAnyVehicle(player)) GetVehiclePos(GetPlayerVehicleID(player), pos[0], pos[1], pos[2]);
  247.     else GetPlayerPos(player, pos[0], pos[1], pos[2]);
  248.    
  249.     GetPlayerFacingAngle(player, pos[3]);
  250.     GetXYInFrontOfPlayer(player, pos[0], pos[1], 3);
  251.    
  252.     PlayAudioStreamForPlayer(player, "http://sf-cnr.co.uk/lul.mp3");
  253.    
  254.     SetObjectPos(ScaryCow, pos[0], pos[1], pos[2]);
  255.     SetObjectRot(ScaryCow, 0, 0, pos[3]-90);
  256.    
  257.     GetPlayerTime(player, Hour, Min);
  258.     PlayerInfo[player][PTimeHour] = Hour;
  259.     PlayerInfo[player][PTimeMin] = Min;
  260.    
  261.     SetPlayerTime(player,0,0);
  262.     SetPlayerWeather(player, 8);
  263.    
  264.     timers[1] = SetTimer("Destroy", 4000, false);
  265.    
  266.     return 1;
  267. }
  268.  
  269. //------------------------------------------------
  270.  
  271. public Destroy()
  272. {
  273.     SetObjectPos(ScaryCow, 0, 0, 0);
  274.     PlayAudioStreamForPlayer(player, "stap");
  275.     SetPlayerTime(player,PlayerInfo[player][PTimeHour],PlayerInfo[player][PTimeMin]);
  276.     SetPlayerWeather(player, 0);
  277. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement