Jump to content

Noki

Members
  • Posts

    851
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Noki

  1. You don't need to format your VPS if you mess up your MTA installation. Just delete the directory that MTA is installed in (rm -rf) and start the installation again!
  2. Look at the code I posted. It does not have a local index declaration.
  3. Use the [/lua] tags next time. pizza = {} function PutBoxOnHand() pizza[source] = createObject ( 1271, 0, 0, 0 ) exports.bone_attach:attachElementToBone(pizza[source],source,12,0.081,0.05,0.01,0,-70,0) end addEvent("PutBoxOnHand", true) addEventHandler("PutBoxOnHand", root, PutBoxOnHand) function removeBoxFromHands () if pizza[source] and isElement(pizza[source]) then destroyElement(pizza[source]) pizza[source] = nil end end addEvent("removeBoxHands", true) addEventHandler("removeBoxHands", getRootElement(),removeBoxFromHands)
  4. In the resource you want to call, you need to append a line to the meta.xml file. Like this: <export function="functionName" type="server"/> Valid types are: client, server and shared. You may call that function from another resource using the call function: exports.resourceName:functionName(arguments) Granted that if you're calling a server sided function, the script you're calling it from must be declared shared or server under type in the meta.xml file. The same principle applies to client.
  5. You will have to use triggerClientEvent and pass the return value from the server function.
  6. That code won't even work, Piorun. You need to use addEvent to add the event, then add an event handler to it. On topic, a great release. Thanks to all the developers and contributors. HTTPS support for fetchRemote is awesome.
  7. There's a guide on configuring nginx to run as an external web server. That runs your client resource downloads through nginx which is quite light, and also faster than the internal web server.
  8. adf.ly links... Really? Direct link for those who want an updated version of DayZ: https://github.com/mtadayz/MTADayZ
  9. Spawn yourself a vehicle through a random resource and run some code similar to this. noki().vehicle.parent.parent --> resourceRoot of the resource that created the vehicle noki().vehicle.parent.parent.id --> empty string Resource.getFromName(noki().vehicle.parent.parent.id) --> suddenly turns an empty string into a resource element I just cannot understand how that process works.
  10. Sorry for the bump, but can anyone please explain how that fix works?
  11. Add LilDolla to the list of developers. He did a lot for GTI.
  12. addEventHandler("onClientPlayerWeaponSwitch", localPlayer, function (_, slot) if (slot == 5 and getPedWeapon(localPlayer, 5) == 31) then setPedWalkingStyle(localPlayer, 69) else setPedWalkingStyle(localPlayer, 0) end end )
  13. local veh = {} function elvehiculo(thePlayer) local x, y, z = getElementPosition(thePlayer) veh[thePlayer] = createVehicle(400, x + 2, y, z) end addCommandHandler("veh",elvehiculo) function Explosion() for i, vehicle in pairs(veh) do if (vehicle == source) then destroyElement( veh[i] ) veh[i] = nil end end end addEventHandler("onVehicleExplode", getRootElement(), Explosion)
  14. Actually is setWeaponProperty setWeaponProperty("ak-47", "pro, std or poor", "move_speed", NUMBER); There's a difference between running and moving fast.
  15. It's actually setPedWalkingStyle.
  16. I don't think your issue would be related to this one.
  17. I've done a bit of searching and you're apparently able to achieve this with the customblips resource, although you'll have to modify it a bit. I'll get back to you on it after I've played around with it.
  18. Line 7: setTimer(guiSetText,2000,1,GUIEditor.edit[1],convertNumber(text + text2)) convertNumber returns a string with commas in it. You'll have to use the unconverted number if you want to perform any math on it.
  19. You're not trying to learn though. Every time you encounter a problem you post it here instead of trying to solve it yourself.
  20. Noki

    how ?

    If you're trying to convert from user input, I'd recommend cleaning the string, so to speak. str = str:gsub(" ", "") -- Remove whitespace as a precaution str = str:gsub(",", "") -- Some people feel the need to do this str = tonumber(str) -- If tonumber cannot convert, it will return nil if (str) then str = math.abs(str) -- 6.480000000000 becomes 6.48. I've had cases where people were crashing other's MTA clients with numbers that had many zeroes on the end. end
  21. Vectors go from two dimensions up to four dimensions (xy, xyz, xyzw). Let's say I wanted to get a position that's in front of me: local pos = player.position local r = player.rotation local x = pos.x - math.sin(math.rad(r.z)) * 4 local y = pos.y + math.cos(math.rad(r.z)) * 4 player.position = Vector3(x, y, pos.z) If I used matrices: local pos = player.matrix.position + player.matrix.forward * 4 player.position = pos
  22. I love seeing experimental stuff like this.
  23. You could use a timer and set velocity to 0, 0, 0. But like ViRuZ said about setting the position, it might be too intensive.
  24. Noki

    example

    A table with accounts as keys and balances as values. Modify the value for the account each time money is withdraw or deposited. community.multitheftauto.com is also your friend. - https://community.multitheftauto.com/index.php?p= ... s&id=11984 - https://community.multitheftauto.com/index.php?p= ... s&id=12425
  25. <right name="command.register" access="false"></right> <right name="command.login" access="false"></right>
×
×
  • Create New...