Jump to content

fxl

Members
  • Posts

    11
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by fxl

  1. fxl

    Table Sorting

    numTable = {} -- insert table.insert(numTable, 10) table.insert(numTable, 8) table.insert(numTable, 2) table.insert(numTable, 6) table.insert(numTable, 4) -- sort table.sort(numTable) output: 2 4 6 8 10 as provided before: https://www.lua.org/pil/19.3.html
  2. https://wiki.multitheftauto.com/wiki/TriggerClientEvent this one should work: triggerClientEvent(source, "setCameraForSpawn", source) triggerClientEvent(source, "toggleHUD", source)
  3. fxl

    WARNING

    addEvent ("tune.sync_objects", true); addEventHandler ("tune.sync_objects", root, function (veh, objects) local g = tune.gridlist[3]; local label_text = "none" ---- set it to none by default. if isPedInVehicle(localPlayer) then --if ped is in vehicle then set labeltext to vehname label_text = getVehicleName(getPedOccupiedVehicle(localPlayer)) end tune.label[5]:setText("Você deve estar em um veículo para usar este painel.\nVeículo atual: "..label_text) if not isPedInVehicle (localPlayer) then return end if not veh or not objects then return end guiGridListClear (g); for i=#objects, 1, -1 do local v = objects[i]; if isElement (v) then local row = guiGridListAddRow (g); guiGridListSetItemText (g, row, 1, veh, false, false); guiGridListSetItemText (g, row, 2, getElementModel (v), false, false); guiGridListSetItemData (g, row, 1, v); end end guiGridListSetSelectedItem (g, 0, 1); end ); This code should work without errors.
  4. fxl

    [HELP]

    https://wiki.multitheftauto.com/wiki/Call This function is used to call a function from another resource (which must be running). You can replace it with another function like: outputServerLog outputDebugString outputChatBox
  5. setAccountData(account, "ID", randomID) ?
  6. db = dbConnect( "sqlite", "db.db" ) function checkFraction(player) local acc = getPlayerAccount(player) local playerName = getAccountName(acc) local result = dbPoll(dbQuery(db,"SELECT * FROM `fraction` WHERE login = ?",playerName),-1) if #result > 0 then for i,v in ipairs(result) do outputChatBox('This fraction : '..v.fractionId,player) end else outputChatBox("Error",player) end end checkFraction() -- you need to add player argument for example for _,plrs in ipairs(getElementsByType("player")) do -- get all players on server checkFraction(plrs) --check their fraction end
  7. https://wiki.multitheftauto.com/wiki/SetVehiclePlateText https://wiki.multitheftauto.com/wiki/GetVehiclePlateText
  8. fxl

    WARNING

    make sure your script is in right ACL Group, with rights to function.fetchRemote
  9. infoMarker = createMarker(2808.621094,-2430.112305,12.62857, "cylinder", 2.0, 255, 0, 0, 150) function MarkerHit(player) outputChatBox("Hello",255,0,0,true) end addEventHandler("onMarkerHit",infoMarker,MarkerHit) Also you have to change script type in meta.xml
  10. https://wiki.multitheftauto.com/wiki/EngineSetModelLODDistance should work
  11. function cdamage(attacker, weapon, bodypart, loss) if getElementHealth(source)-loss <= 20 then -- if player health reaches 20 or below after damage cancelEvent() -- cancels dmg setElementHealth(source, 20) -- bring u back to 20hp end end addEventHandler("onClientPlayerDamage", localPlayer, cdamage)
×
×
  • Create New...