hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.07.06. 09:53



Jelenlévő felhasználók

Jelenleg 361 felhasználó van jelen :: 2 regisztrált, 0 rejtett és 359 vendég

A legtöbb felhasználó (2761 fő) 2025.01.09. 20:06-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot], Google [Bot]az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása Hozzászólás a témához  [2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Rádió
HozzászólásElküldve:2012.07.06. 21:03 
Offline
Beavatott

Csatlakozott:2010.08.10. 21:48
Hozzászólások:60
Sziasztok, az oldalon találtam egy olyan plugint amivel rádiót lehet hallgatni a CS - ben
Kód:
  1. AMX MOD X HU SMA Megtekintés - www.amxx.try.hu - Plugin

  2. /*      Formatright � 2009, ConnorMcLeod

  3.  

  4.         Half Life Media Player is free software;

  5.         you can redistribute it and/or modify it under the terms of the

  6.         GNU General Public License as published by the Free Software Foundation.

  7.  

  8.         This program is distributed in the hope that it will be useful,

  9.         but WITHOUT ANY WARRANTY; without even the implied warranty of

  10.         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

  11.         GNU General Public License for more details.

  12.  

  13.         You should have received a copy of the GNU General Public License

  14.         along with Half Life Media Player; if not, write to the

  15.         Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  16.         Boston, MA 02111-1307, USA.

  17. */

  18.  

  19. #include <amxmodx>

  20. #include <nvault>

  21.  

  22. #define VERSION "3.1.1"

  23.  

  24. #define NVAULT_MAX_DAYS_SAVE    15

  25. #define MAX_RECONNECT_TIME      300 // in seconds (take in account that players could download a new map)

  26. #define DEFAULT_VOLUME 40

  27.  

  28. #define A_DAY_IN_SECONDS                86400 // 60 * 60 * 24

  29.  

  30. #define GROUP_MAX_LENGTH        64

  31.  

  32. #define RADIO_MAX_LENGTH        64

  33. #define URL_MAX_LENGTH  192

  34.  

  35. #define MAX_PLAYERS     32

  36. #define AUTHID_LENGTH   22

  37.  

  38. #define SetIdBits(%1,%2)                %1 |= 1<<(%2 & 31)

  39. #define ClearIdBits(%1,%2)      %1 &= ~( 1<<(%2 & 31) )

  40. #define GetIdBits(%1,%2)                %1 & 1<<(%2 & 31)

  41.  

  42. enum _:Radios

  43. {

  44.         RadioName[RADIO_MAX_LENGTH],

  45.         RadioUrl[URL_MAX_LENGTH]

  46. }

  47.  

  48. enum _:Group

  49. {

  50.         GroupName[GROUP_MAX_LENGTH],

  51.         Array:GroupArrayOffset

  52. }

  53.  

  54. enum _:MenuSettings

  55. {

  56.         mGroups,

  57.         mRadios,

  58.         mConfig

  59. }

  60.  

  61. new Array:g_aGroups

  62.  

  63. new g_iGroupsCount

  64.  

  65. new g_bRepeat, g_bListening

  66.  

  67. new g_iMenuOption[MAX_PLAYERS+1]

  68. new g_iMenuPosition[MAX_PLAYERS+1]

  69. new g_iVolume[MAX_PLAYERS+1] = {DEFAULT_VOLUME, ...}

  70. new g_szAuthid[MAX_PLAYERS+1][AUTHID_LENGTH]

  71. new g_PlayerGroup[MAX_PLAYERS+1][Group]

  72.  

  73. new g_pCvarShowAll, g_pCvarNoMotd

  74.  

  75. new gmsgMOTD

  76. new g_iMotdRegistered

  77. new g_iNvault

  78.  

  79. public plugin_init()

  80. {

  81.         register_plugin("Half Life Media Player", VERSION, "ConnorMcLeod")

  82.         register_dictionary("common.txt")

  83.         register_dictionary("hlmp.txt")

  84.  

  85.         g_pCvarShowAll = register_cvar("hlmp_show_all", "1")

  86.         g_pCvarNoMotd = register_cvar("hlmp_no_motd", "1")

  87.  

  88.         register_menucmd(register_menuid("HLMP"), 0x3FF, "HlmpMenuAction")

  89.  

  90.         register_clcmd("hlmp_menu", "ClientCommand_HlmpMenu")

  91.         register_clcmd("say /hlmp", "ClientCommand_HlmpMenu")

  92.         register_clcmd("say /music", "ClientCommand_HlmpMenu")

  93.         register_clcmd("say /radio", "ClientCommand_HlmpMenu")

  94.         register_clcmd("say_team /hlmp", "ClientCommand_HlmpMenu")

  95.         register_clcmd("say_team /music", "ClientCommand_HlmpMenu")

  96.         register_clcmd("say_team /radio", "ClientCommand_HlmpMenu")

  97.  

  98.         register_clcmd("say /stop", "ClientCommand_StopMusic")

  99.         register_clcmd("say_team /stop", "ClientCommand_StopMusic")

  100.  

  101.         Read_ConfigFile()

  102.         Read_OpeningMotdCommandsFile()

  103.  

  104.         g_iNvault = nvault_open("hlmp")

  105.         nvault_prune(g_iNvault, 0, get_systime(-(A_DAY_IN_SECONDS * NVAULT_MAX_DAYS_SAVE)) )

  106.  

  107.         gmsgMOTD = get_user_msgid("MOTD")

  108. }

  109.  

  110. Read_ConfigFile()

  111. {

  112.         new szConfigFile[64]

  113.         get_localinfo("amxx_configsdir", szConfigFile, charsmax(szConfigFile))

  114.         format(szConfigFile, charsmax(szConfigFile), "%s/mediafiles.ini", szConfigFile)

  115.  

  116.         new iFile = fopen(szConfigFile, "rt")

  117.  

  118.         if(!iFile)

  119.         {

  120.                 return

  121.         }

  122.  

  123.         g_aGroups = ArrayCreate(Group)

  124.  

  125.         new iGroup

  126.         new szText[Radios+16], RadioDatas[Radios], GroupDatas[Group]

  127.         new Array:aRadiosDatas

  128.  

  129.         while(!feof(iFile))

  130.         {

  131.                 fgets(iFile, szText, charsmax(szText))

  132.                 trim( szText )

  133.  

  134.                 if(!szText[0] || szText[0] == '#' || szText[0] == ';' || (szText[0] == '/' && szText[1] == '/'))

  135.                 {

  136.                         continue

  137.                 }

  138.  

  139.                 if( szText[0] == '[' )

  140.                 {

  141.                         iGroup++

  142.                         aRadiosDatas = ArrayCreate( Radios )

  143.  

  144.                         strtok(szText[1], GroupDatas[GroupName], charsmax(GroupDatas[GroupName]), RadioDatas, 1, ']', 0)

  145.                         GroupDatas[GroupArrayOffset] = _:aRadiosDatas

  146.  

  147.                         ArrayPushArray(g_aGroups, GroupDatas)

  148.                 }

  149.                 else if( iGroup )

  150.                 {

  151.                         parse(  szText,

  152.                                         RadioDatas[RadioName], charsmax(RadioDatas[RadioName]),

  153.                                         RadioDatas[RadioUrl], charsmax(RadioDatas[RadioUrl])    )

  154.  

  155.                         ArrayPushString(aRadiosDatas, RadioDatas)

  156.                 }

  157.         }

  158.         fclose(iFile)

  159.  

  160.         g_iGroupsCount = ArraySize(g_aGroups)

  161. }

  162.  

  163. Read_OpeningMotdCommandsFile()

  164. {

  165.         new szConfigFile[64]

  166.         get_localinfo("amxx_configsdir", szConfigFile, charsmax(szConfigFile))

  167.         format(szConfigFile, charsmax(szConfigFile), "%s/hlmp_motd.ini", szConfigFile)

  168.         new iFile = fopen(szConfigFile, "rt")

  169.         if( iFile )

  170.         {

  171.                 new szText[64], szCommand[32]

  172.                 while(!feof(iFile))

  173.                 {

  174.                         fgets(iFile, szText, charsmax(szText))

  175.                         trim( szText )

  176.                         if(!szText[0] || szText[0] == '#' || szText[0] == ';' || (szText[0] == '/' && szText[1] == '/'))

  177.                         {

  178.                                 continue

  179.                         }

  180.                         parse(szText, szCommand, charsmax(szCommand))

  181.                         register_clcmd(szCommand, "OpeningMotdCommands")

  182.                 }

  183.         }      

  184. }

  185.  

  186. public plugin_end()

  187. {

  188.         new TempGroup[Group], iSize = ArraySize(g_aGroups)

  189.  

  190.         for(new i; i<iSize; i++)

  191.         {

  192.                 ArrayGetArray(g_aGroups, i, TempGroup)

  193.                 ArrayDestroy(TempGroup[GroupArrayOffset])

  194.         }

  195.  

  196.         ArrayDestroy(g_aGroups)

  197.  

  198.         nvault_close(g_iNvault)

  199. }

  200.  

  201. public client_connect(id)

  202. {

  203.         g_szAuthid[id] = "C"

  204. }

  205.  

  206. public client_authorized( id )

  207. {

  208.         if( g_szAuthid[id][0] == 'P' )

  209.         {

  210.                 get_user_authid(id, g_szAuthid[id], AUTHID_LENGTH-1)

  211.                 GetPlayerSettings(id)

  212.         }

  213.         else

  214.         {

  215.                 get_user_authid(id, g_szAuthid[id], AUTHID_LENGTH-1)

  216.         }

  217. }

  218.  

  219. public client_putinserver(id)

  220. {

  221.         g_iMenuOption[id] = mGroups

  222.         g_PlayerGroup[id][GroupName][0] = 0

  223.         g_PlayerGroup[id][GroupArrayOffset] = 0

  224.  

  225.         if( g_szAuthid[id][0] == 'C' )

  226.         {

  227.                 g_szAuthid[id] = "P"

  228.                 return

  229.         }

  230.  

  231.         static szSettings[8], szVolume[4], szRepeat[2], szListening[2], iVolume, iDisconnectTime

  232.         nvault_lookup(g_iNvault, g_szAuthid[id], szSettings, charsmax(szSettings), iDisconnectTime)

  233.         parse(szSettings, szVolume, charsmax(szVolume), szRepeat, charsmax(szRepeat), szListening, charsmax(szListening))

  234.  

  235.         if( (iVolume = str_to_num(szVolume)) )

  236.         {

  237.                 g_iVolume[id] = min(iVolume, 100)

  238.         }

  239.         else

  240.         {

  241.                 g_iVolume[id] = DEFAULT_VOLUME

  242.         }

  243.  

  244.         if( str_to_num(szRepeat) )

  245.         {

  246.                 SetIdBits(g_bRepeat, id)

  247.         }

  248.         else

  249.         {

  250.                 ClearIdBits(g_bRepeat, id)

  251.         }

  252.  

  253.         if(     get_systime() - iDisconnectTime < MAX_RECONNECT_TIME

  254.         &&      str_to_num(szListening) == 1

  255.         &&      get_pcvar_num(g_pCvarNoMotd)    )

  256.         {

  257.                 SetIdBits(g_bListening, id)

  258.                 g_iMotdRegistered = register_message(gmsgMOTD, "Message_MOTD")

  259.         }

  260.         else

  261.         {

  262.                 ClearIdBits(g_bListening, id)

  263.         }

  264. }

  265.  

  266. GetPlayerSettings(id)

  267. {

  268.         new szSettings[8], szVolume[4], szRepeat[2], iVolume

  269.         nvault_get(g_iNvault, g_szAuthid[id], szSettings, charsmax(szSettings))

  270.         parse(szSettings, szVolume, charsmax(szVolume), szRepeat, charsmax(szRepeat))

  271.  

  272.         if( (iVolume = str_to_num(szVolume)) )

  273.         {

  274.                 g_iVolume[id] = min(iVolume, 100)

  275.         }

  276.         else

  277.         {

  278.                 g_iVolume[id] = DEFAULT_VOLUME

  279.         }

  280.  

  281.         if( str_to_num(szRepeat) )

  282.         {

  283.                 SetIdBits(g_bRepeat, id)

  284.         }

  285.         else

  286.         {

  287.                 ClearIdBits(g_bRepeat, id)

  288.         }      

  289.  

  290.         ClearIdBits(g_bListening, id)

  291. }

  292.  

  293. public client_disconnect( id )

  294. {

  295.         static szSettings[8]

  296.         formatex(szSettings, charsmax(szSettings), "%d %d %d",

  297.                                                                                 g_iVolume[id],

  298.                                                                                         _:!!(GetIdBits(g_bRepeat, id)),

  299.                                                                                                 _:!!(GetIdBits(g_bListening, id)))

  300.         nvault_set(g_iNvault, g_szAuthid[id], szSettings)

  301.  

  302.         g_szAuthid[id] = "D"

  303. }

  304.  

  305. public Message_MOTD(iMsgId, iDest, id)

  306. {

  307.         if( GetIdBits(g_bListening, id) )

  308.         {

  309.                 if( get_msg_arg_int(1) )

  310.                 {

  311.                         unregister_message(gmsgMOTD, g_iMotdRegistered)

  312.                 }

  313.                 return PLUGIN_HANDLED

  314.         }

  315.         return PLUGIN_CONTINUE

  316. }

  317.  

  318. public ClientCommand_HlmpMenu(id)

  319. {

  320.         DisplayMenu(id, g_iMenuPosition[id] = 0)

  321. }

  322.  

  323. DisplayMenu(id, iPos = 0)

  324. {

  325.         new szMenu[1024], n

  326.         new iKeys = MENU_KEY_6|MENU_KEY_7|MENU_KEY_0

  327.  

  328.         n = formatex(szMenu[n], charsmax(szMenu)-n, "\rHL Media Player (HLMP %s)^n", VERSION)

  329.  

  330.         switch( g_iMenuOption[id] )

  331.         {

  332.                 case mGroups:

  333.                 {

  334.                         new iStart = iPos * 5

  335.                         new iStop = min(iStart + 5 , g_iGroupsCount)

  336.                         new aGroup[Group]

  337.  

  338.                         n += formatex(szMenu[n], charsmax(szMenu)-n, "\d%L^n", id, "HLMP_GROUPS")

  339.  

  340.                         for(new i=iStart, j; i<iStop; i++)

  341.                         {

  342.                                 iKeys |= (1<<j)

  343.                                 ArrayGetArray(g_aGroups, i, aGroup)

  344.                                 n += formatex(szMenu[n], charsmax(szMenu)-n, "\w%d. \r%s^n", ++j, aGroup[GroupName])

  345.                         }

  346.                         iPos = iStop - iStart

  347.                         if( iPos < 5 )

  348.                         {

  349.                                 for(new i; i < 5-iPos; i++)

  350.                                 {

  351.                                         n += formatex(szMenu[n], charsmax(szMenu)-n, "^n")

  352.                                 }

  353.                         }

  354.  

  355.                         if( g_PlayerGroup[id][GroupName][0] )

  356.                         {

  357.                                 n += formatex(szMenu[n], charsmax(szMenu)-n, "\w6. \y%s^n", g_PlayerGroup[id][GroupName])

  358.                         }

  359.                         else

  360.                         {

  361.                                 n += formatex(szMenu[n], charsmax(szMenu)-n, "\w6. \y%L^n", id, "HLMP_CONFIG")

  362.                         }

  363.                         n += formatex(szMenu[n], charsmax(szMenu)-n, "\w7. \y%L^n\w", id, "HLMP_STOPMUSIC")

  364.  

  365.                         if( iStart )

  366.                         {

  367.                                 iKeys |= MENU_KEY_8

  368.                                 n += formatex(szMenu[n], charsmax(szMenu)-n, "8. %L^n", id, "BACK")

  369.                         }

  370.                         else

  371.                         {

  372.                                 n += formatex(szMenu[n], charsmax(szMenu)-n, "^n")

  373.                         }

  374.  

  375.                         if( iStop < g_iGroupsCount )

  376.                         {

  377.                                 iKeys |= MENU_KEY_9

  378.                                 n += formatex(szMenu[n], charsmax(szMenu)-n, "9. %L^n", id, "MORE")

  379.                         }

  380.                         else

  381.                         {

  382.                                 n += formatex(szMenu[n], charsmax(szMenu)-n, "^n")

  383.                         }

  384.                 }

  385.                 case mRadios:

  386.                 {

  387.                         new Array:aRadios = g_PlayerGroup[id][GroupArrayOffset]

  388.                         new aCurRadio[Radios]

  389.                         new iRadiosNum = ArraySize(aRadios)

  390.  

  391.                         new iStart = iPos * 5

  392.                         new iStop = min(iStart + 5 , iRadiosNum)

  393.  

  394.                         n += formatex(szMenu[n], charsmax(szMenu)-n, "\d%s^n", g_PlayerGroup[id][GroupName])

  395.  

  396.                         for(new i=iStart, j; i<iStop; i++)

  397.                         {

  398.                                 iKeys |= (1<<j)

  399.                                 ArrayGetArray(aRadios, i, aCurRadio)

  400.                                 n += formatex(szMenu[n], charsmax(szMenu)-n, "\w%d. \r%s^n", ++j, aCurRadio[RadioName])

  401.                         }

  402.                         iPos = iStop - iStart

  403.                         if( iPos < 5 )

  404.                         {

  405.                                 for(new i; i< 5 - iPos; i++)

  406.                                 {

  407.                                         n += formatex(szMenu[n], charsmax(szMenu)-n, "^n")

  408.                                 }

  409.                         }

  410.  

  411.                         n += formatex(szMenu[n], charsmax(szMenu)-n, "\w6. \y%L^n", id, "HLMP_CONFIG")

  412.                         n += formatex(szMenu[n], charsmax(szMenu)-n, "\w7. \y%L^n\w", id, "HLMP_STOPMUSIC")

  413.  

  414.                         if( iStart )

  415.                         {

  416.                                 iKeys |= MENU_KEY_8

  417.                                 n += formatex(szMenu[n], charsmax(szMenu)-n, "8. %L^n", id, "BACK")

  418.                         }

  419.                         else

  420.                         {

  421.                                 n += formatex(szMenu[n], charsmax(szMenu)-n, "^n")

  422.                         }

  423.  

  424.                         if( iStop < iRadiosNum )

  425.                         {

  426.                                 iKeys |= MENU_KEY_9

  427.                                 n += formatex(szMenu[n], charsmax(szMenu)-n, "9. %L^n", id, "MORE")

  428.                         }

  429.                         else

  430.                         {

  431.                                 n += formatex(szMenu[n], charsmax(szMenu)-n, "^n")

  432.                         }

  433.  

  434.                 }

  435.                 case mConfig:

  436.                 {

  437.                         iKeys |= MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_6|MENU_KEY_7

  438.  

  439.                         n += formatex(szMenu[n], charsmax(szMenu)-n, "\d%L^n", id, "HLMP_CONFIG")

  440.  

  441.                         n += formatex(szMenu[n], charsmax(szMenu)-n, "\w1. \y%L\R%L^n", id, "HLMP_REPEAT", id, GetIdBits(g_bRepeat, id) ? "ON" : "OFF")

  442.                         n += formatex(szMenu[n], charsmax(szMenu)-n, "\w2. \y%L +\R%d^n", id, "HLMP_VOLUME", g_iVolume[id])

  443.                         n += formatex(szMenu[n], charsmax(szMenu)-n, "\w3. \y%L -^n", id, "HLMP_VOLUME")

  444.                         n += formatex(szMenu[n], charsmax(szMenu)-n, "\w4. \y%L^n^n", id, "HLMP_ABOUT")

  445.  

  446.                         n += formatex(szMenu[n], charsmax(szMenu)-n, "\w6. \yGroups^n")

  447.                         n += formatex(szMenu[n], charsmax(szMenu)-n, "\w7. \y%L^n^n^n", id, "HLMP_STOPMUSIC")

  448.                 }

  449.         }

  450.  

  451.         n += formatex(szMenu[n], charsmax(szMenu)-n, "\w0. %L", id, "EXIT")

  452.  

  453.         show_menu(id, iKeys, szMenu, 30, "HLMP")

  454.  

  455.         return PLUGIN_HANDLED

  456. }

  457.  

  458. public HlmpMenuAction(id, iKey)

  459. {

  460.         switch( g_iMenuOption[id] )

  461.         {

  462.                 case mGroups:

  463.                 {

  464.                         switch( iKey )

  465.                         {

  466.                                 case 0..4:

  467.                                 {

  468.                                         ArrayGetArray(g_aGroups, g_iMenuPosition[id]*5 + iKey, g_PlayerGroup[id])

  469.  

  470.                                         g_iMenuOption[id] = mRadios

  471.                                         DisplayMenu(id, g_iMenuPosition[id] = 0)

  472.                                 }

  473.                                 case 5:

  474.                                 {

  475.                                         if( g_PlayerGroup[id][GroupArrayOffset] )

  476.                                         {

  477.                                                 g_iMenuOption[id] = mRadios

  478.                                                 DisplayMenu(id, g_iMenuPosition[id])

  479.                                         }

  480.                                         else

  481.                                         {

  482.                                                 g_iMenuOption[id] = mConfig

  483.                                                 DisplayMenu(id, g_iMenuPosition[id] = 0)

  484.                                         }

  485.                                 }

  486.                                 case 6:

  487.                                 {

  488.                                         ClientCommand_StopMusic(id)

  489.                                 }

  490.                                 case 7:

  491.                                 {

  492.                                         if( --g_iMenuPosition[id] < 0 )

  493.                                         {

  494.                                                 g_iMenuPosition[id] = 0

  495.                                         }

  496.                                         DisplayMenu(id, g_iMenuPosition[id])

  497.                                 }

  498.                                 case 8:

  499.                                 {

  500.                                         if( ++g_iMenuPosition[id] >= g_iGroupsCount / 5 )

  501.                                         {

  502.                                                 g_iMenuPosition[id] = g_iGroupsCount / 5

  503.                                         }

  504.                                         DisplayMenu(id, g_iMenuPosition[id])

  505.                                 }

  506.                                 case 9:

  507.                                 {

  508.                                         return PLUGIN_HANDLED

  509.                                 }

  510.                         }

  511.                 }

  512.                 case mRadios:

  513.                 {

  514.                         switch( iKey )

  515.                         {

  516.                                 case 0..4:

  517.                                 {

  518.                                         PlayMusic(id, g_PlayerGroup[id][GroupArrayOffset], g_iMenuPosition[id]*5 + iKey)

  519.                                 }

  520.                                 case 5:

  521.                                 {

  522.                                         g_iMenuOption[id] = mConfig

  523.                                         DisplayMenu(id, g_iMenuPosition[id] = 0)

  524.                                 }

  525.                                 case 6:

  526.                                 {

  527.                                         ClientCommand_StopMusic(id)

  528.                                 }

  529.                                 case 7:

  530.                                 {

  531.                                         if( --g_iMenuPosition[id] < 0 )

  532.                                         {

  533.                                                 g_iMenuPosition[id] = 0

  534.                                         }

  535.                                         DisplayMenu(id, g_iMenuPosition[id])

  536.                                 }

  537.                                 case 8:

  538.                                 {

  539.                                         new iSize = ArraySize(g_PlayerGroup[id][GroupArrayOffset])

  540.                                         if( ++g_iMenuPosition[id] >= iSize / 5 )

  541.                                         {

  542.                                                 g_iMenuPosition[id] = iSize / 5

  543.                                         }

  544.                                         DisplayMenu(id, g_iMenuPosition[id])

  545.                                 }

  546.                                 case 9:

  547.                                 {

  548.                                         return PLUGIN_HANDLED

  549.                                 }

  550.                         }

  551.                 }

  552.                 case mConfig:

  553.                 {

  554.                         switch( iKey )

  555.                         {

  556.                                 case 0:

  557.                                 {

  558.                                         if( GetIdBits(g_bRepeat, id) )

  559.                                         {

  560.                                                 ClearIdBits(g_bRepeat, id)

  561.                                         }

  562.                                         else

  563.                                         {

  564.                                                 SetIdBits(g_bRepeat, id)

  565.                                         }

  566.                                         client_print(id, print_chat, "%L", id, "HLMP_CONFIGMENUTIP")

  567.                                         DisplayMenu(id)

  568.                                 }

  569.                                 case 1:

  570.                                 {

  571.                                         if( (g_iVolume[id] += 5) > 100)

  572.                                         {

  573.                                                 g_iVolume[id] = 100

  574.                                         }

  575.                                         client_print(id, print_chat, "%L", id, "HLMP_CONFIGMENUTIP")

  576.                                         DisplayMenu(id)

  577.                                 }

  578.                                 case 2:

  579.                                 {

  580.                                         if( (g_iVolume[id] -= 5) < 0)

  581.                                         {

  582.                                                 g_iVolume[id] = 0

  583.                                         }

  584.                                         client_print(id, print_chat, "%L", id, "HLMP_CONFIGMENUTIP")

  585.                                         DisplayMenu(id)

  586.                                 }

  587.                                 case 3:

  588.                                 {

  589.                                         client_print(id, print_chat, "HL Media Player %s by ConnorMcLeod, download link in console.", VERSION)

  590.                                         client_print(id, print_center, "HL Media Player %s by ConnorMcLeod", VERSION)

  591.                                         client_print(id, print_console, "http://forums.alliedmods.net/showthread.php?p=833070#post833070")

  592.                                 }

  593.                                 case 5:

  594.                                 {

  595.                                         g_iMenuOption[id] = mGroups

  596.                                         DisplayMenu(id, g_iMenuPosition[id] = 0)

  597.                                 }

  598.                                 case 6:

  599.                                 {

  600.                                         ClientCommand_StopMusic(id)

  601.                                 }

  602.                                 case 9:

  603.                                 {

  604.                                         return PLUGIN_HANDLED

  605.                                 }

  606.                                 default:

  607.                                 {

  608.                                         DisplayMenu(id)

  609.                                 }

  610.                         }

  611.                 }

  612.         }

  613.         return PLUGIN_HANDLED

  614. }

  615.  

  616. PlayMusic(id, Array:aGroup, iRadio)

  617. {

  618.         new Radio[Radios]

  619.         ArrayGetArray(aGroup, iRadio, Radio)

  620.  

  621.         if( get_pcvar_num(g_pCvarShowAll) )

  622.         {

  623.                 new szName[32]

  624.                 get_user_name(id, szName, charsmax(szName))

  625.                 client_print(0, print_chat, "%L", LANG_PLAYER, "HLMP_LISTENING", szName, Radio[RadioName])

  626.         }

  627.  

  628.         new szMotd[1024], n

  629.  

  630.         n = formatex(szMotd[n], charsmax(szMotd)-n, "<html><head><meta http-equiv=^"content-type^" content=^"text/html; charset=UTF-8^"></head><body bgcolor=^"#000000^" align=^"center^"><span style=^"color: #FFB000; font-size: 9pt^">Now playing: %s <br>", Radio[RadioName])

  631.         n += formatex(szMotd[n], charsmax(szMotd)-n, "<object classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 codebase=http://www.microsoft.com/ntserver/netshow/download/en/nsmp2inf.cab#Version=5,1,51,415 type=application/x-oleobject name=msplayer width=256 height=65 align=^"middle^" id=msplayer>")

  632.         n += formatex(szMotd[n], charsmax(szMotd)-n, "<param name=^"enableContextMenu^" value=^"0^"><param name=^"stretchToFit^" value=^"1^">")

  633.         if(GetIdBits(g_bRepeat, id))

  634.         {

  635.                 n += formatex(szMotd[n], charsmax(szMotd)-n, "<param name=^"AutoRewind^" value=^"1^">")

  636.         }

  637.         n += formatex(szMotd[n], charsmax(szMotd)-n, "<param name=^"Volume^" value=^"%d^">", g_iVolume[id])

  638.         n += formatex(szMotd[n], charsmax(szMotd)-n, "<param name=^"AutoStart^" value=^"1^"><param name=^"URL^" value=^"%s^">", Radio[RadioUrl])

  639.         n += formatex(szMotd[n], charsmax(szMotd)-n, "<param name=^"uiMode^" value=^"full^"><param name=^"width^" value=^"256^"><param name=^"height^" value=^"65^">")

  640.         n += formatex(szMotd[n], charsmax(szMotd)-n, "<param name=^"TransparentAtStart^" value=^"1^"></object><br>^"%L^"</span>", id, "HLMP_CLOSEWINDOW")

  641.         n += formatex(szMotd[n], charsmax(szMotd)-n, "</body></html>")

  642.  

  643.         show_motd(id, szMotd, "HL Media Player")

  644.  

  645.         SetIdBits(g_bListening, id)

  646. }

  647.  

  648. public ClientCommand_StopMusic(id)

  649. {

  650.         new szMotd[256]

  651.         formatex(szMotd, charsmax(szMotd), "<html><head><meta http-equiv=^"content-type^" content=^"text/html; charset=UTF-8^"></head><body bgcolor=^"#000000^" align=^"center^"><span style=^"color: #FFB000; font-size: 9pt^">^"%L^"</span></body></html>", id, "HLMP_CLOSEWINDOW")

  652.         show_motd(id, szMotd, "HL Media Player")

  653.         ClearIdBits(g_bListening, id)

  654.         return PLUGIN_HANDLED

  655. }

  656.  

  657. public OpeningMotdCommands(id)

  658. {

  659.         ClearIdBits(g_bListening, id)

  660. }

Ezt a plugint kellene úgy átalakítni, hogy ha valaki disconnectel, akkor leálljon magától. Továbbá ha nem windows media player használni, az jó lenne. Köszönöm előre.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Rádió
HozzászólásElküldve:2012.07.06. 21:04 
Offline
Veterán
Avatar

Csatlakozott:2011.06.07. 15:29
Hozzászólások:1728
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 63 alkalommal
Plugin kérése: Nem létező pluginokat kérni.
Scripting: Létező pluginokat átalakítani igényeid szerint.

Áthelyezve.


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése: Rendezés 
Új téma nyitása Hozzászólás a témához  [2 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 4 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole