Jump to content

Termycraft

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by Termycraft

  1. with element data it's LAGGY peds teleport anywhere!
  2. Hi. MTA San Andreas stopped working. Yesterday it was working perfectly Today I started MTA, it did the loading but it started the "gta_sa.exe" process without GUI, so I tried to delete GTA Settings and the ENB Series but nothing! So I downloaded the latest DirectX runtimes and the latest MTA Version but nothing anyway. Downloaded this: http://files.mtasa.com/apps/tools/MTADiag.zip and ran: MTADiag v2.6.4 by Towncivilian MTA install path: C:\Program Files (x86)\MTA San Andreas 1.3 MTA version: 1.3.1-9.04813.0.000 GTA install path: C:\Program Files (x86)\Rockstar Games\GTA San Andreas DirectX is up-to-date. MTADiag will now download the latest patch of MTA:SA. Downloaded: 100% Launching the installer... Run MTA once the installer has finished to see if it works now. Installed the MTA patch, now when I run MTA it says: The instruction at 0x0074870d referenced memory at 0x1d6eefe5. The memory could not be read. Click on OK to terminate the program I don't know what's the problem, seriously. Typed "n" on the diagnostic tool and made a pastebin link: http://pastebin.com/B4texPJM What do I do? What's the problem? Please help me! OS: Windows 7 Home Premium 64 bit (without service pack) Video 1: Intel® HD Graphics Video 2: NVIDIA GeForce GT 540M (used to launch MTA) (Video memory: 2 GB DDR3) RAM: 4 GB Processor: Intel® Core i5 CPU M 480 2.67 GHz Quad-Core
  3. Thanks to everyone. I'll try with tables, now. I hope it won't lag.
  4. Hi, scripters! I just want to spawn some enemies in map. I know how to synchronize peds movements between client and server, but I don't know what is the better syncer! I thought that the better syncer can be the player with the lowest ping, but if he's too far from the enemy, he doesn't synchronize. So the problem is the syncer: should I remain the syncer chosen from the server? And how can I make the peds choose their targets? Give me some ideas and I'll do a great work, thanks P.S.: If you can, tell me how you would synchronize peds' actions between clients, thank you very much if you answer to this too
  5. Hi to everyone, I'm making a script that makes rockets shoot from ass (), the projectile is created, but has a bad (I repeat: BAAD) rotation! Here's the script: setTimer( function() if getControlState("fire") == true then if selWeap == 1 then local x, y, z = getPedBonePosition(getLocalPlayer(), 1) local rot = getPedRotation(getLocalPlayer()) local velRot = rot + 180 velRot = velRot + 90 velRot = math.rad(velRot) local dirX, dirY = math.cos(velRot), math.sin(velRot) rot = getPedRotation(getLocalPlayer()) + 180 createProjectile(getLocalPlayer(), 19, x, y, z, 1, nil, 0, 0, rot, dirX, dirY, 0) setElementData(getLocalPlayer(), "peto", true) end else setElementData(getLocalPlayer(), "peto", false) end for i, players in ipairs(getElementsByType("player")) do if getElementData(players, "peto") == true then local x, y, z = getPedBonePosition(players, 1) local rot = getPedRotation(players) rot = rot + 180 rot = rot + 90 rot = math.rad(rot) local dirX, dirY = x + math.cos(rot), y + math.sin(rot) dirX, dirY = dirX - x, dirY - y fxAddTankFire(x, y, z, dirX, dirY, 0) end end end , 250, 0) What is the problem? createProjectile Everything is working, but it creates the projectile with a rotation of 0, please help me!
  6. I hope they will add a function named 'attachElementToPedBone', or a similar thing, it will simplify scripting to everyone
  7. If the server can't load the resource, there's a problem with the meta.xml, please verify your meta.xml, then retry.
  8. Server-side call from Client-side, and Client-side call from Server-side Hi to everyone, I made a script that makes easy to call any server-side function from client-side and client-side functions from server-side, just copy these codes in your script, Client-side in a Client-side lua file, and Server-side in a Server-side lua file, works ONLY for one resource, here is the code: This goes in CLIENT-SIDE addEvent("executeClientFunction", true) addEventHandler("executeClientFunction", getRootElement(), function(theFunction, ...) g = {...} pcall(loadstring(theFunction)) end ) function runPlatformFunction(platform, theFunction, ...) local args = {...} theFunction = theFunction.."(" for index, argument in ipairs(args) do if index == #args then theFunction = theFunction.."g["..index.."])" else theFunction = theFunction.."g["..index.."], " end end triggerServerEvent("executeFunction", getRootElement(), platform, theFunction, ...) end This goes in SERVER-SIDE addEvent("executeFunction", true) addEventHandler("executeFunction", getRootElement(), function(platform, theFunction, ...) if platform == "server" then g = {...} local result = pcall(loadstring(theFunction)) elseif platform == "client" then triggerClientEvent("executeClientFunction", getRootElement(), theFunction, ...) end return true end ) function runClientFunction(theFunction, ...) local args = {...} theFunction = theFunction.."(" for index, argument in ipairs(args) do if index == #args then theFunction = theFunction.."g["..index.."])" else theFunction = theFunction.."g["..index.."], " end end triggerEvent("executeFunction", getRootElement(), "client", theFunction, ...) end How to use in Client-side to call client and server functions You can use this function in client-side: runPlatformFunction(platform, theFunction, arg1, arg2, ...) platform can be "server" or "client", if it's server, the function will be executed in server-side, if it's "client", the function will be executed in client-side by everyone, so every player can see the "createFire", for example. theFunction here goes the function between the brackets, for example "setElementVelocity", ONLY the function, without arguments. arg1, arg2, ... here go the arguments, WITHOUT brackets, for example hitElement, velX, velY, velZ. If the function is "outputChatBox" or any function that requires a string, you can use the brackets, (ex. "Hi, how are you?") but only where the string is required. Ex. runPlatformFunction("server", "setElementVelocity", hitElement, velX, velY, velZ) -> calls the server-side function from a client. Ex. runPlatformFunction("client", "createFire", 215, 226, getGroundPosition(215, 226, 600)) -> calls the "createFire" client function from a client but will be executed by everyone: everyone can see the fire. How to use in Server-side to call a synchronized Client-side function This is the code: runClientFunction(theFunction, arg1, arg2, ...) Works similar with the other function, but this can be called in Server-side only and calls a synchronized between clients client-side function. Ex. runClientFunction("playSound", "sound.wav") -> Makes every client play "sound.wav". Example: Super Punch This is a cool mix of client-side functions and server-side functions and shows you the power of this code, here is the script: bindKey("fire", "down", function() local weapon = getPedWeapon(getLocalPlayer()) if weapon == 0 then local x, y, z = getElementPosition(getLocalPlayer()) local rot = getPedRotation(getLocalPlayer()) rot = rot + 90 rot = math.rad(rot) local vx, vy = x + math.cos(rot), y + math.sin(rot) local collision, hitX, hitY, hitZ, hitElement = processLineOfSight(x, y, z, vx, vy, z, true, true, true, true, true, false, false, false, getLocalPlayer()) if collision == true and isElement(hitElement) == true then if getElementType(hitElement) == "vehicle" then local velX, velY, velZ = math.cos(rot) * 0.5, math.sin(rot) * 0.5, 0.5 runPlatformFunction("server", "setElementVelocity", hitElement, velX, velY, velZ) runPlatformFunction("server", "setElementHealth", hitElement, getElementHealth(hitElement) - 250) for i = 0, 5 do runPlatformFunction("server", "setVehicleDoorState", hitElement, i, 4) end end end end end ) When you press the "fire" button, if there is a collision match with the vehicle in front of you, the script will call the server-side functions "setElementVelocity" to kick out the vehicle, "setElementHealth" to remove some health and "setVehicleDoorState" to remove all doors from the vehicle.
×
×
  • Create New...