Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Inspired by Hiddos's filterscript http://forum.sa-mp.com/showthread.php?t=235383
- This shows the true strength of boredom
- Hopefully this one is fixed!
- */
- #include <a_samp>
- enum PlayerI
- {
- PTimeMin,
- PTimeHour
- }
- new PlayerInfo[MAX_PLAYERS][PlayerI];
- //Variables
- new ScaryCow;
- new ScaredPlayer;
- new player =-1;
- new timers[2];
- //Forwards
- forward ScarePlayer();
- forward Destroy();
- //Functions
- GetPlayerID() {
- new Prandom = random(MAX_PLAYERS);
- if(IsPlayerConnected(Prandom)) return 1;
- return 0;
- }
- GetXYInFrontOfPlayer(playerid, &Float:XP, &Float:YP, Float:distance)
- { // Created by Y_Less
- new Float:a;
- GetPlayerPos(playerid, XP, YP, a);
- GetPlayerFacingAngle(playerid, a);
- if (GetPlayerVehicleID(playerid)) {
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- }
- XP += (distance * floatsin(-a, degrees));
- YP += (distance * floatcos(-a, degrees));
- }
- //------------------------------------------------
- public OnFilterScriptInit()
- {
- print("Welcome to the most useless filterscript you will ever see.");
- print("Why did you even download this crap?");
- ScaryCow = CreateObject(16442, 0, 0, 0, 0, 0, 0);
- timers[0] = SetTimer("ScarePlayer", 30000, true);
- return 1;
- }
- //------------------------------------------------
- public OnFilterScriptExit()
- {
- KillTimer(timers[0]);
- KillTimer(timers[1]);
- return 1;
- }
- //------------------------------------------------
- public OnPlayerDisconnect(playerid, reason)
- {
- if(playerid == ScaredPlayer) ScarePlayer();
- return 1;
- }
- //------------------------------------------------
- public ScarePlayer()
- {
- player = GetPlayerID();
- new Float:pos[4], Hour, Min;
- if(player == 0) {}
- if(IsPlayerInAnyVehicle(player)) GetVehiclePos(GetPlayerVehicleID(player), pos[0], pos[1], pos[2]);
- else GetPlayerPos(player, pos[0], pos[1], pos[2]);
- GetPlayerFacingAngle(player, pos[3]);
- GetXYInFrontOfPlayer(player, pos[0], pos[1], 3);
- PlayAudioStreamForPlayer(player, "http://sf-cnr.co.uk/lul.mp3");
- SetObjectPos(ScaryCow, pos[0], pos[1], pos[2]);
- SetObjectRot(ScaryCow, 0, 0, pos[3]-90);
- GetPlayerTime(player, Hour, Min);
- PlayerInfo[player][PTimeHour] = Hour;
- PlayerInfo[player][PTimeMin] = Min;
- SetPlayerTime(player,0,0);
- SetPlayerWeather(player, 8);
- timers[1] = SetTimer("Destroy", 4000, false);
- return 1;
- }
- //------------------------------------------------
- public Destroy()
- {
- SetObjectPos(ScaryCow, 0, 0, 0);
- PlayAudioStreamForPlayer(player, "stap");
- SetPlayerTime(player,PlayerInfo[player][PTimeHour],PlayerInfo[player][PTimeMin]);
- SetPlayerWeather(player, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement