Jump to content

ikzelf

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by ikzelf

  1. I use this website. Its very usefull and got all the stuff. http://www.w3schools.com/sql/default.asp
  2. local screenx,screeny = guiGetScreenSize() -- animation local state = 'starting' local phase = 0 local alpha = 0 local lastTick = getTickCount() local function getProgress( addtick ) local now = getTickCount() local elapsedTime = now - lastTick local duration = lastTick+addtick - lastTick local progress = elapsedTime / duration return progress end function draw() local RectangleX,RectangleY = interpolateBetween(screenx/2-250, 0-screeny, 0, screenx/2-250, 0, 0, getProgress(10000), 'Linear') dxDrawRectangle(RectangleX, RectangleY, 500, screeny, tocolor(27, 122, 224, 255)) showCursor(false) end addEventHandler("onClientRender", root, draw)
  3. You can change your default MTA windows in Settings>Interface>General>Skin you can download diffrent MTA skins here https://forum.multitheftauto.com/viewforum.php?f=139
  4. Could you make it abel to put way point so you can circle around a object or making a corner whit the cam? anyways i love it
  5. Going to try that Thank's for the quick respond edit: Works fine thanks
  6. the Problem isn't that it doesnt fire, it does fire but it doesn't get the Right X, Y, Z position Infront of the Heli
  7. ye i will post the whole script didnt though it was needed client: addEvent("setFiring", true) addEventHandler("setFiring", getRootElement(), function (ped, veh) if ped then setTimer( function () local x, y, z = getElementPosition(veh) local rx, ry, rz = getElementRotation(veh) local x = x+100*math.cos(math.rad(rz+90)) local y = y+100*math.sin(math.rad(rz+90)) setPedAimTarget ( ped, x, y, z ) end , 50, 0) setPedControlState ( ped, "fire", true ) end end ) server: rain = createVehicle(563, 0, 0, 3, 0, 0, 45) ped1 = createPed(28, 0, 0, 10) attachElements(ped1, rain, 0, 5, 0) setTimer( function () if ped1 then giveWeapon ( ped1, 38, 5009, true) end end , 1000, 1) setTimer( function () if ped1 then local rx, ry, rz = getElementRotation(rain) setElementRotation(ped1, rx, ry, rz) end end , 50, 0) function setFire(play) triggerClientEvent("setFiring", play, ped1, getPedOccupiedVehicle(play)) end addCommandHandler("fire", setFire)
  8. Hey, i tryed to get the Right Position 100 Meters Infront of mine Helicopter, but it doesnt get the right position wenn mine Heli is at 45 degrees i tryed this but it only get the right X, Y and not the Z setTimer( function () local x, y, z = getElementPosition(veh) local rx, ry, rz = getElementRotation(veh) local x = x+100*math.cos(math.rad(rz+90)) local y = y+100*math.sin(math.rad(rz+90)) setPedAimTarget ( ped, x, y, z ) end , 50, 0) anyone got a trick for it? -ikzelf
  9. ikzelf

    vehicleColor

    hm, i tryed it but there are now 2 cars at the same spot spawned, one on top of the other.
  10. ikzelf

    vehicleColor

    i tryed this code now it works only i got one debug and dont know how to fix it cars = { } allcars = {} allcars = allcars + 1 addEventHandler("onResourceStart",resourceRoot,function() local root = xmlLoadFile ("vehicles.map") local hroot = xmlFindChild (root,"cars",0) if (hroot) then for i, v in ipairs (xmlNodeGetChildren(hroot)) do local model = xmlNodeGetAttribute(v,"model") local ID = xmlNodeGetAttribute(v,"ID") local x = xmlNodeGetAttribute(v,"posX") local y = xmlNodeGetAttribute(v,"posY") local z = xmlNodeGetAttribute(v,"posZ") local rotZ = tonumber(xmlNodeGetAttribute(v,"rotation")) local color1 = xmlNodeGetAttribute(v,"color1") local color2 = xmlNodeGetAttribute(v,"color2") cars[i] = createVehicle(model,x,y,z,0,0,rotZ) setElementData (cars[i],"vehID",ID) setElementData (cars[i],"posX",x) setElementData (cars[i],"posY",y) setElementData (cars[i],"posZ",z) setElementData (cars[i],"rotation", rotZ) setElementData (cars[i], "color1", color1) setElementData (cars[i], "color2", color2) setVehicleColor(cars[i], tonumber(color1), tonumber(color2), 0, 0 ) local owner = xmlNodeGetAttribute(v,"owner") local team = xmlNodeGetAttribute(v,"team") local locked = xmlNodeGetAttribute(v,"Locked") if owner then setElementData(cars[i], "owner", owner) end if team then setElementData(cars[i], "team", team) end if locked then setElementData(cars[i], "Locked", locked) end toggleVehicleRespawn(cars[i],true) setVehicleIdleRespawnDelay(cars[i],120000) allcars = allcars+1 end end end) debug: lua:4: attempt to perform arithmetic on global 'allcars' (a table value)
  11. ikzelf

    vehicleColor

    @jaysds1 it still doesn't work, it just put a random color code on it
  12. ikzelf

    vehicleColor

    hi, i got a weird bug it doesnt set the right vehiclecolor code. i can't find the problem, anyone got a solution? the Code: function spawnVehs() for i, v in ipairs (getElementsByType("veh")) do local model = getElementData(v,"model") local ID = getElementData(v,"ID") local x = getElementData(v,"posX") local y = getElementData(v,"posY") local z = getElementData(v,"posZ") local rotZ = tonumber(getElementData(v,"rotation")) local color1 = getElementData(v,"color1") local color2 = getElementData(v,"color2") cars[i] = createVehicle(model,x,y,z,0,0,rotZ) setElementData (cars[i],"vehID",ID) setElementData (cars[i],"posX",x) setElementData (cars[i],"posY",y) setElementData (cars[i],"posZ",z) setElementData (cars[i],"rotation", rotZ) setElementData (cars[i], "color1", color1) setElementData (cars[i], "color2", color2) setVehicleColor(cars[i], tonumber(color1), tonumber(color2), 0, 0 ) local owner = getElementData(v,"owner") local team = getElementData(v,"team") local locked = getElementData(v,"Locked") if owner then setElementData(cars[i], "owner", owner) end if team then setElementData(cars[i], "team", team) end if locked then setElementData(cars[i], "Locked", locked) end toggleVehicleRespawn(v,true) setVehicleIdleRespawnDelay(v,120000) end end addEventHandler("onResourceStart",getResourceRootElement(),spawnVehs) and this is mine .map file: "15.173828125" color1="10" rotation="315.22521972656" posX="-1282.1806640625" ID="8780786" posZ="13.82702255249" model="429" color2="10"> "19.14453125" color1="6" rotation="313.68713378906" model="438" posX="-1285.8427734375" ID="3391522" posZ="14.153354644775" color2="76">
×
×
  • Create New...