Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. http://www.radiostyle.ru/ Шаги: 1.Находишь радиостанцию которая нужна. 2.Находишь значёк винампа. 3.Открываешь ( блокнотом например ). 4.Находишь url.
  2. У вас неправильньй вариант .. Лучше используйте вариант TEDERIs'а.
  3. Kenix

    Heelp

    I not understand you. You need create crosshair or 3d line of weapon to target.
  4. Клиент addEvent( 'onClientPlaySound',true ) local vol window = guiCreateWindow( 15,300,150,200,"[CSRP] Radio Panel",false ) guiWindowSetSizable( window,false ) guiSetVisible( window, false ) radio = guiCreateButton( 25,25,100,50,"Play/Stop Radio",false,window ) addEventHandler ( "onClientGUIClick", radio, startRadio, false ) a = guiCreateButton(35,80,80,15,"Volume 1",false,window ) addEventHandler ( "onClientGUIClick", a, startA, false ) b = guiCreateButton(35,100,80,15,"Volume 2",false,window ) addEventHandler ( "onClientGUIClick", b, startB, false ) c = guiCreateButton(35,120,80,15,"Volume 3",false,window ) addEventHandler ( "onClientGUIClick", c, startC, false ) d = guiCreateButton(35,140,80,15,"Volume 4",false,window ) addEventHandler ( "onClientGUIClick", d, startD, false ) e = guiCreateButton(35,160,80,15,"Volume 5",false,window ) addEventHandler ( "onClientGUIClick", e, startE, false ) function showRadio( ) if guiGetVisible ( window ) then guiSetVisible ( window, false ) showCursor( false ) elseif not guiGetVisible ( window ) then guiSetVisible ( window, true ) showCursor( true ) end end function startRadio() triggerServerEvent( 'onPlaySound',localPlayer ) end function startA () vol = 0.1 setSoundVolume( sound, vol ) end function startB() vol = 0.2 setSoundVolume( sound, vol ) end function startC() vol = 0.4 setSoundVolume( sound, vol ) end function startD() vol = 0.8 setSoundVolume( sound, vol ) end function startE() vol = 1.0 setSoundVolume( sound, vol ) end addEventHandler( "onClientResourceStart", resourceRoot, function( ) bindKey( "F4", "down", showRadio ) vol = 0.2 end ) addEventHandler( 'onClientPlaySound',root, function( ) if not sound then sound = playSound('http://217.147.86.151:20175/listen.pls', false) setSoundVolume( sound, vol ) else destroyElement( sound ) sound = nil end end ) Сервер addEvent( 'onPlaySound',true ) addEventHandler( 'onPlaySound',root, function( ) triggerClientEvent( 'onClientPlaySound',root ) end )
  5. local t = { ['!buyfix'] = function( player ) if isElement( player ) then local veh = getPedOccupiedVehicle( player ) if veh then return fixVehicle( veh ) end end end; ['!nitro'] = function( player ) if isElement( player ) then local veh = getPedOccupiedVehicle( player ) if veh then return addVehicleUpgrade( veh,1010 ) end end end; } addEventHandler( 'onPlayerChat',root, function( msg,Type ) if Type == 0 then if msg == '!buyfix' or msg == '!nitro' then t[ msg ]( source ) cancelEvent( ) end end end ) +1 На вики всё удобно сделано ... Найти не составит проблем.
  6. Грубо говоря смени на другой url.В аргументах функции playSound. http://ru.wikipedia.org/wiki/Интернет-радио
  7. function guiCreateColorLabel( ax, ay, bx, by,str, bool, parent ) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find( pat, 1 ) local last = 1 local r,g,b while s do if cap == "" and col then r,g,b = tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth( cap ) avc321 = guiCreateLabel( ax, ay, ax + w, by,cap,bool,parent ) if not r then r = 255 end if not g then g = 255 end if not b then b = 255 end guiLabelSetColor( avc321,r,g,b ) ax = ax + w r,g,b = tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ) end last = e + 1 s, e, cap, col = str:find( pat, last ) end if last <= #str then local cap = str:sub( last ) local w = dxGetTextWidth( cap ) local avc123 = guiCreateLabel( ax, ay, ax + w, by,cap,bool,parent ) guiLabelSetColor( avc123,r or 255,g or 255,b or 255 ) return avc123 end end
  8. local iDefaultSkin = getElementData( client, "defaultsskin" ) or 0
  9. Это ошибка означает , что такого потока интернет радио нет. Попробуй другой поток интернет радио.
  10. local armsdealer_blip = { } local car1_blip = { } function vehicleStartEnterCheck(thePlayer, seat, jacked) if ( source == car1) then if getElementModel ( thePlayer ) == 11 then armsdealer_blip[ thePlayer ] = createBlip ( -931.522,2031.7,60.1, 41, 0, 0, 0, 255, thePlayer ) setElementVisibleTo ( armsdealer_blip[ thePlayer ], thePlayer, true ) car1_blip[ thePlayer ] = createBlipAttachedTo ( source, 51 ) end end end addEventHandler( "onVehicleStartEnter",root,vehicleStartEnterCheck ) function sell_marker_hit( uElement, dim ) if getElementType( uElement ) == 'player' then local skin = getElementModel ( uElement ) if source == sell_marker then if skin == 11 then outputChatBox ( "Thanks for weps dude! Hope this police never get you!", uElement, 155, 100, 82, true ) givePlayerMoney( uElement,1500 ) setVehicleLocked ( ARMSCar, false ) destroyElement( sell_marker ) destroyElement( car1 ) --удаление машины destroyElement ( car1_blip[ uElement ] ) --удаление блипа1 destroyElement ( armsdealer_blip[ uElement ] ) --удаление блипа2 end end end end addEventHandler ( "onMarkerHit",root,sell_marker_hit ) addEventHandler( 'onPlayerQuit',root, function( ) if isElement( car1_blip[ source ] ) then destroyElement( car1_blip[ source ] ) end if isElement( armsdealer_blip[ source ] ) then destroyElement( armsdealer_blip[ source ] ) end armsdealer_blip[ source ] = nil car1_blip[ source ] = nil end ) Просто таблицы юзай .. В качестве индекса юзай игрока. Переменные ARMSCar,sell_marker,car1 определены?
  11. exports.scoreboard:addScoreboardColumn( "Zone",root,3,0.15 ) local uTimers = { } function setZoneData( player ) local player = player or source if isTimer( uTimers[ player ] ) then killTimer( uTimers[ player ] ) end uTimers[ player ] = setTimer( function( player ) local playerX, playerY, playerZ = getElementPosition ( player ) local playerZoneName = getZoneName ( playerX, playerY, playerZ ) setElementData ( player,"Zone" , playerZoneName ) end, 1000, 0, player ) end addEventHandler( 'onResourceStart',resourceRoot, function( ) for _,v in pairs( getElementsByType 'player' ) do setZoneData( v ) end end ) addEventHandler( 'onPlayerQuit',root, function( ) if isTimer( uTimers[ source ] ) then killTimer( uTimers[ source ] ) end uTimers[ source ] = nil end ) addEventHandler( 'onPlayerJoin',root,setZoneData ) Updated again. Tested. I see now export functions in resource scoreboard and i not found 'scoreboardAddColumn'. So you need use function addScoreboardColumn or add scoreboardAddColumn to meta.xml( export function).
  12. /debugscript 3? meta.xml ?
  13. exports["scoreboard"]:scoreboardAddColumn( "Zone",root,30,"City" ) local uTimers = { } function setZoneData( player ) local player = player or source if isTimer( uTimers[ player ] ) then killTimer( uTimers[ player ] ) end uTimers[ player ] = setTimer( function( player ) local playerX, playerY, playerZ = getElementPosition ( player ) local playerZoneName = getZoneName ( playerX, playerY, playerZ ) setElementData ( player,"Zone" , playerZoneName ) end, 1000, 0, player ) end addEventHandler( 'onResourceStart',resourceRoot, function( ) for _,v in pairs( getElementsByType 'player' ) do setZoneData( v ) end end ) addEventHandler( 'onPlayerQuit',root, function( ) if isTimer( uTimers[ source ] ) then killTimer( uTimers[ source ] ) end uTimers[ source ] = nil end ) addEventHandler( 'onPlayerJoin',root,setZoneData ) Updated. Learn it https://wiki.multitheftauto.com/wiki/Scr ... troduction
  14. localPlayer only in client side ..
  15. Если вы не хотите исправить свой код, то пожалуйста.
  16. Я имею ввиду, что в твоём коде нет этих строк
  17. No problem. No i test this if you lock car and exit and again enter then your car unlock. So you need lock car. You said if this car owner then unlock car. Just change the code as you want.
  18. function table.replace( t,condition,repl ) if type( t ) == "table" then if type( condition ) == "number" or type( condition ) == "string" or type( condition ) == "boolean" and type( repl ) == "number" or type( repl ) == "string" or type( repl ) == "boolean" then local old = t local new = { } for i,v in pairs( old ) do if v == condition then new[ i ] = repl else new[ i ] = v end end return new,old elseif type( condition ) == "table" and type( repl ) == "table" then local old = t local new = { } for i,v in pairs( old ) do if v == condition[ i ] then new[ i ] = repl[ i ] else new[ i ] = v end end return new,old end return false end return false end local ourTable = { } ourTable.name = "name1" ourTable.serial = "FAAAF" for _,v in pairs( table.replace( ourTable,'name1','_' ) ) do print( v ) end --[[ Output: _ FAAAF ]] Read my code and comments. Use my function table.replace. You mean it?
  19. Хороший пример. Почему трудный? Задавай вопросы, мы ответим.
  20. Because this: function getMapsForGm( name ) local running = getResourceFromName( name ) or exports.mapmanager:getRunningGamemode( ) if running then return exports.mapmanager:getMapsCompatibleWithGamemode( running ) end return false end get maps from name gm or current ( running ) gm.
×
×
  • Create New...