Jump to content

aneco

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by aneco

  1. now i created this but when i type i cant hear any sound from vehicle how can i fix this. when i load this for server-side i get:attempt to cal global 'playsound' (a nil value) when i load this for client-side no error and no music. function playmusic ( source, commandName ) local x, y, z = getElementPosition ( source ) --Get the players position local sound = playSound3D("music.mp3") attachElements ( music, source, 0, 0, 5 ) --attach music. end addCommandHandler ( "play", playmusic )
  2. hello i created a playsound3d entity and now i want to attach it to special car but i cant find attachtocar command. here is code for playsound3d playSound3D("music.mp3", -2050.9133300781, 168.4600982666, 28.8359375, true)
  3. am i allowed to place damaged cars in mta map editor.or some opened doors? that would be cool
  4. aneco

    About Zday

    i know how to do this but i want a area become zombie proof.
  5. aneco

    About Zday

    hi im going to make a zombie map but i want special spawn area with out zombies how can i do that. by the way zombies dont have any spawnpoint they are spawning in whole map.
  6. aneco

    Open And Close

    Hi everyone i need a command that ables user to switch replace skin to original skin.like stopping the script.but when i stop script other players cant see it too so i need a script that only affects that player. sorry for my bad english. if you dont understand i can make screenshots.
  7. edit:i edited with the code it seems like have a error so im fixed it.im not sharing it here without permission.
  8. thanks for your answer. function rotate(source, key, keyState) if key =="mouse_wheel_up" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx,ry,rz - 5 ) end if key =="mouse_wheel_down" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx,ry,rz + 5) end bindKey(playerSource, "mouse_wheel_up", "down", rotate) bindKey(playerSource, "mouse_wheel_down", "down", rotate) i made function like this but i dont know where i need to put this into resource. sorry for my bad english.
  9. Hello everyone first of all my problem is when i spawn somethink from gmes https://community.multitheftauto.com/index.php?p= ... ls&id=3070 im not able to rotate it i searched wiki for rotate object function but i cant find it.is anyone help me about rotatin object.
  10. is it only me?i cant rotate any objects is this added or not?
  11. it doesnt work when i f2 it dopesnt do anythink i tried to run script clientside and serverside too but didnt worked
  12. where i should put this code to script.i make like this. local x, y, z, x1, y1, z1 local fpcam = false bindKey( "F2", "down", function() if fpcam then setCameraTarget(getLocalPlayer(), getLocalPlayer()) end fpcam = not fpcam end ) addEventHandler("onClientPreRender", root, function() if fpcam then x, y, z = getPedBonePosition(getLocalPlayer(), 6) setCameraMatrix(x, y, z, x + x1, y + y1, z + z1) dxDrawImage(screenWidth/2-10, screenHeight/2-10, 20, 20, "images/aimer.png") local tarX, tarY, tarZ = getWorldFromScreenPosition(screenWidth/2, screenHeight/2, 30) setPedAimTarget(getLocalPlayer(), tarX, tarY, tarZ) function getPointFromDistanceRotation(x,y,dist,angle) local a=math.rad(90-angle) local dx=math.cos(a)*dist local dy=math.sin(a)*dist return x+dx,y+dy if getControlState"left" or getControlState"right" then local _,_,Zrot=getElementRotation(getPedOccupiedVehicle(getLocalPlayer())) wx,wy=getPointFromDistanceRotation(cx,cy,((cx-wx)^2+(cy-wy)^2)^0.5,Zrot) end end end ) addEventHandler("onClientCursorMove", root, function( _, _, _, _, wx, wy, wz ) local cx, cy, cz = getCameraMatrix() x1 = ( wx - cx ) / 300 y1 = ( wy - cy ) / 300 z1 = ( wz - cz ) / 300 end )
  13. okey but do you help me about fix?
  14. hi i found a script which player press f2 and have first person camera but i have a problem when player steers a car the cam wont steer and player have to steer camera via mouse i couldnt make a fix for this and i need some help please help me i need this code soo much. Here is the code which i found local x, y, z, x1, y1, z1 local fpcam = false bindKey( "F2", "down", function() if fpcam then setCameraTarget(getLocalPlayer(), getLocalPlayer()) end fpcam = not fpcam end ) addEventHandler("onClientPreRender", root, function() if fpcam then x, y, z = getPedBonePosition(getLocalPlayer(), 6) setCameraMatrix(x, y, z, x + x1, y + y1, z + z1) dxDrawImage(screenWidth/2-10, screenHeight/2-10, 20, 20, "images/aimer.png") local tarX, tarY, tarZ = getWorldFromScreenPosition(screenWidth/2, screenHeight/2, 30) setPedAimTarget(getLocalPlayer(), tarX, tarY, tarZ) end end ) addEventHandler("onClientCursorMove", root, function( _, _, _, _, wx, wy, wz ) local cx, cy, cz = getCameraMatrix() x1 = ( wx - cx ) / 300 y1 = ( wy - cy ) / 300 z1 = ( wz - cz ) / 300 end )
  15. i found new script but when im driving and steer car cam wont steer. local x, y, z, x1, y1, z1 local fpcam = false bindKey( "F2", "down", function() if fpcam then setCameraTarget(getLocalPlayer(), getLocalPlayer()) end fpcam = not fpcam end ) addEventHandler("onClientPreRender", root, function() if fpcam then x, y, z = getPedBonePosition(getLocalPlayer(), 6) setCameraMatrix(x, y, z, x + x1, y + y1, z + z1) dxDrawImage(screenWidth/2-10, screenHeight/2-10, 20, 20, "images/aimer.png") local tarX, tarY, tarZ = getWorldFromScreenPosition(screenWidth/2, screenHeight/2, 30) setPedAimTarget(getLocalPlayer(), tarX, tarY, tarZ) end end ) addEventHandler("onClientCursorMove", root, function( _, _, _, _, wx, wy, wz ) local cx, cy, cz = getCameraMatrix() x1 = ( wx - cx ) / 300 y1 = ( wy - cy ) / 300 z1 = ( wz - cz ) / 300 end )
  16. hi i found a script on resources. visiblecock = 1 cockpit = 1 rollEnabler = 1 aircraftCompat = 0 ax = nil isBike = nil function cam() local theVehicle = getPedOccupiedVehicle(getLocalPlayer()) if theVehicle then if cockModel == getElementModel(theVehicle) then if rollEnabler then local ax, ay, az = getElementPosition(gnat) local bx, by, bz = getElementPosition(bee) local z = az-bz roll = -0.8*math.deg(math.asin(z)) end local x, y, z = getElementPosition(gnat) local cx, cy, cz = getElementPosition(fly) setCameraMatrix(x, y, z, cx, cy, cz, roll) cockVehicle = theVehicle cockModel = getElementModel(theVehicle) else camStop(theVehicle, 0) camStart(theVehicle, 0) end elseif charles then camStop(cockVehicle, 0) end end function camStart(theVehicle, seat) if (cockpit == 1) then if (seat == 0) then local x, y, z = getElementPosition(getLocalPlayer()) fly = createObject(3803, x, y, z) setElementAlpha(fly, 0) gnat = createObject(3803, x, y, z) setElementAlpha(gnat, 0) bee = createObject(3803, x, y, z) setElementAlpha(bee, 0) local vModel = getElementModel(theVehicle) if (vModel == 426 or vModel == 596 or vModel == 597 or vModel == 420) then -- Premier based cars ax, ay, az = -0.55, 1, 0.5 bx, by, bz = -0.55, -0.2, 0.55 elseif (vModel == 598) then -- LVPD ax, ay, az = -0.55, 1, 0.6 bx, by, bz = -0.55, -0.2, 0.65 elseif (vModel == 490) then -- FBI Rancher ax, ay, az = -0.55, 3, 0.7 bx, by, bz = -0.55, 0.2, 0.75 elseif (vModel == 427) then -- SWAT Truck ax, ay, az = -0.5, 3, 0.9 bx, by, bz = -0.5, 0.8, 0.95 elseif (vModel == 599 or vModel == 489 or vModel == 505) then -- Rancher based cars ax, ay, az = -0.55, 1, 0.7 bx, by, bz = -0.55, -0.4, 0.75 elseif (vModel == 602) then -- Alpha ax, ay, az = -0.55, 1, 0.3 bx, by, bz = -0.55, -0.4, 0.37 elseif (vModel == 496) then -- Blista Compact ax, ay, az = -0.48, 1, 0.4 bx, by, bz = -0.48, -0.5, 0.45 elseif (vModel == 401) then -- Bravura ax, ay, az = -0.55, 1, 0.4 bx, by, bz = -0.55, -0.3, 0.45 elseif (vModel == 518) then -- Buccaneer ax, ay, az = -0.6, 1, 0.35 bx, by, bz = -0.6, -0.2, 0.4 elseif (vModel == 527) then -- Cadrona ax, ay, az = -0.45, 1, 0.45 bx, by, bz = -0.45, -0.3, 0.5 elseif (vModel == 589) then -- Club ax, ay, az = -0.5, 1, 0.65 bx, by, bz = -0.5, -0.3, 0.7 elseif (vModel == 419) then -- Esperanto ax, ay, az = -0.5, 1, 0.3 bx, by, bz = -0.5, -0.4, 0.35 elseif (vModel == 533) then -- Feltzer ax, ay, az = -0.5, 1, 0.4 bx, by, bz = -0.5, -0.4, 0.45 elseif (vModel == 526) then -- Fortune ax, ay, az = -0.5, 1, 0.3 bx, by, bz = -0.5, -0.3, 0.35 elseif (vModel == 474) then -- Hermes ax, ay, az = -0.5, 1, 0.45 bx, by, bz = -0.5, -0.5, 0.48 elseif (vModel == 545) then -- Hustler ax, ay, az = -0.4, 1, 0.4 bx, by, bz = -0.4, -0.4, 0.45 elseif (vModel == 517) then -- Majestic ax, ay, az = -0.45, 1, 0.45 bx, by, bz = -0.45, -0.3, 0.5 elseif (vModel == 410) then -- Manana ax, ay, az = -0.45, 1, 0.45 bx, by, bz = -0.45, -0.3, 0.5 elseif (vModel == 600) then -- Picador ax, ay, az = -0.55, 1, 0.42 bx, by, bz = -0.55, -0.1, 0.47 elseif (vModel == 436) then -- Previon ax, ay, az = -0.45, 1, 0.47 bx, by, bz = -0.45, -0.35, 0.52 elseif (vModel == 580) then -- Stafford ax, ay, az = -0.55, 1, 0.65 bx, by, bz = -0.55, -0.2, 0.75 elseif (vModel == 439) then -- Stallion ax, ay, az = -0.5, 1, 0.35 bx, by, bz = -0.5, -0.7, 0.4 elseif (vModel == 549) then -- Tampa ax, ay, az = -0.45, 1, 0.4 bx, by, bz = -0.5, -0.2, 0.45 elseif (vModel == 491) then -- Virgo ax, ay, az = -0.45, 1, 0.3 bx, by, bz = -0.45, -0.5, 0.35 elseif (vModel == 445) then -- Admiral ax, ay, az = -0.5, 1, 0.5 bx, by, bz = -0.5, -0.3, 0.55 elseif (vModel == 507) then -- Elegant ax, ay, az = -0.55, 1, 0.45 bx, by, bz = -0.55, -0.3, 0.5 elseif (vModel == 585) then -- Emperor ax, ay, az = -0.5, 1, 0.6 bx, by, bz = -0.5, -0.3, 0.65 elseif (vModel == 587) then -- Euros ax, ay, az = -0.55, 1, 0.4 bx, by, bz = -0.55, -0.6, 0.45 elseif (vModel == 604 or vModel == 466) then -- Glendale ax, ay, az = -0.5, 1, 0.45 bx, by, bz = -0.5, -0.2, 0.5 elseif (vModel == 492) then -- Greenwood ax, ay, az = -0.5, 1, 0.5 bx, by, bz = -0.5, -0.3, 0.55 elseif (vModel == 546) then -- Intruder ax, ay, az = -0.6, 1, 0.45 bx, by, bz = -0.6, -0.5, 0.5 elseif (vModel == 551) then -- Merit ax, ay, az = -0.5, 1, 0.45 bx, by, bz = -0.5, -0.2, 0.5 elseif (vModel == 516) then -- Nebula ax, ay, az = -0.5, 1, 0.45 bx, by, bz = -0.5, -0.2, 0.5 elseif (vModel == 467) then -- Oceanic ax, ay, az = -0.5, 1, 0.45 bx, by, bz = -0.5, -0.2, 0.5 elseif (vModel == 547) then -- Primo ax, ay, az = -0.5, 1, 0.5 bx, by, bz = -0.5, -0.3, 0.55 elseif (vModel == 405) then -- Sentinel ax, ay, az = -0.4, 1, 0.35 bx, by, bz = -0.4, -0.3, 0.4 elseif (vModel == 409) then -- Stretch ax, ay, az = -0.5, 2, 0.4 bx, by, bz = -0.5, 0.7, 0.45 elseif (vModel == 550) then -- Sunrise ax, ay, az = -0.55, 1, 0.3 bx, by, bz = -0.55, -0.3, 0.4 elseif (vModel == 566) then -- Tahoma ax, ay, az = -0.55, 1, 0.35 bx, by, bz = -0.55, -0.25, 0.45 elseif (vModel == 540) then -- Vincent ax, ay, az = -0.55, 1, 0.35 bx, by, bz = -0.55, -0.45, 0.4 elseif (vModel == 421) then -- Washington ax, ay, az = -0.45, 1, 0.35 bx, by, bz = -0.45, -0.15, 0.4 elseif (vModel == 529) then -- Willard ax, ay, az = -0.55, 1, 0.5 bx, by, bz = -0.55, -0.4, 0.55 -- elseif (vModel == 592) then -- Andromeda has no cockpit -- ax, ay, az = 0, 20, 2 -- bx, by, bz = 0, 13, 4 elseif (vModel == 577) then -- AT 400 ax, ay, az = -0.5, 30, 4 bx, by, bz = -0.5, 24, 4.8 elseif (vModel == 511) then -- Beagle ax, ay, az = -0.4, 4, -0.5 bx, by, bz = -0.4, 1.7, 0 elseif (vModel == 548) then -- Cargobob ax, ay, az = -0.68, 9, -0.5 bx, by, bz = -0.68, 4.3, -0.1 elseif (vModel == 512) then -- Cropduster ax, ay, az = 0, 1, 0.5 bx, by, bz = 0, -0.35, 0.5 elseif (vModel == 593) then -- Dodo ax, ay, az = -0.32, 1, 0.65 bx, by, bz = -0.32, -0.2, 0.65 elseif (vModel == 425) then -- Hunter ax, ay, az = 0, 5, 0.7 bx, by, bz = 0, 2.3, 0.7 elseif (vModel == 520) then -- Hydra ax, ay, az = 0, 5, 0.6 bx, by, bz = 0, 2.7, 0.65 elseif (vModel == 417) then -- Leviathan ax, ay, az = -0.5, 9, 1.2 bx, by, bz = -0.5, 3, 1.2 elseif (vModel == 487 or vModel == 497) then -- Maverick based vehicles ax, ay, az = -0.5, 5, 0.5 bx, by, bz = -0.5, 1.3, 0.5 elseif (vModel == 553) then -- Nevada ax, ay, az = -0.4, 20, 0.2 bx, by, bz = -0.4, 9.3, 0.6 elseif (vModel == 488) then -- News chopper ax, ay, az = -0.5, 5, 0.5 bx, by, bz = -0.5, 0.5, 0.5 elseif (vModel == 563) then -- Raindance ax, ay, az = -0.5, 9, 0.3 bx, by, bz = -0.5, 2.3, 0.3 elseif (vModel == 476) then -- Rustler ax, ay, az = 0, 1, 0.4 bx, by, bz = 0, -0.6, 0.4 elseif (vModel == 469 or vModel == 447) then -- Sparrow based vehicles ax, ay, az = -0.4, 5, 0.5 bx, by, bz = -0.4, 0.7, 0.5 elseif (vModel == 519) then -- Shamal ax, ay, az = -0.4, 10, 0 bx, by, bz = -0.4, 5, 0.5 elseif (vModel == 460) then -- Skimmer ax, ay, az = -0.35, 1, 0.5 bx, by, bz = -0.35, 0, 0.7 elseif (vModel == 513) then -- Stunt Plane ax, ay, az = 0, 1, 0.2 bx, by, bz = 0, -1.3, 0.2 elseif (vModel == 581 or vModel == 521 or vModel == 461 or vModel == 522) then -- BF 400, PCJ 600, FCR 900, NRG 500 ax, ay, az = 0, 1, 0.75 bx, by, bz = 0, -0.05, 0.75 isBike = 1 elseif (vModel == 509) then -- Bike ax, ay, az = 0, 1, 0.7 bx, by, bz = 0, -0.3, 0.7 elseif (vModel == 481) then -- BMX ax, ay, az = 0, 1, 0.7 bx, by, bz = 0, -0.2, 0.7 elseif (vModel == 462 or vModel == 448) then -- Faggio based vehicles ax, ay, az = 0, 1, 0.8 bx, by, bz = 0, -0.2, 0.8 isBike = 1 elseif (vModel == 463) then -- Freeway ax, ay, az = 0, 1, 0.8 bx, by, bz = 0, -0.6, 0.8 elseif (vModel == 510) then -- Mountain Bike ax, ay, az = 0, 1, 0.7 bx, by, bz = 0, -0.1, 0.7 elseif (vModel == 468) then -- Sanchez ax, ay, az = 0, 1, 0.85 bx, by, bz = 0, -0.3, 0.85 isBike = 1 elseif (vModel == 586) then -- Wayfarer ax, ay, az = 0, 1, 0.9 bx, by, bz = 0, -0.5, 0.9 isBike = 1 elseif (vModel == 472) then -- Coastguard ax, ay, az = -0.2, 1, 1.4
×
×
  • Create New...