Author Topic: some scripts for server  (Read 82 times)

Omar_Egypt

  • Junior
  • **
  • Posts: 52
    • View Profile
some scripts for server
« on: July 24, 2012, 05:21:20 pm »
my name :[FO]Omar_Egypt
Name of script:BoomBox Music



Boombox Script

Commands/Info

Note*: Plays music global to any player in range of it, don't think any more details needed, this is my first release so i hope it gets positive feedback

- /boombox [url] : Places/Destroys Boombox Object, Plays Music

- /boomboxnext [url] : Changes current song to new url

Pictures

- No Pictures, don't think its needed

Credits

- D_Malfoy

-Include Creators

- SA:MP team

Includes/Plugns (Required) you must download this from sa-mp

- http://forum.sa-mp.com/showthread.php?t=120356

- http://forum.sa-mp.com/showthread.php?t=102865

- http://forum.sa-mp.com/showthread.php?t=91354

Download

Quote
// Includes
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <streamer>

// Defines
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_LIGHTBLUE 0x33CCFFFF
#define COLOR_GREY 0xAFAFAFFF

// Variables
new Boombox[MAX_PLAYERS];
new BoomboxObject[MAX_PLAYERS];
new BoomboxStream[MAX_PLAYERS];
new BoomboxPlayer[MAX_PLAYERS];
new BoomboxURL[MAX_PLAYERS][256];
new Float:bpos[MAX_PLAYERS][4];

// Clearing variables
public OnPlayerConnect(playerid)
{
    Boombox[playerid] = 0;
    BoomboxPlayer[playerid] = -1;
    BoomboxStream[playerid] = 0;
    bpos[playerid][0] = 0; bpos[playerid][1] = 0; bpos[playerid][2] = 0; bpos[playerid][3] = 0;
    format(BoomboxURL[playerid], 256, "");
    if(IsValidDynamicObject(BoomboxObject[playerid])) DestroyDynamicObject(BoomboxObject[playerid]);
    return 1;
}

// Clearing variables & Stopping boombox music on disconnect (Double check)
public OnPlayerDisconnect(playerid)
{
    Boombox[playerid] = 0;
    BoomboxPlayer[playerid] = -1;
    BoomboxStream[playerid] = 0;
    bpos[playerid][0] = 0; bpos[playerid][1] = 0; bpos[playerid][2] = 0; bpos[playerid][3] = 0;
    format(BoomboxURL[playerid], 256, "");
    if(IsValidDynamicObject(BoomboxObject[playerid])) DestroyDynamicObject(BoomboxObject[playerid]);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(BoomboxPlayer == playerid)
            {
                BoomboxStream = 0;
                BoomboxPlayer = -1;
                StopAudioStreamForPlayer(i);
                SendClientMessage(i, COLOR_GREY, " The boombox creator has disconnected from the server.");
            }
        }
    }
    return 1;
}


// Boombox command - Usage: /boombox [URL]
CMD:boombox(playerid, params[])
{
    new string[128];
    if(!Boombox[playerid])
    {
        if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /boombox [music url]");
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                    if(Boombox)
                    {
                        if(IsPlayerInRangeOfPoint(playerid, 30, bpos[0], bpos[1], bpos[2]))
                        {
                            SendClientMessage(playerid, COLOR_GREY, " There is another boombox nearby, place yours somewhere else.");
                            return 1;
                        }
                    }
            }
        }
        Boombox[playerid] = 1;
        format(string, sizeof(string), " You have placed your boombox at your location.");
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        GetPlayerPos(playerid, bpos[playerid][0], bpos[playerid][1], bpos[playerid][2]); bpos[playerid][2] = bpos[playerid][2] - 1;
        GetPlayerFacingAngle(playerid, bpos[playerid][3]); bpos[playerid][3] = bpos[playerid][3] +180;
        BoomboxObject[playerid] = CreateDynamicObject(2103, bpos[playerid][0], bpos[playerid][1], bpos[playerid][2], 0, 0, bpos[playerid][3]);
        format(BoomboxURL[playerid], 256, "%s", params);
    }
    else
    {
        Boombox[playerid] = 0;
        format(string, sizeof(string), " You have removed your boombox.");
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        DestroyDynamicObject(BoomboxObject[playerid]);
        format(BoomboxURL[playerid], 256, "");
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(BoomboxPlayer == playerid)
                {
                    BoomboxStream = 0;
                    BoomboxPlayer = -1;
                    StopAudioStreamForPlayer(i);
                    SendClientMessage(i, COLOR_GREY, " The boombox creator has removed his boombox.");
                }
            }
        }
    }
    return 1;
}

// Boombox editing - Usage: /boomboxnext [url]
CMD:boomboxnext(playerid, params[])
{
    if(!Boombox[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You don't have a boombox placed.");
    if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /boomboxnext [music url]");
    SendClientMessage(playerid, COLOR_GREY, " You have changed the music your boombox is playing.");
    format(BoomboxURL[playerid], 256, "%s", params);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
                if(BoomboxPlayer == playerid)
                {
                    PlayAudioStreamForPlayer(i, BoomboxURL[playerid], bpos[playerid][0], bpos[playerid][1], bpos[playerid][2], 30, 1);
                    SendClientMessage(i, COLOR_GREY, " The boombox music you're listening to has changed.");
                }
        }
    }
    return 1;
}


// Playing/Stopping boombox music for nearby players
public OnPlayerUpdate(playerid)
{
    if(!BoomboxStream[playerid])
    {
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(Boombox)
                {
                    if(IsPlayerInRangeOfPoint(playerid, 30, bpos[0], bpos[1], bpos[2]))
                    {
                        PlayAudioStreamForPlayer(playerid, BoomboxURL, bpos[0], bpos[1], bpos[2], 30, 1);
                        BoomboxPlayer[playerid] = i;
                        BoomboxStream[playerid] = 1;
                        SendClientMessage(playerid, COLOR_GREY, " You are listening to music coming out of a nearby boombox.");
                    }
                }
            }
        }
    }
    else
    {
        new i = BoomboxPlayer[playerid];
        if(!IsPlayerInRangeOfPoint(playerid, 30, bpos[0], bpos[1], bpos[2]))
        {
            BoomboxStream[playerid] = 0;
            BoomboxPlayer[playerid] = -1;
            StopAudioStreamForPlayer(playerid);
            SendClientMessage(playerid, COLOR_GREY, " You have went far away from the boombox.");
        }
    }
    return 1;
}

Share on Facebook Share on Twitter


Omar_Egypt

  • Junior
  • **
  • Posts: 52
    • View Profile
Re: some scripts for server
« Reply #1 on: July 24, 2012, 05:26:11 pm »
VIP System for Server

By me -_- yes i am scriptor :P Muhahhha

Quote
RCON command
* /setvip - set a someone to vip member
* /ejvip - to making people do not become a member vip
Premium V.I.P
* /vheal - to heal your self
* /vbike -  to spawn a NRG-500
* /vehfix - to fix your vehicle
* /vehcolor - to change a your vehicle color
Silver V.I.P
* /myskins - to change your skin
* /myweather - to change your own weather
* /mytime - to change your time
* /vcar - to spawn a Infernus
* /vjetpack - to use a jetpack
* /varmor - to spawn a armor for you
Gold V.I.P
* /vheli - to spawn a Maverick
* /vnos - to add nitro to you car
* /mycolor - to change you nickname colour
* /vplane - to spawn a Shamal

The PAwn
http://pastebin.com/N5kxJVpR

Omar_Egypt

  • Junior
  • **
  • Posts: 52
    • View Profile
Re: some scripts for server
« Reply #2 on: July 24, 2012, 05:29:52 pm »
Radio For Cars (Not my):P
Video
http://www.youtube.com/watch?v=ej3OitlIAKU&feature=player_embedded



Information:
1. Textdraws with title of radio look like game radio.
2. Keys for control: Left CTRL and Right CTRL <-- (FIRE + SPACE).
3. Volume control for AudioPlugin version. Keys for control: Num8 and Num2. Default volume is 30 percent.
4. If driver changes radio, it changes for passenger too.
Exception for AudioPlugin version : If player doesn't use AudioPlugin client path, he can't change radio and it doesn't change for him if he is a passenger.
5. Radiostations are stored in vehicles.
6. Auto-configuration of variables and auto-calculating TextDraw's titles.
7. Setup random radiostation in each vehicle (From list of radiostation of course).


Download: http://www.mediafire.com/?ec5npy7jsw0f1tc
Notice: Radiostations in video are different from FS. For reading params of radio there is used mxINI that avaliable in archive.

How to add more radio:
In ''scriptfiles'' folder there is ''radio_settings.ini'' file. Open it.
''Radios'' - number of radio for your server.
''Radio_Title#'' - title of radio of radio with number #.
''Radio_URL#'' - URL for radio with number with number #.
Change number in ''Radios'' param and fill lines with ''Radio_Title#'' and ''Radio_URL#''. Example:
PHP Code:
Radios = 7

Radio_Title1 = I.First!
Radio_URL1 = http://i.url.for.first.radio

Radio_Title2 = I.Second!
Radio_URL2 = http://i.url.for.second.radio

//...and like for third, and fourth...

Radio_Title7 = I.Seventh!
Radio_URL7 = http://i.url.for.seventh.radio 
Don't make line to be empty. But if you make it there will be problems in working of script.

How to get IP of radiostation:
Example, Shoutcast.com.
Select radio that you like. Click by RMB on title of radio and click ''Save as...''. You'll get playlist of radio. Open it in any media player. You'll see avaliable IPs of current radiostation. They are tracks. Just see properties of track and you'll find IP.

Changelog:
22.05.2012: Fixed bug with arrays.

chronic

  • Im Chronic The Owner of this Serverr
  • Owner
  • Senior
  • *
  • Posts: 471
    • View Profile
Re: some scripts for server
« Reply #3 on: July 24, 2012, 06:43:12 pm »
That V.I.P System is not yours It says it on Pastebin "Ulric V.I.P System" thats stupid u lied.

Omar_Egypt

  • Junior
  • **
  • Posts: 52
    • View Profile
Re: some scripts for server
« Reply #4 on: July 24, 2012, 07:24:51 pm »
You blind right ? can you Read (Its not my ) -_- Boombox is my -_- No comment man

 :-X

[Cali]Blunt

  • Guest
Re: some scripts for server
« Reply #5 on: July 25, 2012, 01:52:30 am »
Actually explain me the boomb box again?

i like the boom box script.

explain me this again didnt quite get it lol

Omar_Egypt

  • Junior
  • **
  • Posts: 52
    • View Profile
Re: some scripts for server
« Reply #6 on: July 25, 2012, 07:15:25 pm »
sorry but explian what ?  ???

Afellay

  • Moderators
  • Newbie
  • *
  • Posts: 27
  • ┏(-_-)┛
    • View Profile
Re: some scripts for server
« Reply #7 on: August 07, 2012, 04:21:37 pm »
Quote
VIP System for Server

By me -_- yes i am scriptor Muhahhha


Now you say it isnt yours -.- ...Anyways you wont gain respect by claiming something to be yours.