goofie88
Members-
Posts
63 -
Joined
-
Last visited
Everything posted by goofie88
-
yes exactly it wont work if I place export in server side
-
Hello, i have problem with script, it should output message above screen but it does not when script is server side only when client side it outputs resX, resY = guiGetScreenSize() local x,y,w,h = resX/4+(resX/16),0,resX/2-(resX/16),0 container = {x,y,w,h} local messages = {} local locmessages = {} local fontIndex = 4 local fonts = { {15,"default",1}, {15,dxCreateFont ( "helvetica.ttf",9 ,true ),1}, {16,"bankgothic",0.5}, {15,"default-bold",1} } function drawContainer() dxDrawRectangle(container[1],container[2],container[3],container[4],tocolor(0,0,0,210)) if messages[1] then local y = messages[1][5] local removeMessage if messages[1][3] then y = y - 1 messages[1][5] = y container[4] = container[4] - 1 if messages[1][5] == (-1 * messages[1][7]) then removeMessage = true if #messages == 1 then killTimer(MESSAGETIMER) MESSAGETIMER = false end end end local x = container[1] local w = container[1] + container[3] for k, message in ipairs(messages) do local h = message[7] local msg = message[1] if message[8] then local messageTable = message[8] msg = msg:format(message[8][1](message[8][2])) end dxDrawText(msg:gsub("#%x%x%x%x%x%x", ""),container[1] + 12,y,w - (12*2),y + h,message[2],fonts[fontIndex][3],fonts[fontIndex][2],"center","top",true,true,false, false, true) y = y + h end if removeMessage then table.remove(messages,1) removeMessage = false end end end function moveMessage (i) messages[i][3] = true end function addMessage(text,r,g,b,formattable) if not MESSAGETIMER then MESSAGETIMER = setTimer(messageTimer,1000,0) end if #messages > 5 then local i = 1 while messages[i + 1][3] do i = i + 1 end if messages[i] then messages[i][3] = true end end local h = fonts[fontIndex][1]--15 local msg = text if formattable then local messageTable = {} for k, func in ipairs(formattable) do table.insert(messageTable,func()) end msg = text:format(unpack(messageTable)) end local textWidth = dxGetTextWidth(msg,fonts[fontIndex][3],fonts[fontIndex][2]) if textWidth > container[3] then h = 2 * h --15 end container[4] = container[4] + h local color = tocolor(r, g, b, 255) table.insert(messages,{text,color,false,0,0,10,h,formattable}) return messages[#messages] end function onClientResourceStart() resX,resY = guiGetScreenSize() if resX > 1280 then fontIndex = 2 end local x,y,w,h = resX/4+(resX/16),0,resX/2-(resX/16),0 container = {x,y,w,h} addEventHandler("onClientPreRender",getRootElement(),drawContainer) end function messageTimer() for k,message in ipairs(messages) do message[6] = message[6] - 1 if message[6] <= 0 then moveMessage(1) end end end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),onClientResourceStart) addEvent("DxMsgS",true) function DxMsgS(message,r,g,b) addMessage(message, r,g,b) end addEventHandler("DxMsgS",getLocalPlayer(),DxMsgS) function DxMsgClient(msg,r,g,b,static,silent) DxMsgS(msg,r,g,b) end Here is error code ERROR: call: failed to call 'topchatbox:DxMsgClient [string "?"] Ill be happy for help
-
I see, i'll use Kenix code then Thanks guys
-
Wow that's awesome man works like a charm now Edit: Kenix thanks for helping your code also worked ;D
-
I doesn't even output anything because when I log in I get immediately banned
-
@Solidsnake14: thanks for help Solidsnake14 but unfortunately this didn't help me, i'mstill getting bans. @Kenix: thanks for your explanation, really appreciated
-
hi i have a big problem, get ban when adding second serial for some reason, here is code local accounts = { [ "goofie88" ] = "A314BF0A3A7A553CA3269B3CDD6E93D2" or "4BF0A3A7A553CA3269B3CA21DD6E93D2" } function seriousProblem( _, account ) local accountName = getAccountName ( account ) local serial = getPlayerSerial ( source ) if ( accounts [ accountName ] and accounts [ accountName ] ~= serial ) then addBan ( nil, nil, serial, source) end end addEventHandler ( "onPlayerLogin", root, seriousProblem)
-
It's ok no need to give me the full code, I just needed some kind of tip Thank you
-
Hello I have bug with vehicles, they fall if they placed on object that is above water, when i respawn vehicle everything is ok but when i go far then back to the place the vehicles are in water, anyone know fix? something like elementFrozen but when enter it unfreezes? Thank you for help
-
Thank you I hear the sound now but others dont hear, is that bcz its client side? if yes then how should I do so others car hear? Thank you again
-
<meta> <info author="goofie88" name="Sound Panel" version="1.3r" type="script" />> <script src="sounds_client.lua" type="client"/> <file src="sounds/roger.mp3"/> </meta>
-
Thank you for trying to help Jaysds1 but unfortunately it still doesn't make the sound and no errors in /debugscript 3
-
Still the same theres no sound function pressed1() if voice then if one == true then local x, y, z = getElementPosition(getLocalPlayer()) if tab1 then triggerEvent("sendSound", getLocalPlayer(), "1.1", x, y, z) end end disableAll() end end
-
hello guys I've made a voice thing but for some reason it shows the voice but when I press 1 theres no souns Client voice = nil addCommandHandler("voice", function() if not voice then voice = 1 else voice = nil end end ) addEventHandler("onClientPlayerWasted", getLocalPlayer(), function() voice = nil end) local width,height = guiGetScreenSize() addEventHandler("onClientRender", getRootElement(), function() if voice then tab1 = nil tab2 = nil dxDrawText("Radio Machine ",1,(height/2)-80,width,height,tocolor(255,255,255,255),0.6,"bankgothic" ) if not isPedInVehicle(getLocalPlayer()) then tab1 = 1 dxDrawRectangle(0,(height/2)-80,220,200,tocolor(0,0,0,70)) if not disabled then dxDrawText("(1) Roger",1,(height/2)-60,width,height,tocolor(100,150,240,255),0.6,"bankgothic" ) one = true else dxDrawText("(1) Roger",1,(height/2)-60,width,height,tocolor(100,100,100,255),0.6,"bankgothic" ) one = false end end end end) function pressed1() if voice then if one == true then local x, y, z = getElementPosition(getLocalPlayer()) if tab1 then triggerEvent("sendSound", getLocalPlayer(), "1.1", x, y, z) end end disableAll() end end function disableAll() disabled = 1 setTimer(enableAll, 5000, 1) end function enableAll() disabled = nil end bindKey("1", "down", pressed1) function sendSound (sound, nX, nY, nZ) local pX, pY, pZ = getElementPosition(getLocalPlayer()) local dist = getDistanceBetweenPoints3D(pX, pY, pZ, nX, nY, nZ) if dist < 40 then if sound == "1.1" then playSound("sounds/roger.mp3", false) end end end addEventHandler("sendSound", getRootElement(), sendSound) addEvent("sendSound", true)
-
Works perfectly now thank you very much
-
like that? function VehicleEnter( player, seat ) if ( seat == 0 ) then local nLevel = tonumber( getElementData( player, "level" ) ) or 0; local accountName = getAccountName ( getPlayerAccount ( player ) ) local gangName = exports.gangsystem:getAccountGang ( accountName ) if not (gangName == "Army") then if ( nLevel < 7 ) then cancelEvent(); outputChatBox( "This vehicle is locked to the Army lvl 7!", player, 255, 0, 0, false ); end end end end
-
yes i tried to block acces to all gangs except Army but everyone can enter =(
-
works perfect man last question and I'll stop asking, why can everyone enter if I add this if not (getElementData(player, "gang") == "Army") then under if ( nLevel < 7 ) then , all gang can enter, but not ppl lower level 7
-
Thank you very much Anderl, everything works great now thank you how can I set the vehicle color if it's a table? im confused a bit
-
badargument @ addEventHandler [expected function at argument 3, got nil] and all levels can enter
-
there is no way to make 2 hydras locked to level? Also the above code didn't really work because i cant set vehicle color then =(
-
ye thank you worked but how should I do if I want 2 hydras? exemple hydra1 and hydra2?
