Jump to content

alex17

Members
  • Posts

    302
  • Joined

  • Last visited

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

alex17's Achievements

Prankster

Prankster (22/54)

0

Reputation

  1. Más de lo mismo, el archivo debe ser de tipo server, no? no debe ser tipo client
  2. lo siento puse mal el nombre del evento reemplaza esto addEventHandler ( "onClientplayerDamage", getRootElement(), cancelPedDamage ) por esto addEventHandler ( "onClientPlayerDamage", getRootElement(), cancelPedDamage )
  3. function cancelPedDamage ( attacker ) local team1 = getElementData(localPlayer, "gang") local team2 = getElementData(attacker , "gang") if team1 and team2 then if team1 == team2 then cancelEvent() end end end addEventHandler ( "onClientplayerDamage", getRootElement(), cancelPedDamage ) tal ves esto te sirva para que no se dañen los del mismo gang, en cuanto a lo de crear una gang con un comando debes mostrar que sistema de gang usas.
  4. es verdad copia lo que te paso @Sasu que ya esta corregido
  5. tal vez esto sirva no estoy muy seguro , tendrás que probarlo signos = {"$", "%", "!", "#"} function register() ------- ------- ------- for _, text in ipairs(signos) do if string.find(username, text) then return outputChatBox("No esta permitido este signo ( " ..text " )" ) end end end
  6. tal ves te sirva esta forma para que no estés haciendo botón por botón botones = { [1] = {posx = 0, posy = 0, width = 100, height = 100, r= 0, g = 0, b = 0, r2 = 100, g2 = 0, b2 = 0, title = "rifles", tr = 255, tg = 255, tb = 255, tr2 = 0, tg2 = 0, tb2 = 0}, [2] = {posx = 0, posy = 0, width = 100, height = 100, r= 0, g = 0, b = 0, r2 = 100, g2 = 0, b2 = 0, title = "click", tr = 255, tg = 255, tb = 255, tr2 = 0, tg2 = 0, tb2 = 0} } function menuRifles() for _, boton in ipairs(botones) do if isCursorOnElement(boton.posx, boton.posy, boton.width, boton.height) then dxDrawRectangle(boton.posx, boton.posy, boton.width, boton.height, tocolor(boton.r, boton.g, boton.b), false) dxDrawText (boton.tile, boton.posx, boton.posy, boton.posx + boton.width, boton.posy + boton.height, tocolor(boton.tr, boton.tg, boton.tb) , 1, "default-bold") else dxDrawRectangle(boton.posx, boton.posy, boton.width, boton.height, tocolor(boton.r2, boton.g2, boton.b2), false) dxDrawText (boton.tile, boton.posx, boton.posy, boton.posx + boton.width, boton.posy + boton.height, tocolor(boton.tr2, boton.tg2, boton.tb2) , 1, "default-bold") end end end function onBotonClick(button, state, px, py) if (button == "left" and state == "down") then for _, boton in ipairs(botones) do if isCursorOnElement(boton.posx, boton.posy, boton.width, boton.height) then ----- ----- ----- return end end end end function isCursorOnElement(x,y,w,h) local mx,my = getCursorPosition () local fullx,fully = guiGetScreenSize() cursorx,cursory = mx*fullx,my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end
  7. reemplaza esta parte function entrar ( element ) if getElementType ( element ) == "player" then table.insert ( tabla, element ) if #tabla == 2 then for i = 1, 2 do local data = posiciones[i] local x, y, z, rot = data.posx, data.posy, data.posz, data.rot setElementPosition ( tabla[i], x, y, z ) setElementRotation ( tabla[i], 0, rot, 0 ) table.remove ( tabla, i ) end else outputChatBox ( "¡Necesitas otro jugador!", element, 255, 0, 0 ) end end end addEventHandler ( "onMarkerHit", root, entrar )
  8. me equivoque en algo prueba con esto Cplayer = {} Posiciones = { {posx = 0, posy = 0, posz = 0, rot = 0}, {posx = 0, posy = 0, posz = 0, rot = 0} } function markerJoin(element) if getElementType( element ) == "player" then table.insert(Cplayer, element) if #Cplayer >= 2 then for k, player in ipairs(Cplayer) do local data = Posiciones[k] local x, y, z, rot = data.posx, data.posy, data.posz, data.rot setElementPosition( player, x, y, z) setElementRotation( player, 0, rot, 0) tabel.remove(Cplayer, k) end end end end addEventHandler("onMarkerHit", root, markerJoin) function markerleave(element) if getElementType( element ) == "player" then for k, player in ipairs(Cplayer) do if player == element then tabel.remove(Cplayer, k) end end end end addEventHandler("onMarkerLeave", root, markerleave)
  9. Esto debería de funcionar. Cplayer = {} Posiciones = { {posx = 0, posy = 0, posz = 0, rot = 0}, {posx = 0, posy = 0, posz = 0, rot = 0} } function markerJoin(element) if getElementType( element ) == "player" then table.insert(Cplayer, element) if #Cplayer >= 2 then for k, player in ipairs(Cplayer) local data = Posiciones[k] local x, y, z, rot = data.posx, data.posy, data.posz, data.rot setElementPosition( player, x, y, z) setElementRotation( player, 0, rot, 0) tabel.remove(Cplayer, k) end end end end addEventHandler("onMarkerHit", root, markerJoin) function markerleave(element) if getElementType( element ) == "player" then for k, player in ipairs(Cplayer) if player == element then tabel.remove(Cplayer, k) end end end end addEventHandler("onMarkerLeave", root, markerleave)
  10. quieres que lo manden a distintas posiciones , pero a cada jugador mandarlo en especifico a una posición o a cualquiera de los 2 jugadores mandarlo a X posición y al otro a la otra posición ???
  11. algo así talvez te sirva Cplayer = {} function markerJoin(element) if getElementType( element ) == "player" then table.insert(Cplayer, element) if #Cplayer >= 2 then for k, player in ipairs(Cplayer) setElementPosition( player, ....) table.remove(Cplayer, k) end end end end addEventHandler("onMarkerHit", root, markerJoin) function markerleave(element) if getElementType( element ) == "player" then for k, player in ipairs(Cplayer) if player == element then table.remove(Cplayer, k) end end end end addEventHandler("onMarkerLeave", root, markerleave)
  12. function click () local playerName = guiGridListGetItemText ( playerList, guiGridListGetSelectedItem ( playerList ), 1 ) local player = getPlayerFromName(playerName) local dinero = tonumber(guiGetText(editbox)) triggerEvent ( "onSpecialEvent", getRootElement(), player, dinero ) end --- server --- addEvent ( "onSpecialEvent", true ) function givemoney ( thePlayer, amount) givePlayerMoney ( thePlayer, amount ) takePlayerMoney(client, ammount) end addEventHandler ( "onSpecialEvent", getRootElement(), givemoney )
  13. alex17

    [Fuego]

    Utiliza esto /fireme nombredeljugador rason addCommandHandler("fireme", function (thePlayer, _, name, rason) if not name then return end local player = findPlayerByName (name) local onFire = setTimer(setPedOnFire, 3000, 4, player, true) outputChatBox("* ".. getPlayerName(player) .." #0080FFesta en #FF8000fuego#0080FF! rason ("..rason..")",getRootElement(),255,255,255,true) end) function findPlayerByName (name) local player = getPlayerFromName(name) if player then return player end for i, player in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(player):lower(),"#%x%x%x%x%x%x", ""), name:lower(), 1, true) then return player end end return false end
×
×
  • Create New...