• Announcements

    • jhxp

      Forums are online again after a maintenance.   18/03/17

      MTA Forums maintenance is completed, although some automatic time-heavy tasks are still in process and will be finished eventually in background. Expect some features such as Forum Search to not display all results until all processes are finished. Please let us know if you spot a forum feature that worked correctly before the maintenance but does not work anymore now. Thanks. --MTA Team

Daniels69

Members
  • Content count

    18
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Daniels69

  • Rank
    Square

Details

  • Gang
    FX
  • Location
    Latvia
  1. local modelNames = { [402] = "Nissan 240SX", [529] = "529", [420] = "420", [550] = "550", [546] = "546", [540] = "540", [580] = "580", [527] = "Honda Civic Si", [587] = "Nissan Silvia S14", [436] = "Nissan Silvia S15", [426] = "BMW E39", --[526] = "BMW E34", [401] = "Nissan Skyline R34", [559] = "Toyota Supra", [562] = "BMW E36 M3", [477] = "Mazda RX7", [480] = "Porsche 911", [533] = "Honda S2000", [517] = "Toyota Celica", [405] = "Toyota Chaser Tourer V", [560] = "Subaru Impreza", [526] = "Audi S1 Quattro", [600] = "Audi S4" } function getVehicleNameFromModel(model) if not model then return false end if not modelNames[model] then return "Nav zināms:" .. model end return modelNames[model] end function getAllVehiclesModels() local models = {} for k,_ in pairs(modelNames) do table.insert(models, tonumber(k)) end return models end this one is for the names and this one is for drawing: addEventHandler("onClientRender", root, function() if not drawingName then return end offsetY = offsetY + (offsetTargetY - offsetY) * 0.15 local y = screenHeight - height + offsetY local h = screenHeight + offsetY local vehicle = getPedOccupiedVehicle ( localPlayer ) local vehids = getElementData(getPedOccupiedVehicle ( localPlayer ),"handlingType") dxDrawText(""..drawingName, 3, y + 3, screenWidth + 3, h + 3, tocolor(0, 0, 0, 170), 3, "default-bold", "center", "center",false,false,false,true) dxDrawText(""..drawingName, 0, y, screenWidth, h, tocolor(255, 255, 255), 3, "default-bold", "center", "center",false,false,false,true) if drawingOwner then local ownerOffset = dxGetFontHeight(3, "default-bold") y = y + ownerOffset h = h + ownerOffset dxDrawText(drawingOwner, 0, y, screenWidth, h, tocolor(48, 113, 138), 2, "default-bold", "center", "center", false, false, false, true) end end ) local function hide() drawingName = false end local function startHiding() offsetTargetY = height setTimer(hide, 1000, 1) end addEventHandler("onClientVehicleEnter", root, function(player) if player ~= localPlayer then return end drawingName = getVehicleNameFromModel(getElementModel(source)) local ownerName = getElementData(source, "tws-ownerName") if ownerName then drawingOwner = "" .. tostring(drawingName) else drawingOwner = false end offsetY = height offsetTargetY = 0 setTimer(startHiding, 4000, 1) end )
  2. Already most of the servers have your scripts.. useless to buy them now
  3. I'm wondering how do i check if the tent is empty (in dayz)? Have no idea.. maybe some one knows? the part what i've made for _,col in ipairs(getElementsByType("colshape")) do if getElementData(col, "tent") then local tent = getElementData(col, "parent"); if tent then local x,y,z = getElementPosition(tent); local rX,rY,rZ = getElementRotation(tent); i just want to check if the tent is empty, and then delete it.. can any one help me with this?
  4. Can we see some screens? Atleast of the character system
  5. local bases = { {2412.8,92,26.47,1830.7,-1930.1,2955.6001,"garaza","playerserial"}, {1835.7,-1930.1,2955.6001,2412.8,92,26.40,"garaza2","playerserial"}, } local x,y,z = bases[1][1],bases[1][2],bases[1][3] local marker = createMarker ( x,y,z, "cylinder", 2, 82, 203, 54, 18, getRootElement() )
  6. if use createMarker with x,y,z , it doesnt work. Tried add tonumber() before bases[1][1] and then even in createMarker function. Dunno where is the problem.
  7. i've tried it like this: local x,y,z = bases[1],bases[2],bases[3] local x1,y1,z1 = bases[4],bases[5],bases[6] password = bases[7] and it won't work
  8. local bases = { {2412.8,92,26.47,1830.7,-1930.1,2955.6001,"garaza","playerserial"}, {1835.7,-1930.1,2955.6001,2412.8,92,26.40,"garaza2","playerserial"}, } and i need to get data out of the table, basically i want to contain all data about bases in table. Adding them manually , like in e.x above. but the problem is i don't know how to get data out of the table. for e.x i need these. local x,y,z = 2412.8,92,26.47 -- get the coordinates of first 3 values in the table local x1,y1,z1 = 1830.7,-1930.1,2955.600-- the 4,5,6 index in table password = "garaza2" -- get base password local ownerserial = "playerserial" -- last one , get base owner serial any one can help me? i need to fill those local x,y,z e.t.c with data from table for each base.
  9. any one?
  10. i have seen this in many servers, you can do it some how , in the start i thought its some custom object which was put on the car, but then i saw the same on default gta sa cars too , so maybe some one knows how to do this?
  11. Hello dear mtasa community, i have found an issue , i can't really set vehicle wheel rotation with setVehicleComponentRotation, they just don't rotate, other components do.. Some one knows where is the problem? --wheel_rb_dummy addEventHandler("onClientVehicleEnter", getRootElement(), function() local theVeh = getPedOccupiedVehicle(localPlayer) if (theVeh) then local rx, ry, rz = getVehicleComponentRotation(theVeh, "wheel_rb_dummy") --get the rotation of the component setVehicleComponentRotation(theVeh, "wheel_rb_dummy", rx, ry+10, rz) end end )
  12. doesn't work. and there's no errors o.0
  13. i'm trying to make an script: when player scrolls down the mouse, the spoilers change. and it doesn't work , i don't really know where is the problem , and what did i do wrong. client: function checkifkeyup() if getKeyState( "lctrl" ) == true then triggerServerEvent("changespoiler",localPlayer,localPlayer) end end bindKey( "mouse_wheel_up", "down", checkifkeyup ) server: local spoilers = { 1000, 1001, 1002, 1003, 1014, 1015, 1016, } addEvent("changespoiler",true) function spoilerdown(thePlayer) local theVehicle = getPedOccupiedVehicle ( source ) if theVehicle == true then local theVehicle = getPedOccupiedVehicle ( source ) addVehicleUpgrade ( theVehicle, spoilers+1 ) else addVehicleUpgrade ( theVehicle, math.random(#spoilers)) end end addEventHandler("changespoiler",getRootElement(),spoilerdown) Thank you
  14. Hello , lately i was making something like an house system. and i stopped at this warning. which i can't really solve , or my lua experience is too small. it appears that the code below doesn't seem to get the housemark variable.. and that's why the warning comes , and the script doesn't really work any more , any ideas how to solve it? Thanks CODE: function addhouses(thePlayer,command,arg) local x,y,z = getElementPosition(thePlayer) local r,g,b = 255,255,0 housemark = createMarker ( x , y, z+1, "arrow", 1.5, r, g, b, 170 ) if (housemark) then outputDebugString("house created") setElementData(housemark,"mtasa-house",true) setElementData(housemark,"mtasa-housename",arg) -- if getElementData(house,"mtasa-housesold") == false end end addCommandHandler("addhouse",addhouses) function househit(player) if getElementType( player ) == 'player' and not getPedOccupiedVehicle( player ) then if not isGuestAccount( getPlayerAccount( player ) ) then --some stuff happens here else outputChatBox( 'You must be logged in', player, 255, 51, 36 ); end; end; end addEventHandler("onMarkerHit",housemark,househit) ERROR: WARNING: Bad argument @ 'addEventHandler' [Expected element at argument 2, got nil]
  15. Hey there. I have couple questions about setelementdata and getlementdata. Basically what i need is. How do i get the player with the biggest elementdata which was set by script? For e.x On player kill somebody it gives him score like, setElementData(player , murders+1) and how do i get the player with the biggest data? Any suggestions please.