-
Posts
527 -
Joined
-
Last visited
-
Days Won
3
Everything posted by justn
-
Same error, but it's on line 69 now .. and it just outputs to the chat : 0
-
local radios = { [1] = {"None","None"}, [2] = {"http://mp3uplink.duplexfx.com:8054/listen.pls","West Coast Rap"}, [3] = {"http://somafm.com/dubstep.pls","Dubstep"}, [4] = {"http://www.181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040)&file=181-power.pls","Power 181"}, [5] = {"http://193.34.51.25/listen.pls","rauteMusik."}, [6] = {"http://212.45.104.34:8042/listen.pls","defjay"} } Tried that and the error was ERROR: radio\client.lua:72: attempt to index field '?' (a nil value) __ Also tried this table below and the error was the same thing .. local radios = { {1,"None","None"}, {2,"http://mp3uplink.duplexfx.com:8054/listen.pls","West Coast Rap"}, {3,"http://somafm.com/dubstep.pls","Dubstep"}, {4,"http://www.181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040)&file=181-power.pls","Power 181"}, {5,"http://193.34.51.25/listen.pls","rauteMusik."}, {6,"http://212.45.104.34:8042/listen.pls","defjay"} }
-
Stream: None Title: None
-
ERROR:radio\client.lua:72: attempt to index field '?' ( a nil value ) I removed the numbers .. same errors
-
Aha, i see the problem TESTED --client local SkinMarker = createMarker(224.80000305176,1859.1999511719,11.800000190735, "cylinder", 1.0, 245, 0, 0, 255) createBlipAttachedTo(SkinMarker,45,2,0,255,0,0,0,200) setElementInterior (SkinMarker,0) setElementDimension (SkinMarker, 0) GUIEditor = { button = {}, window = {}, radiobutton = {} } GUIEditor.window[1] = guiCreateWindow(904, 330, 179, 104, "Skin Selector", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.radiobutton[1] = guiCreateRadioButton(14, 28, 155, 15, "Skin #1 - Female Soldier", false, GUIEditor.window[1]) GUIEditor.radiobutton[2] = guiCreateRadioButton(14, 49, 155, 15, "Skin #2 - Male SWAT", false, GUIEditor.window[1]) guiRadioButtonSetSelected(GUIEditor.radiobutton[1], true) showCursor(true) GUIEditor.button[1] = guiCreateButton(34, 74, 111, 20, "Done", false, GUIEditor.window[1]) function ShowWindow(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(GUIEditor.window[1]) then guiSetVisible(GUIEditor.window[1], true) showCursor(true) end end end addEventHandler("onClientMarkerHit",SkinMarker, ShowWindow) addEventHandler("onClientGUIClick",GUIEditor.window[1], function (b) if b == "left" then if source == GUIEditor.radiobutton[1] then triggerServerEvent ("FemaleSkin", localPlayer) elseif source == GUIEditor.radiobutton[2] then triggerServerEvent ("MaleSkin", localPlayer) end end end) function Done () if source == GUIEditor.button[1] then showCursor (false) guiSetVisible (GUIEditor.window[1],false) end end addEventHandler ("onClientGUIClick", root, Done)
-
Great map budya ! Of course same you as always
-
To modify the width, did you read mta wiki? Note: this is for addScoreboardColumn name: The column name (also the element data name used to get information from). forElement: The player to who the column should be added for. width: Width of the column in pixels. friendlyName: Friendly name (displayed in the scoreboard) of the column. priority: The priority slot of the column (1-500). If slot isn't free, the column in that slot will be pushed forward.
-
here's the entire code n = 0 local radios = { {"None","None",6}, {"http://mp3uplink.duplexfx.com:8054/listen.pls","West Coast Rap",5}, {"http://somafm.com/dubstep.pls","Dubstep",4}, {"http://www.181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040)&file=181-power.pls","Power 181",3}, {"http://193.34.51.25/listen.pls","rauteMusik.",2}, {"http://212.45.104.34:8042/listen.pls","defjay",1} } title = "Radio Off" addEventHandler("onClientSoundChangedMeta", root, function(streamTitle) title = streamTitle end) addEventHandler("onClientSoundStream",root,function(suc,length,streamN) title = streamN end) function onPlayerEnterVehicle(thePlayer,seat) if seat == 0 then setRadioChannel(0) addEventHandler("onClientRender", getRootElement(), RenderClient) bindKey("mouse_wheel_up", "down", PlaySound, "up") bindKey("mouse_wheel_down", "down", PlaySound, "down") end end addEventHandler("onClientPlayerVehicleEnter", getRootElement(), onPlayerEnterVehicle) function stopMySound(player,seat) if ( player == localPlayer ) then stopSound( sound ) removeEventHandler("onClientRender", getRootElement(), RenderClient) unbindKey("mouse_wheel_up", "down", PlaySound) unbindKey("mouse_wheel_down", "down", PlaySound) n = 0 end end addEventHandler("onClientPlayerVehicleExit",getRootElement(),stopMySound) function RenderClient() if isPedInVehicle(localPlayer) then local x,y = guiGetScreenSize() dxDrawText("Song Name: "..title, x*0.299, y*0.778, x*0.599, y*0.800, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("Radio: "..tostring(radiotitle), x*0.299, y*0.757, x*0.599, y*0.778, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) end end function PlaySound(state) local x,y,z = getElementPosition(getLocalPlayer()) n = tonumber(n) if sound then stopSound(sound) end if state == "up" then n = n + 1 if n == 6 then n = 1 end elseif state == "down" then n = n - 1 if n == 0 then n = 1 end end local n = tonumber(n) outputChatBox(n) sound = playSound3D(radios[1][1], x,y,z) outputChatBox("Stream: "..radios[1][1]) outputChatBox("Title: "..radios[1][2]) radiotitle = radios[n][2] end function UpdateSound() if sound then local x,y,z = getElementPosition(getLocalPlayer()) setElementPosition(sound, x,y,z) end end addEventHandler("onClientRender", getRootElement(), UpdateSound)
-
--Server function FemaleSkin() setElementModel( source, 201 ) end addEvent("FemaleSkin",true) addEventHandler("FemaleSkin", root, FemaleSkin) function MaleSkin() setElementModel(source, 202) end addEvent("MaleSkin",true) addEventHandler("MaleSkin", root, MaleSkin)
-
Read mta wiki.
-
Have you read my code, compared to yours ? and remove onClientGUIClick, not needed..
-
What do you mean ? are you talking about the freeroam resource ? If yes then you can edit the places to respawn in the meta.xml file.
-
1. (SERVER)The event was not added 2. (CLIENT)You can't just put 'else if triggerServerEvent' 3. (CLIENT) It's triggerServerEvent not tiggerServerEvent --Server function FemaleSkin(player) setElementModel( player, 201 ) end addEvent("FemaleSkin",true) addEventHandler("FemaleSkin", root, FemaleSkin) function MaleSkin(player) setElementModel(player, 202) end addEvent("MaleSkin",true) addEventHandler("MaleSkin", root, MaleSkin) --client function SelectSKIN() if guiRadioButtonGetSelected(GUIEditor.radiobutton[1]) then triggerServerEvent("FemaleSkin", localPlayer) elseif guiRadioButtonGetSelected(GUIEditor.radiobutton[2]) then triggerServerEvent("MaleSkin", localPlayer) end end
-
Like this .. local ranks = { {"Criminal", "Street Rat", 0}, {"Criminal", "Mugger", 100}, {"Police", "Trainee", 0}, {"Police", "Officer", 100} }
-
ERROR: Radio\client.lua:67: attempt to index field '?' (a nil value) In this case, line 67 would be line 48 in your code.
-
You didn't even do the table right ..
-
local radios = { {"None","None",6}, {"http://mp3uplink.duplexfx.com:8054/listen.pls","West Coast Rap",5}, {"http://somafm.com/dubstep.pls","Dubstep",4}, {"http://www.181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040)&file=181-power.pls","Power 181",3}, {"http://193.34.51.25/listen.pls","rauteMusik.",2}, {"http://212.45.104.34:8042/listen.pls","defjay",1} }
-
I don't see the difference really. Because it does the same thing as my code, it plays, when i am on one radio station, and i switch, most of the radio stations gets deleted i dont know why really .. theres only 1 radio station which stays , but all the others , deleted.
-
Put this for server .. function openVIPPanel() if getAccountData(getPlayerAccount(source), "vip" ) == 1 then triggerClientEvent ("vipPanelOpen", getRootElement()) exports["ac-message"]:outputTopBar("VIP: Panel opened!", source,0,255,0) else exports["ac-message"]:outputTopBar("VIP: You are not vip!", source,255,0,0) end end addCommandHandler("vip", openVIPPanel ) and for client..the function show should be like this function show () if ( guiGetVisible(vipPanel.Window[1]) == true ) then guiSetVisible (vipPanel.Window[1], false) showCursor (false) else guiSetVisible (vipPanel.Window[1], true) showCursor (true) end end addEvent ("vipPanelOpen",true) addEventHandler ("vipPanelOpen",root,show)
-
Copy it again, had a small typo error, anyways why would you use thePlayer for the server side, when you can just use source ?
-
triggerClientEvent should be like this .. triggerClientEvent ("vipPanelOpen", thePlayer) Replace the function show, with this function show () if ( guiGetVisible(vipPanel.Window[1]) == true ) then guiSetVisible (vipPanel.Window[1], false) showCursor (false) else guiSetVisible (vipPanel.Window[1], true) showCursor (true) end end addEvent ("vipPanelOpen",true) addEventHandler ("vipPanelOpen",root,show)
-
Hi, i am making a food store, and the problem is , when the player clicks the button, it doesn't set the health addEventHandler("onClientGUIClick",Burger_Window, function(b) if b == "left" then if source == Burger_Kids then takePlayerMoney(2) setElementHealth(getElementHealth(localPlayer)+2) elseif source == Burger_Regular then takePlayerMoney(5) setElementHealth(getElementHealth(localPlayer)+5) elseif source == Burger_Large then takePlayerMoney(8) setElementHealth(getElementHealth(localPlayer)+8) elseif source == Burger_Salad then takePlayerMoney(10) setElementHealth(getElementHealth(localPlayer)+10) elseif source == Burger_Close then guiSetVisible(Burger_Window,false) showCursor(false) end end end)
-
The Bug Is I have this radio script and the problem is that when the player is in a vehicle, sometimes the radio stations gets removed automatically, fix this problem ty ! and i need a little help, so i can hear the music playing from another player's car when im outside of a vehicle addEventHandler("onClientPlayerVehicleEnter", getRootElement(), function(thePlayer,seat) if seat == 0 then setRadioChannel(0) local x, y = guiGetScreenSize() addEventHandler("onClientRender",root,function() if isPedInVehicle(localPlayer) then dxradio = dxDrawText("Song Name: "..title, x*0.299, y*0.778, x*0.599, y*0.800, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) dxtitle = dxDrawText("Radio: "..tostring(radiotitle), x*0.299, y*0.757, x*0.599, y*0.778, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) --1024x768 else if dxradio then destroyElement(dxradio) destroyElement(dxtitle) end end end) bindKey("mouse_wheel_up", "down", function() setRadioChannel(0) local xp,yp,zp = getElementPosition(thePlayer) if tonumber(n) ~= 6 then destroyElement(sound) n = n+1 sound = playSound3D( radios[n][1],xp,yp,zp ) radiotitle = radios[n][2] attachElements(sound, thePlayer) end end) bindKey("mouse_wheel_down", "down", function() setRadioChannel(0) local xp,yp,zp = getElementPosition(thePlayer) if tonumber(n) ~= 1 then destroyElement(sound) n = n-1 sound = playSound3D( radios[n][1],xp,yp,zp ) radiotitle = radios[n][2] attachElements(sound, thePlayer) end end) end end ) function stopMySound(player,seat) if ( player == localPlayer ) then destroyElement( sound ) n = 0 end end addEventHandler("onClientPlayerVehicleExit",getRootElement(),stopMySound)