-
Posts
1,255 -
Joined
-
Last visited
Everything posted by .:HyPeX:.
-
Debug & check if it actually executes, and what are you executing...
-
what do you mean with blinking cursor? the one that appears when you're edditing? you could make it blink with a timer changing the alpha and placing it by dxGetTextWidth. Greetz
-
i was actually planning to do one myself aswell... https://wiki.multitheftauto.com/wiki/OnClientKey https://wiki.multitheftauto.com/wiki/OnClientKey https://wiki.multitheftauto.com/wiki/OnClientMouseEnter https://wiki.multitheftauto.com/wiki/OnClientMouseLeave https://wiki.multitheftauto.com/wiki/OnClientMouseMove https://wiki.multitheftauto.com/wiki/OnClientClick https://wiki.multitheftauto.com/wiki/On ... oubleClick
-
Yeah true, i just copied down the code abdove me.
-
Thats not gonna work, lol. You're cancelling every team! disabled = {'Team1', 'Team2'} addEventHandler("onPlayerChat", root, function (_, type) if (type == 2) then for k,v in pairs(disabled) do local team = getTeamFromName(v) if ( team) and (team==getPlayerTeam(source) ) then return cancelEvent() end end end end )
-
Oh yeah, didnt saw it was scoreboard.. Try this: call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Tempo jogado", getRootElement(), 8, 0.16) local t = { } local cv = {} function checkValues( source,arg1,arg2,arg3) if (not source) or (not isElement(source)) then return end if getElementType(source) ~= "player" then return end local arg1,arg2,arg3 = arg1 or 0, arg2 or 0, arg3 or 0 if (arg1 >= 59) then arg2 = arg2+1 arg1 = 0 end if (arg2 >= 59) then arg3 = arg3+1 arg2 = 0 end return arg1, arg2,arg3 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end local sec = t[v].sec or 0 sec = sec + 1 local min = t[v].min or 0 local hour = t[v].hour or 0 local sec,min,hour = checkValues ( v, sec, min, hour ) setElementData( v, "Tempo jogado", "h: "..string.format("%02d",tostring( hour ))..' m: '..string.format("%02d",tostring( min ))..' s: '..string.format("%02d",tostring( sec )) ) end end, 1000, 0 ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'Tempo jogado' ) setAccountData ( playeraccount, "Tempo jogado", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "Tempo jogado" ) if ( time ) then setElementData ( source, "Tempo jogado", time ) else setElementData ( source, "Tempo jogado",0 ) setAccountData ( playeraccount, "Tempo jogado",0 ) end end end function onPlayerLogOut ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'Tempo jogado' ) setAccountData ( playeraccount, "Tempo jogado", tostring(sValue) ) end t[ source ] = nil end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) addEventHandler( 'onPlayerLogout',root, onPlayerLogOut )
-
Little speed up: function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "Tempo jogado" ) or 0 setElementData ( source, "Tempo jogado",time ) setAccountData ( playeraccount, "Tempo jogado",time ) end end Now... coming to the issue. setElementData( v, "Tempo jogado", "h: "..string.format("%02d",tostring( hour ))..' m: '..string.format("%02d",tostring( min ))..' s: '..string.format("%02d",tostring( sec )) ) Just use a second-counter, and then do the formatting client-side, to make it easier and avoid mistakes.
-
As long as you have a small player base, you shouldnt have any issues with the basic one, then you can see about upgrading as it grows.
-
You're being very inconclusive, wich machine? wich settings? where? how? what?
-
yup, ended doing so..
-
If you're doint a 3D thingy, why dont do it DX already? gui is only a quick lazy solution..
-
Well, this isnt working, why? addEventHandler("onClientClick", root, function(btn, ste) if btn ~= "left" then return end if ste ~= "down" then return end if teamJoiner then local cx,cy = getCursorPosition() if cx > 0.3 and cx < 0.4 then if cy > 0.4 and cy < 0.475 then executeCommandHandler("JoinTeam", "a") outputChatBox("Joined Team A") end elseif cx > 0.425 and cx < 0.525 then if cy > 0.4 and cy < 0.475 then executeCommandHandler("JoinTeam", "s") end elseif cx > 0.55 and cx < 0.65 then if cy > 0.4 and cy < 0.475 then executeCommandHandler("JoinTeam", "b") end end end end) if i do "/JoinTeam a" it works just fine, and the outputChatBox happens...
-
Hello guys i've done this way to check something, wich was handy, but i'm not sure how to avoid the debug error (It still works perfectly thought) addCommandHandler("turnOffMapInfo", function() local event = addEventHandler("onClientRender",root, MapInfo) if event ~= true then removeEventHandler("onClientRender", root, MapInfo) end end) bindKey("F3", "down", "turnOffMapInfo")
-
Working awesome & like a charm! Thank you!!
-
Great! thanks! Now i've got an issue, when the text is too long i decided to loop it, but there's a problem, whenever the table is over i'm not sure what to do... (It gives errors) if ClanWar.General.MapRotationInfo[nC + 1] then smt = string.split(ClanWar.General.MapRotationInfo[nC + 1][1]) local i = interpolateBetween(0,0,0,#smt,0,0,progress, "Linear") local i = math.floor(i) dxDrawText("1."..smt[1+i]..smt[2+i]..smt[3+i]..smt[4+i]..smt[5+i]..smt[6+i]..smt[7+i]..smt[8+i]..smt[9+i]..smt[10+i], x*0.025, y*0.5, x*0.2, y*0.525, tocolor(255,255,255,255), 0.5, "bankgothic", "left", "center") else dxDrawText("1. No Map Selected", x*0.025, y*0.5, x*0.2, y*0.525, tocolor(255,255,255,255), 0.5, "bankgothic", "left", "center") end
-
Well found out.. the values of string.find were mixed up Anyways, i'm not sure, how do i make the way to find more parts of a name than a single word? Greetz
-
No matches, no debug errors. Tried outputing whats going on... addCommandHandler("as", function(player,cmd,mapstring) for i,v in ipairs(exports.mapmanager:getMapsCompatibleWithGamemode(getResourceFromName( "race" ))) do local name = getResourceInfo(v,"name") if name then outputChatBox(name:lower()) outputChatBox(mapstring:lower()) if string.find(mapstring:lower(), name:lower(),1,true) then outputChatBox(name) end end end end) [dm] coon vol4 - peaceful finale forest [dm]finn v.4 - hogwarts forest [dm] hehu & coon - speed chronicles forest [dm] nice v.7 - industrial skill's™ forest [dm] nitron ft. fakedeath - phenomenal forest [dm] packy 卐 vol.12 卐 .conspiration. 卐 forest [dm] quantum ft. fakedeath ft. micra ft. zenos - sheer cold forest [dm] ragex v3 - the blue dusk forest [dm]rafinha ft lemon ft naval - we just wanna run forest [dm] [b]oost ft. vantage - forest situation ii forest
-
Well, i'm not totally sure whats going on here... addCommandHandler("as", function(player,cmd,mapstring) for i,v in ipairs(exports.mapmanager:getMapsCompatibleWithGamemode(getResourceFromName( "race" ))) do local name = getResourceInfo(v,"name") if name then if string.find(mapstring:lower(), name:lower()) then outputChatBox(name) end end end end) This is the outputchatbox of "name" loop. [DM] CooN Vol4 - Peaceful Finale [DM]FiNN v.4 - Hogwarts [DM] HeHu & CooN - Speed Chronicles [DM] Nice v.7 - Industrial Skill's™ [DM] NitroN ft. FakeDeath - Phenomenal [DM] Packy 卐 vol.12 卐 .Conspiration. 卐 [DM] Quantum ft. FakeDeath ft. Micra ft. ZenoS - Sheer Cold [DM] RaGeX v3 - The Blue Dusk [DM]Rafinha ft Lemon ft Naval - We Just Wanna Run [DM] [b]oost ft. VantaGe - Forest Situation II However,/as forest wont return the last map, Forest Situation II. PD: (I actually have 10 maps)
-
setTimer(function() for i,v in ipairs(getElementsByType("ped")) do if not getPlayerName(v) then if isElementInWater(v) then destroyElement(v) end end end end, 1000,0) Maybe..?
-
Just forget it, it was more of a kind of informative topic, already deleted it
-
No Lol. I tried to modify the default race, it stopped working. So i downloaded the original one from the community and it simply didnt worked. (Deleting modified one)
-
Hello guys, i tried to edit the default race, fucked it up and re-downloaded the official one (community.multitheftauto.com), but it simply did not worked. Could this be becouse i was using [DM] maps only? (Base race mode was being loaded) i dont really know, but the default race simply failed to load... i had to place in a modified one to work..
-
Oh well i had it by a friend already, but thanks!
-
Hey guys, how can i DIR into a resource's folder? Like, i'm custom loading scripts, but i'd need to get the filepath to actually read it, how to do so? (Argumenting you have the resource element)
-
I've found out race gamemode uses textlib so i'll stick to it. Basically dxText:font changes all the fonts?
