-
Posts
1,102 -
Joined
Everything posted by Enargy,
-
Si tu script es cliente, entonces en el argumento de la función, thePlayer esta siendo el comando que ejecutaste y no el jugador, quita eso y usa solo localPlayer, si es server pues olvidaste agregar el elemento que pueda ver el mensaje.
-
Hi, I'm doing a new map (F11) but I have a small error when trying to add the size of an area, I tried with all the calculation but it doesn't work and sometimes I got bigger, smaller and some cases not appear. addEventHandler("onClientRender", root, function() for k, v in ipairs(getElementsByType("radararea")) do local ax, ay = getElementPosition( v ) local asx, asy = getRadarAreaSize ( v ) local r, g, b = getRadarAreaColor ( v ) local ax = math.round(x + (ax + 3000) * width / 6000) local ay = math.round(y - (ay - 3000) * height / 6000) -- heres the error, these calculations are badly: local sw = asx/6000*3000 local sh = -(asy/6000*3000) local width1 = sw * asy / 3000 * sh / 2 local height1 = sh * asy / 3000 * sh / 2 -- dxDrawRectangle(ax + 1, ay - 1, width1, height1, tocolor(r,g,b,100),false) end end ) Any help or an example would help. Thanks
-
Alguna guia de como iria la estructura de este script? En la wiki hay un ejemplo que te puede servir.
-
setBlipVisibleDistance ?
-
¿Qué ocurre con eso? Ahí dice que no borren los créditos (cosa que no hizo) y que se sientan libres de editarlo. Sobre el tema principal, me parece que sería útil que nos muestres como funcionan esas "classes", ya que la solución se enraíza en eso. El dice que en un grupoo criminales existen digamos como clasificaciones que son Ladrones y Hooker, creo.
-
local connection = dbConnect ( "sqlite" , "newDB.db" ) dbExec ( connection , "CREATE TABLE IF NOT EXISTS GangTop (kill INTEGER,gang TEXT)" ) Muertes = {} function KillClan (killer, headshot, weapon) gang = getElementData(killer,"gang") Muertes[gang] = Muertes[gang] + 1 outputChatBox(gang.." ahora tiene "..Muertes[gang].." Kills", getRootElement(), 255, 255, 255) local check = dbPoll(dbQuery(connection, "SELECT * FROM GangTop WHERE gang=?", tostring(gang)),-1) if (#check > 0) then dbExec(connection, "UPDATE GangTop SET kill="..tonumber(Muertes[gang]).." WHERE gang=?", tostring(gang)) outputServerLog ("Columna Actualziada") else dbExec(connection, "INSERT INTO GangTop(kill,gang) VALUES(?,?)", tonumber(Muertes[gang]), tostring(gang)) outputServerLog ("Columna Añadida") end end addEvent("DanoV2", true) addEventHandler("DanoV2", getRootElement(), KillClan)
-
Try this: _moveObject = moveObject function moveObject(element, time, x, y, z) if isElement(element) then local hasMoved = _moveObject ( element, time, x, y, z ) if ( hasMoved ) then triggerEvent("onElementPositionChanged", element, x, y, z) return true end end end addEvent("onElementPositionChanged", true) addEventHandler("onElementPositionChanged", root, function(x, y, z) local model = getElementType(source) -- source is the element that has changed his position outputChatBox("The "..model.."'s position was changed to: "..x..", "..y..", "..z, root) end) moveObject(SOME_OBJECT, TIMER, X, Y, Z)
-
fetchRemote(images[i], myCallback, "", false, playerdToReceive)
-
local GUIEditor = { window = {}, label = {}, button = {}, edit = {} }
-
[Proyecto] Multi Theft Auto: Zombie Rampage Apocalypse v1
Enargy, replied to Sergioks's topic in Servidores en donde jugar
Podrias hacer el servidor tuviese dilenguajes(dos lenguajes) para que personas del idioma inglés puedan jugarlo tambien, y así no te cueste mucho tiempo conseguir personas hispanas ya que en esta sección del foro esta un poco abandonada. -
if the values going to have the same value?
-
Usa getElementsWithinColShape(colshape, "player") que es una tabla, y luego loopeas para obtener a los players que estan dentro y luego usas setPlayerWantedLevel.
-
Quieres decir que en lugar de setPlayerWantedLevel usas triggerClientEvent?
-
if isElementWithinColShape(player, colshape) then setPlayerWantedLevel(player, 6) end
-
En el evento onColShapeHit, en la función agrega una condicional de que si el jugador posea esa arma, si lo hace usas takeWeapon. Te servirá cuando entres a un área. PD: takeAllWeapons funciona para quitar TODAS las armas a un ped. usa takeWeapon por si solo quieres ser mas especifico. arma = getPedWeapon (source) if arma == --[[ ID DEL ARMA PROHIBIDA ]] then takeWeapon(source, arma) end EDIT: @Estrategia, en lugar de usar getElementData usa isElementWithinColShape.
-
You're using OOP method. Use setPlayerTeam and setPlayerNametagColor
-
Me tome la libertad de escribir un código arriba con respecto a recuperar los datos de una DB como lo querías. Como dice Alexs puedes crear una tabla y luego la conviertes en una cadena(string ) y luego la guardas en la SQL así que tendrás que editar mi código.
-
--[[ local db = dbConnect("sqlite", "test.db") function start() dbExec(db, "CREATE TABLE IF NOT EXISTS my_members(clan TEXT, members INTEGER)") for _, player in ipairs(getElementsByType("player")) do local myTeam = getPlayerTeam(player) if myTeam then local teamName = getTeamName(myTeam) local sqlr = dbPoll(dbQuery(db,"SELECT * FROM my_members WHERE clan=?", teamName), -1) if (#sqlr == 0) then dbExec(db, "INSERT INTO my_members(clan,members) VALUES(?,?)", teamName, countPlayersInTeam(myTeam)) else dbExec(db, "UPDATE my_members SET clan='"..teamName.."', members='"..countPlayersInTeam(myTeam).."' WHERE clan=?", teamName) end end end end addEventHandler("onResourceStart", resourceRoot, start) ]] -- aqui consigo los valores de la columna 'members' siempre y cuando el nombre de un clan es valido. function getMemberCount(teamName) if type(team) ~= "string" or not team then return end local results = dbPoll(dbQuery(db,"SELECT * FROM my_members WHERE clan=?", tostring(teamName)), -1) if (#results ~= 0) then return #results end return 0 end --[[ -- aqui un claro ejemplo de querer obtener la cantidad. addCommandHandler("getmember", function(player) local team = getPlayerTeam(player) if team then outputChatBox("Mi clan tiene "..getMemberCount(getTeamName(team)).." persona/s", player) end end) ]] No lo he probado pero debe funcionar.
-
¿Como podría hacerlo, Me das un ejemplo? local _, y = guiGetScreenSize() local fy = (y / 600) local fontSize = fy*0.60 local ancho = dxGetTextWidth( texto, fontSize, font2, true )
-
Para la katana puedes usar algo así: local cantidad_de_daño = 50; addEventHandler ( "onPlayerDamage", getRootElement(), function ( attacker, weapon ) if ( attacker and attacker ~= source and weapon == 8 ) then setElementHealth(source, getElementHealth(source) - cantidad_de_daño); return true; end return false; end ) Para lo del super héroe tienes que ser mas especifico y postear lo que has hecho respecto a eso.
-
is bone_attach has been running?
-
If you won't test it no, but visually its fine.
