Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. There's no really way to know who shoot you, because you get killed caused by your vehicle explosion, not by the rocket fired. I don't know if "onClientVehicleCollision" detects the rocket, and if you're able to track the projectile creator.
  2. Castillo

    Some help.

    "ipairs" is used for indexed tables. And "pairs" can be used for any table (as far as I know). You need "in" combined with "(i)pairs" in a for-loop.
  3. Read again what I said above and do it again. It has to work, I'm using it on one of my race userpanel.
  4. He's talking about San Andreas world objects.
  5. local min, sec = convertTime(time) --if time is better than the top 1 theTime = executeSQLQuery( "SELECT time FROM Top WHERE map = '" ..mapName.. "'" ) local old = split(theTime[1]['time'],':') if (tonumber(old[1]) < min and tonumber(old[2]) < sec) then triggerEvent('onGotTop',source) --update top executeSQLQuery( "UPDATE Top SET player= '"..player.."', time= '"..min..":"..sec.."' WHERE map='"..mapName.."'" )
  6. local data = split(theTime[1]['time'], ':') if data[1] then print(data[1]) end if data[2] then print(data[2]) end
  7. You can split the string and then compare it. Use: split
  8. Look, my function converts milliseconds to: minutes, seconds. Just use it like I show you above. local milliseconds = exports.race:getTimePassed( ) local mins, secs = convertTime(milliseconds)
  9. I guess so, it converts milliseconds to minutes, seconds.
  10. function convertTime(ms) local min = math.floor ( ms/60000 ) local sec = math.floor( (ms/1000)%60 ) return min, sec end You can use it like this: local minutes, seconds = convertTime(60000)
  11. Castillo

    Some help.

    local messages = { "Hello World!", 2, } for index, message in ipairs(messages) do if string.find(message, "World") then -- We search for the world: "World", if found we output a message. outputChatBox("Found word: World") else outputChatBox(tostring(message)) -- Convert numbers (if found) to string. end end
  12. addCommandHandler("speed", function (thePlayer, cmd, theSpeed) local theSpeed = tonumber(theSpeed) local vehicle = getPedOccupiedVehicle(thePlayer) if (theSpeed and vehicle) setElementSpeed(vehicle, "kph", theSpeed) end end) function getElementSpeed ( element , unit ) if not element or not isElement ( element ) then return false end if unit == "kph" then unit = 1.61 else unit = 1 end local velX , velY , velZ = getElementVelocity ( element ) return ( velX ^ 2 + velY ^ 2 + velZ ^ 2 ) ^ 0.5 * unit * 100 end function setElementSpeed ( element, unit , speed ) if not element or not isElement ( element ) then return false end if not speed then speed = 0 end local acSpeed = getElementSpeed ( element , unit ) local diff = speed / acSpeed local velX , velY , velZ = getElementVelocity ( element ) setElementVelocity ( element , velX * diff , velY * diff , velZ * diff ) return true end That should add a command: /speed .
  13. These functions can be used to get/set a element speed, not just vehicles.
  14. Yeah, that. Like: "Wohahahaah" (skull).
  15. Es off-topic pero bueh. Me fui, me habia aburrido y ademas no tengo tiempo para seguir.
  16. Castillo

    playericons

    @pocko: Rename "playericons" to "playerblips", it may work.
  17. Te aconsejo que empiezes a pensar, no te dare el script hecho.
  18. Add this to "race/racevoting_server.lua": function setNextMap( ... ) local query = #{...}>0 and table.concat({...},' ') or nil if not query then if g_ForcedNextMap then return false, "Next map is already set." end end local map, errormsg = findMap( query ) if (not map) then outputRace( errormsg, player ) return false, "Map not found." end if (g_ForcedNextMap == map) then return false, 'Next map is already set to ' .. getMapName( g_ForcedNextMap ) end g_ForcedNextMap = map return true end And then add this to the meta.xml: function="setNextMap" type="server" /> Then you can do: local set, errorMsg = exports["race"]:setNextMap(mapName)
  19. No, I haven't, I may do it later . P.S: I meant a dead sound, not a dead message, sorry
  20. Si no me equivoco es el recurso "armas", verdad? si es asi, entonces que quieres que funcione con "/fps"?
  21. Estas usando funciones, eventos client side con funciones server side, eso nunca va a funcionar.
  22. Weapon,Skin,Vehicle mods: https://community.multitheftauto.com/index.php?p= ... ls&id=3748 Voice resource that comes with MTA: https://community.multitheftauto.com/index.php?p= ... ls&id=3744 Snow script by Remp: https://community.multitheftauto.com/index.php?p= ... ls&id=3740 He didn't add him to author list.
  23. I'm not sure but as far as I know, you can't remove objects via Map Editor, but you can click world objects to get their position, model, rotation and so on.
×
×
  • Create New...