Jump to content

Search the Community

Showing results for tags 'math.random'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • [Read-Only] Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 4 results

  1. Hello guys! I'm working on one job script which is pizza delivery. Everything is working fine, but i wanted to give random salary after every customer. "fizu" mean the payment so i made random 5$ to 150$, but for some reason after every customer only give 18$ and not random. Any idea why this could happen? This is my code: fizu = math.random(5,150) addEventHandler("onColShapeHit", getRootElement(), function (thePlayer, sameDimension) if isElement(source) then if getElementType(thePlayer) == "player" then if sameDimension then local currentJob = startedJobs[thePlayer] if currentJob then local colData = getElementData(source, "pizzaCol") if colData and colData[1] == thePlayer then local carryingPizza = getElementData(thePlayer, "carryingPizza") or {} if carryingPizza[1] then local orderId = colData[2] if carryingPizza[1] == currentJob.pizzas[orderId] then local remainingPizzas = 0 local pizzaBoyElement = getElementData(thePlayer, "usingPizzaBoy") if isElement(pizzaBoyElement) then local pizzaBoyInventory = getElementData(pizzaBoyElement, "pizzaBoyInventory") or {} for k in pairs(pizzaBoyInventory) do remainingPizzas = remainingPizzas + 1 end end destroyElement(source) if remainingPizzas <= 0 then startedJobs[thePlayer] = nil setElementData(pizzaBoyElement, "pizzaBoyInventory", false) else currentJob.delivered[orderId] = true end exports.cl_core:giveMoney(thePlayer, fizu, "pizzaDelivered") setElementData(thePlayer, "usingPizzaBoy", false) setPedAnimation(thePlayer, false) setElementFrozen(thePlayer, false) triggerClientEvent(thePlayer, "pizzaDeliveredSuccessfully", thePlayer, orderId, remainingPizzas) exports.cl_hud:showInfobox(thePlayer, "s", "Sikeresen leszállítottad a pizzát! ") else exports.cl_hud:showInfobox(thePlayer, "e", "Ez a megrendelő nem ilyen pizzát kért!") end end end end end end end end )
  2. how can i make something this currentSkin = getElementModel(source) setElementModel(source,math.random(currentSkin ,28)) so, 28 or the currentskin
  3. I want make more than one function to math.random, when i click on a button, choose a function, for example god mode, or give weapons, how to make it? Sorry for my very bad english.
  4. Sticmy

    Me ayudan

    Hola quiero que me ayuden en algo estuve hace una tabla que cuando un jugador tome un vehículo y le salga cual quier texto por ejemplo en la tabla que hice puse estó. texto = {"Text", "Text2", "Text3"} function drawve() local screenW, screenH = guiGetScreenSize() dxDrawText("Carga Actual: "..texto[math.random(1, #texto)].."", (screenW * 0.3050) - 1, (screenH * 0.7844) - 1, (screenW * 0.6913) - 1, (screenH * 0.8900) - 1, tocolor(255, 255, 0, 255), 1.50, "default-bold", "center", "center", false, false, false, false, false) end Todo esta bien solo que cuando aparece se cambia rápidamente los nombres que puse en la tabla. y lo que quiero hacer es que aparezca 1 pero con cual quier texto que salga uu
×
×
  • Create New...