• Announcements

    • jhxp

      Forums are online again after a maintenance.   18/03/17

      MTA Forums maintenance is completed, although some automatic time-heavy tasks are still in process and will be finished eventually in background. Expect some features such as Forum Search to not display all results until all processes are finished. Please let us know if you spot a forum feature that worked correctly before the maintenance but does not work anymore now. Thanks. --MTA Team


  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About luskanek

  • Rank
  • Birthday August 4


  • Location
  1. *boop* got a new problem with my script for i, colshape in ipairs(getElementsByType("colshape")) do if isElementWithinColShape(player, colshape) then for o, object in ipairs(getElementsByType("object")) do if isElementWithinColShape(object, colshape) then for _, object in ipairs(getElementsByType("object")) do GUIEditor.row[1] = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], GUIEditor.row[1], column, getElementModel(object), false, false) end end end end end Hey guys I got a problem with my function. I have 3 objects within a colshape and I want their model IDs to be added to a gridlist GUI. The problem is, there are 3 objects, but about 15 rows get added to the gridlist with duplicated IDs. The rows should look like this: 1 2 3 But what happens is: 1 2 3 3 3 1 2 3 3 3 and this goes on until it loops 3 times. How do I fix it?
  2. Nevermind fixed it
  3. The way it works is, that you post a script here and we fix it for you. You can ask someone to make a script for money.
  4. It is not that easy to detect if someone has been killed by a hydra, hunter or any rocket at all. It is doable but requires advanced knowledge of the language. You should focus on something easier first and try it later, when you learn more advanced things.
  5. Whoops, was in a hurry and forgot about that one, fixed. Thanks for pointing it out!
  6. lv = createColRectangle(901.67871, 601.66272, 2050, 2400) theTeam = createTeam("Criminal") addEventHandler("onColShapeLeave", getRootElement(), function(hitElement) if getElementType(hitElement) == 'player' then if source == lv then setPlayerTeam(hitElement, anotherTeam) end end end )
  7. Well ofcourse someone else should kill you in order for the message to appear. Are you killed by an another player or not?
  8. Whoops, my bad, sorry! Try this: lv = createColRectangle(901.67871, 601.66272, 2050, 2400) theTeam = createTeam("Gangsters") addEventHandler("onColShapeHit", getRootElement(), function(hitElement) -- forgot hitElement if getElementType(hitElement) == 'player' then if source == lv then outputChatBox("test") setPlayerTeam(hitElement, theTeam) end end end )
  9. function player_Wasted(_, attacker) if attacker then if getElementType(attacker) == "player" then outputChatBox(getPlayerName(attacker).. " killed " ..getPlayerName(source),getRootElement(),255,255,255) end end end addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted )
  10. lv = createColRectangle(901.67871, 601.66272, 2050, 2400) theTeam = createTeam("Gangsters") addEventHandler("onColShapeHit", getRootElement(), function() if getElementType(hitElement) == 'player' then if source == lv then outputChatBox("test") setPlayerTeam(hitElement, theTeam) end end end )
  11. addEventHandler("onResourceStart", getRootElement(), handl) function handl() for _, v in ipairs(getElementsByType("vehicle")) do if getElementModel(v) == 601 then setVehicleHandling(v, "mass", 15000.0) setVehicleHandling(v, "turnMass", 15000) setVehicleHandling(v, "maxVelocity", 70.0) setVehicleHandling(v, "engineAcceleration", 5.0 ) setVehicleHandling(v, "engineInertia", 25.0) setVehicleHandling(v, "steeringLock", 25.0 ) setVehicleHandling(v, "seatOffsetDistance", 1.0) end end end No need to make another topic if you already have one.
  12. addEventHandler("onResourceStart", getRootElement(), function() setModelHandling(601, "mass", 15000.0) setModelHandling(601, "turnMass", 15000) setModelHandling(601, "maxVelocity", 70.0) setModelHandling(601, "engineAcceleration", 5.0 ) setModelHandling(601, "engineInertia", 25.0) setModelHandling(601, "steeringLock", 25.0 ) setModelHandling(601, "seatOffsetDistance", 1.0) end ) Use this instead, it's alot better.
  13. Well just use the variables in dxDrawText and you're good to go
  14. addEventHandler("onClientRender", root, function() if isPlayerInVehicle(getLocalPlayer()) local vehicle = getPedOccupiedVehicle(getLocalPlayer() local cnt = 0 for _, occupant in pairs(getVehicleOccupants(vehicle)) do if occupant then if getElementType(occupant) == 'player' then cnt = cnt + 1 end end end end end ) What do you need the names of the player and vehicle for?
  15. Client: addCommandHandler("mycommand", function() setElementData(getLocalPlayer(), "shaderEnabled", 1) engineApplyShaderToWorldTexture(...) end ) addEvent("applyShader", true) addEventHandler("applyShader", getRootElement(), function() engineApplyShaderToWorldTexture(...) end ) Server: addEventHandler("onPlayerLogin", getRootElement(), function() setAccountData(acc, "isShaderEnabled", 0) end ) addEventHandler("onPlayerLogout", getRootElement(), function() local value = getElementData(source, "shaderEnabled") local acc = getPlayerAccount(source) setAccountData(acc, "isShaderEnabled", value) end ) addEventHandler("onPlayerSpawn", getRootElement(), function() local acc = getPlayerAccount(source) local value = getAccountData(acc, "isShaderEnabled") if value == 1 then triggerClientEvent(source, "applyShader", source) end end ) Ofcourse you have to edit it yourself. May contain erros because it was written out of my mind.