Jump to content

undefined

Members
  • Posts

    500
  • Joined

  • Last visited

Everything posted by undefined

  1. No, it's not work. Because you're get the only image size. It's need the clicked position. Help
  2. addEventHandler("onClientGUIClick", guiRoot, function(button, state, absoluteX, absoluteY) if source == mapImage then local imgX, imgY = guiGetSize(mapImage, false) local relX = absoluteX/imgX local relY = absoluteY/imgY local x = relX*6000 - 3000 local y = 3000 - relY*6000 local hit, hitX, hitY, hitZ hit, hitX, hitY, hitZ = processLineOfSight(x, y, 3000, x, y, -3000) guiSetText(mapXedit, x) guiSetText(mapYedit, y) guiSetText(mapZedit, hitZ or 0) end end) It's my code. I did got a sample from Freeroam. But it's not work true. How to make it? Help
  3. undefined

    Seat!

    Thank you xXMADEXx. It's solved..!
  4. undefined

    Seat!

    Hi guys. Im working on the my fuel system. But i have a problem. If the seat is 0, it still does not make the code. if seat == 0 then text = myFuelText[1] addEventHandler("onClientRender", root, pressBDx) bindKey("b", "down", triggerRefillFuel) end myFuelText = { [1] = "Press B to begin filled fuel", [2] = "Press B to stop filled fuel", [3] = "Tank was filled. Proceed!" } local marker = createMarker(692, 2569, 29, "cylinder", 3.0, 150, 150, 0, 150) addEventHandler( "onClientMarkerHit", marker, markerHit) function markerHit( hitElement, matchingDimension, seat ) local vehicle = getPedOccupiedVehicle(localPlayer) if hitElement == localPlayer then if vehicle then if seat == 0 then text = myFuelText[1] addEventHandler("onClientRender", root, pressBDx) bindKey("b", "down", triggerRefillFuel) end else text = myFuelText[1] addEventHandler("onClientRender", root, pressBDx) bindKey("b", "down", triggerRefillFuel) end end end It's not give warning or error. Thx
  5. undefined

    /me command

    e.g addEventHandler("onPlayerChat", getRootElement(), function(msg, msgType) if msgType == 1 then cancelEvent() outputChatBox(getPlayerName(source)..": "..msg) end end)
  6. Hi guys. When the i use setElementCollisionsEnabled function's with vehicle, the vehicle is fly. How to fix it? thx
  7. undefined

    health images

    if heal == 88 or heal == 89 or heal == 90 or heal == 91 or heal == 92 or heal == 93 or heal == 94 or heal == 95 or heal == 96 or heal == 97 or heal == 98 or heal == 99 or heal == 100 then Replace this code and try this. OR: if heal >= 88 and 100 <= heal then dxDrawImage( (600.0/800)*sWidth, (175.0/600)*sHeight, (104.0/800)*sWidth, (54.0/600)*sHeight,"hud/images/0.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) end
  8. Example: local sx, sy = guiGetScreenSize() dxDrawText((1150/1366)*sy,(510/768)*sy.......)
  9. I'll make party system. And I thought I should use it. Are you agree to me? So should I use this code? And; What should I use for it? Edit: I won't lua.org because my english is not too good. I don't understand this site.
  10. undefined

    table.sort

    Hey all. I have a question. What's the table.sort? (Pls not give the lua.org site) Thnx...
  11. Try this. addEventHandler('onPlayerLogin',resourceRoot, function (_,account) local playerAccount = getPlayerAccount( source ) local isAccount = ( playerAccount and not isGuestAccount( playerAccount ) ) and true or false if ( isAccount ) then local SuperNick = getAccountData ( account, 'supernick' ) if ( SuperNick ) then setPlayerName ( player, SuperNick ) outputChatBox(supercolor.."[supernick]: #FFFFFFYour "..supercolor.."supernick #FFFFFFhas been set to "..supercolor..SuperNick, player, 255, 255, 255, true ) end end end)
  12. I already test it but it's removed the upgrade for 1 times. And MTA:Editor is set vehicle data color-upgrades-plate-paintjob-model. I use the this code for setVehicleColor: local color = getElementData(source, "color") setVehicleColor(source, color) -- Line 448 It's give this warning and isn't set color. WARNING: Jack\task_s.lua:448: Bad usage @ 'setVehicleColor' [Incorrect number of color arguments] When the i add this code: outputChatBox(color) -- It is say 0,0,0,245,245,245,0,0,0,0,0,0. So four color number. Where is the my mistake?
  13. Up! addEventHandler ( "onResourceStart", resourceRoot, function () for _,veh in ipairs ( getElementsByType ( "vehicle" ) ) do if not ( getElementData ( veh, "doNotRespawn" ) ) then toggleVehicleRespawn ( veh, true ) setVehicleRespawnDelay ( veh, 10000 ) setVehicleIdleRespawnDelay ( veh, 60000 ) local r1, g1, b1, r2, g2, b2, r3, g3, b3, r4, g4, b4 = getVehicleColor ( veh ) setVehicleColor ( veh, r1, g1, b1, r2, g2, b2, r3, g3, b3, r4, g4, b4 ) setVehiclePlateText ( veh, "Saruhan" ) setElementData ( veh, "vehPaintJob", getVehiclePaintjob ( veh ) ) setElementData ( veh, "colorR1", r1 ) setElementData ( veh, "colorR2", r2 ) setElementData ( veh, "colorR3", r3 ) setElementData ( veh, "colorR4", r4 ) setElementData ( veh, "colorG1", g1 ) setElementData ( veh, "colorG2", g2 ) setElementData ( veh, "colorG3", g3 ) setElementData ( veh, "colorG4", g4 ) setElementData ( veh, "colorB1", b1 ) setElementData ( veh, "colorB2", b2 ) setElementData ( veh, "colorB3", b3 ) setElementData ( veh, "colorB4", b4 ) for k=1000,1193 do if removeVehicleUpgrade(veh, k) then setElementData(veh, "upgrade"..k, true) addVehicleUpgrade(veh, k) end end end end end) function onExpRes() if not ( getElementData ( source, "doNotRespawn" ) ) then local vehPaintJob = getElementData ( source, "vehPaintJob" ) local r1 = getElementData ( source, "colorR1" ) local r2 = getElementData ( source, "colorR2" ) local r3 = getElementData ( source, "colorR3" ) local r4 = getElementData ( source, "colorR4" ) local g1 = getElementData ( source, "colorG1" ) local g2 = getElementData ( source, "colorG2" ) local g3 = getElementData ( source, "colorG3" ) local g4 = getElementData ( source, "colorG4" ) local b1 = getElementData ( source, "colorB1" ) local b2 = getElementData ( source, "colorB2" ) local b3 = getElementData ( source, "colorB3" ) local b4 = getElementData ( source, "colorB4" ) setVehiclePaintjob ( source, vehPaintJob ) setVehicleColor ( source, r1, g1, b1, r2, g2, b2, r3, g3, b3, r4, g4, b4 ) setVehicleEngineState ( source, false ) setVehicleOverrideLights ( source, 1 ) setVehicleLocked ( source, false ) setVehiclePlateText ( source, "Saruhan" ) setVehicleDoorOpenRatio ( source, 0, 0, 0.5 ) setVehicleDoorOpenRatio ( source, 1, 0, 0.5 ) setVehicleDoorOpenRatio ( source, 2, 0, 0.5 ) setVehicleDoorOpenRatio ( source, 3, 0, 0.5 ) setVehicleDoorOpenRatio ( source, 4, 0, 0.5 ) setVehicleDoorOpenRatio ( source, 5, 0, 0.5 ) for k=1000,1193 do removeVehicleUpgrade ( source, k ) if getElementData(source, "upgrade"..k) then addVehicleUpgrade(source, k) end end end end addEventHandler ( "onVehicleRespawn", root, onExpRes ) 1-) It's not give error or warning. 2-) Line 62 is not work. 3-) Line 50 is not set vehicle lights color. 4-) Line 52 is not work. Where is the problem?
  14. This type is server. What is the this type on xml?
  15. Is it give error or warning on debugscript?
  16. Try it. Server-Side addEventHandler("onPlayerLogin", function(_,account) if isObjectInACLGroup ( "user." .. getAccountName(account), aclGetGroup ( "Admin" )) then bindKey ( "F2", "down", openClientGui ) end end) function openClientGui(thePlayer, key, keyState) triggerClientEvent(thePlayer, "accadmin", thePlayer) end Client-Side function openGui() if not isElement(window1) then shopInterface6() end guiSetVisible ( window1, not guiGetVisible(window1) ) showCursor(guiGetVisible(window1)) end addEvent("accadmin", true) addEventHandler("accadmin", getRootElement(), openGui)
  17. undefined

    Help XML

    Hi guys. Im working on the shader panel. But i have a problem on the save player options. When the player's xml changed, the code is not delete file and not again started the getOption function. It's not give error on warning on debug. Where is the problem??? local shaders = {"radialBlur","bloom","detailWater","contrast","detail","customTiles","carPaint","damageEffect","depthField","skinMods","vehicleMods","weaponMods","adjustWeapons"} function getOption() local node = xmlLoadFile("shader/settings.xml") if node then for k, v in ipairs(xmlNodeGetChildren(node)) do local name = xmlNodeGetAttribute(v, "name") local toggle = xmlNodeGetAttribute(v, "use") local value = xmlNodeGetAttribute(v, "value") local enable if not shaders[k] == name then fileDelete("shader/settings.xml") getOption() return end outputChatBox("Test") if toggle == "true" then enable = true elseif toggle == "false" then enable = false end end else local childs = {} local node = xmlCreateFile("shader/settings.xml", "settings") childs[1] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[1], "name", "radialBlur") xmlNodeSetAttribute(childs[1], "use", "true") childs[2] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[2], "name", "bloom") xmlNodeSetAttribute(childs[2], "use", "false") childs[3] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[3], "name", "detailWater") xmlNodeSetAttribute(childs[3], "use", "true") childs[4] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[4], "name", "contrast") xmlNodeSetAttribute(childs[4], "use", "false") childs[5] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[5], "name", "detail") xmlNodeSetAttribute(childs[5], "use", "false") childs[6] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[6], "name", "customTiles") xmlNodeSetAttribute(childs[6], "use", "true") childs[7] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[7], "name", "carPaint") xmlNodeSetAttribute(childs[7], "use", "true") childs[8] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[8], "name", "damageEffect") xmlNodeSetAttribute(childs[8], "use", "true") childs[9] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[9], "name", "depthField") xmlNodeSetAttribute(childs[9], "use", "true") childs[10] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[10], "name", "skinMods") xmlNodeSetAttribute(childs[10], "use", "true") childs[11] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[11], "name", "vehicleMods") xmlNodeSetAttribute(childs[11], "use", "true") childs[12] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[12], "name", "weaponMods") xmlNodeSetAttribute(childs[12], "use", "true") childs[13] = xmlCreateChild(node, "shader") xmlNodeSetAttribute(childs[13], "name", "adjustWeapons") xmlNodeSetAttribute(childs[13], "use", "true") xmlNodeSetAttribute(childs[13], "value", "100") xmlSaveFile(node) xmlUnloadFile(node) end end addEventHandler("onClientResourceStart", resourceRoot, getOption) Thnx
  18. How to make wordwrap on the checkbox element? Please give me wiki link. Thnx
×
×
  • Create New...