Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    buymap

    You're welcome .
  2. Castillo

    buymap

    Copy the code again. P.S: 10000 - 3500 = 6500 .
  3. Castillo

    buymap

    function buyMap(player, command, ...) local money1 = tonumber(getElementData(player,"Money")) if g_ForcedNextMap then outputChatBox( 'Next map is ' .. getMapName( g_ForcedNextMap ), player ) return end local query = #{...}>0 and table.concat({...},' ') or nil if not query then if g_ForcedNextMap then outputChatBox( 'Next map is ' .. getMapName( g_ForcedNextMap ), player ) else outputChatBox( 'Next map is not set', player, 255, 0, 0 ) end return end local map = findMap(query) if not map then outputChatBox(errormsg, player) return end if(money1 >= 3500) then if lastmap_B == map then outputChatBox( 'That map has been played too much recently.', player, 255, 0, 0 ) else g_ForcedNextMap = map outputChatBox(getPlayerName(player).. " bought map '" ..getMapName(g_ForcedNextMap).. "' for $3500. (/bm)", g_Root, 0, 240, 0) setElementData(player, "Money", money1-3500) lastmap_B = g_ForcedNextMap end else outputChatBox("You don't have enough money. ($3500)", player, 255, 0, 0) end end addCommandHandler('bm', buyMap) addCommandHandler('buymap', buyMap)
  4. Oh, yo puse las funciones del MTA, me equivoque. addCommandHandler("flip", function(thePlayer, flip, ammount) if tonumber(ammount) > tonumber(getElementData(thePlayer,"data.money")) then outputChatBox("You don't have that kind of money",thePlayer,255,0,0) elseif ammount > 1000 then outputChatBox("You can't flip more than 1000$",thePlayer,255,0,0) end local money = tonumber(getElementData(thePlayer,"data.money")) if math.random ( 2 ) == 1 then setElementData(thePlayer, "data.money", money+tonumber(ammount)) else setElementData(thePlayer, "data.money", money-tonumber(ammount)) end end)
  5. De nada. "Post Scripting"? que es eso?
  6. You can create your own "window" with some knowledge. P.S: Why would you create a window then a image...? just create a image .
  7. function getServerMaps() local mapsTable = {} for resourceKey, resourceValue in ipairs(getResources()) do local name = getResourceInfo ( resourceValue, "name" ) local type = getResourceInfo ( resourceValue, "type" ) local author = getResourceInfo ( resourceValue, "author" ) local game = getResourceInfo ( resourceValue, "gamemodes" ) if (type == "map" and game == "race") then table.insert(mapsTable, {name=name, author=author or "Unknown"}) end end return mapsTable end Esa funcion deberia cargar todos los mapas que sean para el game mode "race" en una tabla y devolverla cuando ejecutas la funcion. Ejemplo: local mapas = getServerMaps() for index, map in pairs(mapas) do outputChatBox(tostring(map.name) ..": ".. tostring(map.author)) end P.S: El script es server-side.
  8. Con este recurso: https://community.multitheftauto.com/index.php?p= ... ils&id=538 podes hacer que caiga nieve.
  9. addCommandHandler("flip", function(thePlayer, flip, ammount) local money = tonumber(getElementData(thePlayer,"data.money")) local suerte = math.random(0,1) if (tonumber(ammount) > money) then outputChatBox("You don't have that kind of money",thePlayer,255,0,0) end if (ammount > 1000) then outputChatBox("You can't flip more than 1000$",thePlayer,255,0,0) end if (suerte == 1) then givePlayerMoney(thePlayer, tonumber(ammount)) elseif (suerte == 0) then takePlayerMoney(thePlayer, tonumber(ammount)) end end)
  10. Evil-Cod3r, if you don't know how to do it then don't reply. @Blaawee: GUI windows are kinda rectangular with a little rounded, you can't change the form of how it looks.
  11. Castillo

    lua tutorials

    Well, in my opinion that's up to you, you can spend 2-3 hours and take a break.
  12. Vehicle mod: https://community.multitheftauto.com/index.php?p= ... ls&id=3326
  13. My bad, I meant data.money .
  14. addEventHandler("onClientCursorMove", root, function( _, _, _, _, wx, wy, wz ) local cx, cy, cz = getCameraMatrix() x1 = ( wx - cx ) / 300 y1 = ( wy - cy ) / 300 z1 = ( wz - cz ) / 300 end ) That's from cod2mod.
  15. Replace getPlayerMoney() with getElementData(localPlayer,"data.money")
  16. The "race starter pack" resource does not use the normal GTA money system, it uses element data.
  17. Los slothbots funcionan en el MTA 1.1.1 pero hay que editar algo para que funcione. Igual, no son muy buenos .
  18. This resource is not made by him, but me: https://community.multitheftauto.com/index.php?p= ... ls&id=3323
  19. Evil-Cod3r, you really can't talk about stealing, your "War Shop" has parts of my "Shop" resource uploaded to the MTA community, I haven't told you anything, but now I really feel like I should. So please, stop fighting if you're one of these who copy scripts form someone else without their permission.
  20. What has volume to do with the speed?
  21. Castillo

    Gridlists.

    Really, why doesn't people spend some time in the wiki? there are function/event examples. https://wiki.multitheftauto.com/wiki/GuiCreateGridList
  22. When I see that is a stolen script, I don't help them, but I couldn't know, maybe it was a resource from the MTA community and he was just editing it, I can't download every resource and compare them .
  23. https://community.multitheftauto.com/index.php?p= ... ls&id=3319 That's not really made by him.
  24. This will remove the script files, not the skin/vehicle mods and so on.
×
×
  • Create New...