Jump to content

dugasz1

Members
  • Posts

    285
  • Joined

  • Last visited

Everything posted by dugasz1

  1. First the getPlayersInsideGroup function will always return with one element: function getPlayersInsideGroup (group) local gangMembers = {} for i, thePlayer in ipairs(getElementsByType("player")) do local playerGang = getElementData(thePlayer,"Group") if ( playerGang == group ) then table.insert(gangMembers, thePlayer) end end return gangMembers end On the second i think cancelEvent() works like return so when the playerSentGroupMsg will be called it will return immediately. function playerSentGroupMsg (message, messageType) if ( messageType == 2 ) then if ( getElementData(source,"Group") ) then local grupinhdd = getElementData(source,"Group") local jogadores = getPlayersInsideGroup(grupinhdd)--You get an array of player for k,v in pairs(jogadores) do --You have to send them one by one outputChatBox("[Group]"..getPlayerName(source)..": "..message,v,0,255,0) end end end cancelEvent() end addEventHandler("onPlayerChat", getRootElement(), playerSentGroupMsg)
  2. @fastman92 Please if it possible don't forget about ID limit too. There are a lot of server which would be happy if this limit would be increased. (At least here in Hungary, lot of RolePlay would use that feature.)
  3. local lastDelayTime = false local lastOptional = false addEvent("showDelay", true) addEventHandler("showDelay", g_Root, function(delayTime, optional) lastDelayTime = delayTime --"Save" it lastOptional = optional if tonumber(optional) then local cps = getElementData(g_Me, "race.checkpoint") - optional if cps < 2 then cps = "" else --Etc.... addEventHandler("onClientRender", root, drawText) end) function drawText ( ) --draw what you want dxDrawText ( text, 44, 43 ) end You can do it like that. (Sorry for late respone)
  4. I can calculate real life unit (cm,inch etc.) from PPI Let's say i have a 40px height font: If i have 10PPI display it means i have a 40/10*2,54 cm height which is ~= 10,16 cm height font. If i have 20PPI display it means i have 40/20*2,54 cm height which is ~= 5,08 cm height font. So, they won't see the same thing because on the lower PPI the font will be twice as high as on 20PPI. (Sorry if i can explain what i'm talking about and what i want to achive but not my native languge)
  5. I want relativly sizing it for the monitor's resolution and diameter (or somehow in a real life unit) As far as i know PPI stands for Pixel Per Inch. And with real life unit (cm,inch etc) i can make sure that people will see that writing. Pixels aren't good because it depends on the PPI how big (in cm,inch) will be the font. (For example i want my fonts around 1cm height) Or any tip would be great how can i solve this. I tried scalling it (use my monitor as a base) local screenX, screenY = guiGetScreenSize() local scallingFactor = (screenX*screenY)/(1920*1080) But it looks shi*ty. If it looks good on FullHD then it's unreadable on 1377x768. If it ok on 1377x768 then it's too big on FullHD.
  6. I know these function but i don't know why do you linked them. What should i do with them.
  7. Hello guys. So, I'm working on a HUD and i want it to look good for every size of monitor. The size of the recentagles and the images is just easly declared relativly to the screen width or height (It's ok it's looks good on FullHD and 1377x768) My biggest problem is the fonts. I want it to be easily readable for everyone but to achieve that i should now the ppi or somethink like that. Is there any way to get it (ppi or diameter)? Any suggestion how should i do this if i can get those data?
  8. https://wiki.multitheftauto.com/wiki/CreateBrowser Set the 4.th argument to true and it will disapear. And the CSS hover should work. (In my case it worked)
  9. This have no sense. The showDelay should add the onClienRender event handler. (I guess you want to do that) Now it have to create a lot of error (or just don't work). Because if the onClientRender call the function the delayTime, optional variables will be nill. So in 17 it will fail because nill<0 have no sense. (Or maybe nill<0 result will be false but i think it will be an error) addEvent("showDelay", true) addEventHandler("showDelay", g_Root, function(delayTime, optional) if tonumber(optional) then local cps = getElementData(g_Me, "race.checkpoint") - optional if cps < 2 then cps = "" else --Etc.... addEventHandler("onClientRender", root, drawText) end) function drawText ( ) --draw what you want dxDrawText ( text, 44, 43 ) end Then remove it when needed.
  10. I don't really know OOP in Lua but if showDelay called only once it doesn't good. function drawText ( ) --draw what you want dxDrawText ( text, 44, 43 ) end --Call this if you want it to be visible: addEventHandler ( "onClientRender", root, drawText ) --Call this if you want it to disapear removeEventHandler ( "onClientRender", root, drawText )
  11. Show us how did you do it or when do you want to draw it?
  12. You can encrypt your script: https://luac.multitheftauto.com/ with 2 - More (From 1.5.2-9.07903) option checked in. With this they can still just copy the client side scripts(If it cahced) but they can't modify it. So you can for example trigger for the server for a key and if there is no answer or wrong key it stops it self. (As i researched in this topic it still can be stolen with this method but it's hard, request a lot of knowledge)
  13. When dxDrawText called then it just draw to the current frame. So you have to call it on every frame whit onClientRender. (Or onClientPreRender it depends on what do you want to do: Game Processing Order)
  14. It looks like it doesn't support change a column type. So you have to remove it and add again. (If there is data in it you can save it then remove then create it agian) You can use this to make it simple: http://sqlitebrowser.org/ (Or something similar. I didn't used it but i guess it can import and export data.)
  15. I don't really know what do you want to do. Can you please explean it? Do you want to know how to create a table in sqlLite? Or how to change the column's type?
  16. Thank you i will check it. But i would prefer the built in XML functions so can you please link me the working code?
  17. dugasz1

    Font Awesome

    If you want to use local files in CEF you have to add the file to your meta and you have relink your css files like: <link rel="stylesheet" href="http://mta/resourceName/fontAwesome.css"> (Ps.: You can't access files remotly or localy at the same time)
  18. Köszönöm. (Honnan tudtad, hogy magyar vagyok?) Ó én már kerestem hogy lehet karaktereket kódolni Thank you. (How do you know that i'm Hungarian?) Ohh, I tried to convert int to character somehow
  19. When i call first the function i know that the rootNode is nill. But after i call second time the function it is a userdata (I don't know why because i unload it ) It was just for debuging Edit: I give them admin rights but still nothing. (It edit it own file yet but i used this kind of path beacause it will be exported. So i guess this is why it don't show error)
  20. Hello! I would like to use font symbols like Font Awesome. But my problem is how can i tell to the dxDrawText function to draw the youtube icon for example? The font awesome's website says the character code is &#xf167 for it. But in this format the html can use it. But how can i create a string which contains the f167 (hex) character code? Is it even possible?
  21. I didn't yet but i tried it now. Nothing changed. (I guess it don't needs rights because it works sometimes and the wiki don't say it needs it.)
  22. There are no errors. As i mentioned it can't load it but if i edit the content of the test1.xml it load it once, after again can't load it.
×
×
  • Create New...