Jump to content

Markx

Members
  • Posts

    3
  • Joined

  • Last visited

Markx's Achievements

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody. (2/54)

0

Reputation

  1. Hello, I would like to know if there is any difference between using addEventHandler in these 2 ways as shown below: A: local list = { {-2172.03833, -2286.10107, 29.63500, 1.75}, } addEventHandler("onResourceStart", resourceRoot, function () for i, v in ipairs(list) do local Mark = createMarker(v[1], v[2], v[3], "cylinder", v[4], 255, 255, 255, 50) end end) B: local list = { {-2172.03833, -2286.10107, 29.63500, 1.75}, } function create() for i, v in ipairs(list) do local Mark = createMarker(v[1], v[2], v[3], "cylinder", v[4], 255, 255, 255, 50) end end addEventHandler("onResourceStart", resourceRoot, create) In the first example (A) I can make it work in the MTA, but in the second example it doesn't seem to work and I get the following error: stack overflow. Could someone tell me what the difference is between using addEventHandler before the function and after? and why In the second example (B) am I getting an error? I would be grateful for the help, thank you.
  2. Oh... ? I understand now, I thought that being a shared function I could use it equally on the client/server side. Thanks for the help Patrick, I was really confused about why it didn't work.
  3. Hi, I'm having a problem with this small part of my code, for some reason I can't get a "Hello" answer here, no matter what. function PlateText(thePlayer) local Vehicle = getPedOccupiedVehicle(thePlayer) if Vehicle then outputChatBox("Hi") else outputChatBox("bye") end end Whenever I try, it is always the answer "Bye" that is presented, I even tried with the example of the wiki and it also did not return the answer to me when I was in the vehicle. https://wiki.multitheftauto.com/wiki/GetPedOccupiedVehicle function showVehicleName ( thePlayer ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) if theVehicle then outputChatBox ( "Name of the Vehicle: " .. getVehicleName ( theVehicle ), thePlayer ) else outputChatBox ( "You do not have a Vehicle!", thePlayer, 255, 0, 0, true ) end end addCommandHandler ( "getcarname", showVehicleName ) Could someone help me here and tell me what's going on?
×
×
  • Create New...