Jump to content

Aron800

Members
  • Content Count

    18
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Aron800

  • Rank
    Square
  1. Hello, I want to make a script that if you join and you are in a xml list as a member of the gang. That you will join the team. But i got a problem. It is not returning any errors. This is my script: teams.lua: gResRoot = getResourceRootElement(getThisResource()) function loadGangs () local root = xmlLoadFile("gangs.xml") if (gangRoot) then for i,gang in ipairs (xmlNodeGetChildren(root)) do local info = xmlFindChild(gang, "info", 0) if info then local colorR = xmlNodeGetAttribute(gang, "colorR") local colorG
  2. It works thanks again
  3. Yes cars.xml is the same And it returns false But my map looks like this: * cars.xml * meta.xml * help.xml * spawn.lua * playerMenu.lua
  4. Again another problem: I made a script, you can lock and unlock your car but you can only have one car now. So i want to make a player menu. And in the player menu you need to select your car. But when i try it it returns an error. My script: function startWindow(thePlayer) local X = 0.375 local Y = 0.375 local Width = 600 local Height = 330 playerMenu = guiCreateWindow(X, Y, Width, Height, "Player Menu (M)", false) tabWidget = guiCreateTabPanel(10, 25, 581, 291, false, playerMenu) tabCars = guiCreateTab("Cars", tabWidget) listWidget = guiCreateGridList(12, 30, 551, 192, false, tab
  5. And is there a way to update the x,y,z and rotation of the car if you do the /park command? EDIT: Maybe if i setElementData to the number of the car?
  6. Thank you it works. And how can i find out if you are the car owner or not if you are in the car?
  7. The rotation of the car. But my last question i think: gResRoot = getResourceRootElement(getThisResource()) function loadCars () local root = xmlLoadFile ("cars.xml") local carRoot = xmlFindChild (root,"parked",0) if (carRoot) then allCars = {} for i,v in ipairs (xmlNodeGetChildren(carRoot)) do local carmodel = xmlNodeGetAttribute(v, "model") local carX = xmlNodeGetAttribute(v, "posX") local carY = xmlNodeGetAttribute(v, "posY") local carZ = xmlNodeGetAttribute(v, "posZ") local carA = xmlNodeGetAttribute(v, "rot") local carName = "car" .. xmlNodeGetAttribute(v, "num") local car = createV
  8. Thanks it works. And one other question: If i want to give the car a name and an ID how do i give it the name car0 and car1? Because this doesn't work: local carName = "car" + xmlNodeGetAttribute(v, "num") carName=createVehicle(carmodel, carX, carY, carZ, 0.0, 0.0, carA) setElementID(carName,carName)
  9. I am not really sure but you can just use [lua][/lua]
  10. Hello, I started with scripting 2 weeks ago and i want to try something but it doesn't work. My script.lua: gResRoot = getResourceRootElement(getThisResource()) function loadCars () local root = xmlLoadFile ("cars.xml") local carRoot = xmlFindChild (root,"parked",0) if (carRoot) then allCars = {} for i,v in ipairs (xmlNodeGetChildren(carRoot)) do local carmodel = xmlNodeGetAttribute(carRoot, "model") local carX = xmlNodeGetAttribute(carRoot, "posX") local carY = xmlNodeGetAttribute(carRoot, "posY") local carZ = xmlNodeGetAttribute(carRoot, "posZ") local carA = xmlNodeGetAttribute(carR
  11. Does anyone know how i can let it work?
  12. I know but if i let engineer accelerate then the train needs to be moving. But that doesn't work...
  13. It still doesn't work but i found what is wrong setPedControlState(engineer,"accelerate",true) When i try to run the code with runcode it returns: Aron executed command: setPedControlState(engineer,"accelerate",true) Error: [string "return setPedControlState(engineer,"acceler..."]:1: attempt to call global 'setPedControlState' (a nil value) But i dont know how i can make this work. That setPedControlState works if i make a pilot so maybe it does not work on a train?
×
×
  • Create New...