Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new PlayingMusic[MAX_PLAYERS];
- forward stopxf(playerid);
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" AREA51 XFiles theme by Br0nXz_ loaded");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" AREA51 XFiles theme by Br0nXz_ unnloaded");
- print("----------------------------------\n");
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- PlayingMusic[playerid] = 0;
- return 1;
- }
- public stopxf(playerid)
- {
- PlayingMusic[playerid] = 0;
- StopAudioStreamForPlayer(playerid);
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- SetTimerEx("CheckArea", 2000, true, "i", playerid);
- return 1;
- }
- forward CheckArea(playerid);
- public CheckArea(playerid)
- {
- if(IsPlayerInArea(playerid, -544.2247, 842.9382, 1106.2523, 2796.2766) && PlayingMusic[playerid] == 0)
- {
- SetTimerEx("stopxf", 180000, false, "i", playerid);
- PlayingMusic[playerid] = 1;
- PlayAudioStreamForPlayer(playerid, "http://k003.kiwi6.com/hotlink/wos3db6jxt/The_XFiles_Theme.mp3",-261.05, 2227.15, 58.45, 2000.0, 1);
- }
- else if(IsPlayerInArea(playerid, -544.2247, 842.9382, 1106.2523, 2796.2766) && PlayingMusic[playerid] == 1)
- {
- return 0;
- }
- else if(!IsPlayerInArea(playerid,-544.2247, 842.9382, 1106.2523, 2796.2766))
- {
- PlayingMusic[playerid] = 0;
- }
- return 1;
- }
- stock IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- if(minx < x < maxx && miny < y < maxy) return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement