Only SAMP

Forum o SAMP... Zapraszamy do rejestracji.

  • Nie jesteś zalogowany.
  • Polecamy: Komputery

#1 2011-07-13 13:18:21

Prezes

http://img810.imageshack.us/img810/4420/userxd.jpg

Zarejestrowany: 2011-07-13
Posty: 3
Punktów :   

Realne Radio W Pojeździe

Witam.

Chciałbym wam przedstawić skrypt o nazwie "Realne Radio W Pojeździe" by Prezes. Skrypt polega na tym że możecie sobie słuchać realnego radia podczas jazdy w grze

Oto kod :

Kod:

/*
FFFFFFF             RRRRRR  PPPPP
F                   R    R  P   P
FFFFFFF   *******   R    R  P   P
F                   RRRRRR  PPPPP By Prezes
F                   RR      P
F                   R  R    P
*/

#include <a_samp>
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#include <colors>
#include <audio>
#define ZIELONY 0x80FF00FF
#define MAX_RADIOS 16
new Radio[MAX_RADIOS][MAX_PLAYERS];
new nazwy[][] = // tutaj w puste pola pomiedzy " " dajemy nazwe stacji.
{
    {"Forever-FM"},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""}
};
new adresy[][] = // tutaj w puste pola pomiedzy " " dajemy adres stacji.
{
    {"http://freeshoutcast.pl:12064/listen.pls"},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""},
    {""}

};
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new string[128];
        format(string, sizeof(string), "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%\n%s\n%s\n%s\n%s\n%s\nNie chce radia", nazwy[0], nazwy[1], nazwy[2], nazwy[3], nazwy[4], nazwy[5], nazwy[6], nazwy[7], nazwy[8], nazwy[9], nazwy[10], nazwy[11], nazwy[12], nazwy[13], nazwy[14], nazwy[15]);
        ShowPlayerDialog(playerid, 283, 2, "Wybierz stację radiową", string, "OK","Anuluj");
    }
    if(newstate == PLAYER_STATE_ONFOOT)
    {
        StopWszystkie(playerid);
    }
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 283 && response)
    {
         new string[128];
          format(string, sizeof(string), "Wybrałeś %s", nazwy[listitem]);
        switch(listitem)
        {
            case 0: { Radio[0][playerid] = Audio_PlayStreamed(playerid, adresy[0]); SendClientMessage(playerid, ZIELONY, string); }
            case 1: { Radio[1][playerid] = Audio_PlayStreamed(playerid, adresy[1]); SendClientMessage(playerid, ZIELONY, string); }
            case 2: { Radio[2][playerid] = Audio_PlayStreamed(playerid, adresy[2]); SendClientMessage(playerid, ZIELONY, string); }
            case 3: { Radio[3][playerid] = Audio_PlayStreamed(playerid, adresy[3]); SendClientMessage(playerid, ZIELONY, string); }
            case 4: { Radio[4][playerid] = Audio_PlayStreamed(playerid, adresy[4]); SendClientMessage(playerid, ZIELONY, string); }
            case 5: { Radio[5][playerid] = Audio_PlayStreamed(playerid, adresy[5]); SendClientMessage(playerid, ZIELONY, string); }
            case 6: { Radio[6][playerid] = Audio_PlayStreamed(playerid, adresy[6]); SendClientMessage(playerid, ZIELONY, string); }
            case 7: { Radio[7][playerid] = Audio_PlayStreamed(playerid, adresy[7]); SendClientMessage(playerid, ZIELONY, string); }
            case 8: { Radio[8][playerid] = Audio_PlayStreamed(playerid, adresy[8]); SendClientMessage(playerid, ZIELONY, string); }
            case 9: { Radio[9][playerid] = Audio_PlayStreamed(playerid, adresy[9]); SendClientMessage(playerid, ZIELONY, string); }
            case 10: { Radio[10][playerid] = Audio_PlayStreamed(playerid, adresy[10]); SendClientMessage(playerid, ZIELONY, string); }
            case 11: { Radio[11][playerid] = Audio_PlayStreamed(playerid, adresy[11]); SendClientMessage(playerid, ZIELONY, string); }
            case 12: { Radio[12][playerid] = Audio_PlayStreamed(playerid, adresy[12]); SendClientMessage(playerid, ZIELONY, string); }
            case 13: { Radio[13][playerid] = Audio_PlayStreamed(playerid, adresy[13]); SendClientMessage(playerid, ZIELONY, string); }
            case 14: { Radio[14][playerid] = Audio_PlayStreamed(playerid, adresy[14]); SendClientMessage(playerid, ZIELONY, string); }
            case 15: { Radio[15][playerid] = Audio_PlayStreamed(playerid, adresy[15]); SendClientMessage(playerid, ZIELONY, string); }
            case 16: { StopWszystkie(playerid); }
        }
    }
    return 1;
}
stock StopWszystkie(playerid)
{
    for(new x; x != 17; x++)
    {
        Audio_Stop(playerid, Radio[x][playerid]);
      }
}

Wystarczy że macie audio plugin

Pozdrawiam i życzę dobrej zabawy z tym skryptem


http://iv.pl/images/25478899154954793663.png
http://img.userbars.pl/126/25110.png
http://img.userbars.pl/123/24558.png
http://img.userbars.pl/150/29916.png

Offline

 

#2 2011-07-13 16:28:15

peQ

http://img155.imageshack.us/img155/8325/zalozyciel.jpg

Zarejestrowany: 2011-07-12
Posty: 29
Punktów :   

Re: Realne Radio W Pojeździe

Bardzo ładnie, dostajesz za to pochwałę, oby tak dalej. ;]

Offline

 

Stopka forum

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.fantasyimy.pun.pl www.simtractorversions.pun.pl www.powerrangersgranet.pun.pl www.red104.pun.pl www.fairytailgame.pun.pl