Jump to content

MexUK

Members
  • Posts

    4
  • Joined

  • Last visited

MexUK's Achievements

Vic

Vic (3/54)

0

Reputation

  1. MexUK

    No explode car

    try this: function nobum() if ( isVehicleFuelTankExplodable ( source ) ) then setVehicleDamageProof ( source, true ) end end addEventHandler("onVehicleDamage", getRootElement(), nobum) function damage() if isVehicleDamageProof ( source ) then setTimer (setVehicleEngineState, 2100, 1, source, false) end end addEventHandler("onVehicleDamage", getRootElement(), damage) https://wiki.multitheftauto.com/wiki/OnVehicleDamage
  2. ipairs() is for tables where the keys are type 'number', start at 1 and increase by 1 on the next element the elements don't have to be added to the table in key order local Table = { 'a', 'b', 'c' } local Table = { [1]='a', [2]='b', [3]='c' } local Table = {} Table[1] = 'a' Table[2] = 'b' Table[3] = 'c' local String = table.concat(Table, " ") local Table = { unpack(Table) } for i,v in ipairs(Table) do end pairs() is for when the above doesn't apply, the keys can be any type lua supports, it will loop around all the elements in the table, but they are in a random order local Table = { 'key'='a', 'key2'='b', 'key3'='c' } local Table = {} Table['key'] = 'a' Table['key2'] = 'b' Table['key3'] = 'c' local Table = {} Table[2] = 'a' Table[8] = 'b' Table[0] = 'c' for k,v in pairs(Table) do end
  3. try: if(g_PlayerTick[source] and getTickCount()-g_PlayerTick[source] < 20000) then that's assuming the first time a player uses a command their tick value hasn't been set.
  4. Not sure if this will work, but you could try something like: local EditBox1 = guiCreateEdit(0, 0, 0.2, 0.2, "text here 1", true) local EditBox2 = guiCreateEdit(0.3, 0.3, 0.2, 0.2, "text here 2", true) local EditBox1Text = guiGetText(EditBox1) guiSetText(EditBox2, EditBox1Text) https://wiki.multitheftauto.com/wiki/GuiGetText https://wiki.multitheftauto.com/wiki/GuiSetText
×
×
  • Create New...