Jump to content

castaño

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by castaño

  1. castaño

    Comando

    muchas gracias eso soluciono el problema, pero tengo una ultima duda si tengo mas argumentos por ejemplo / giveallmoney 100 500, en la función es donde se agregan mas parámetros? osea amount seria para 100 y declaria otra para recibir los 500, como para quedar asi: function moneyAllPlayer ( source, command, amount, amount2 ) disculpa por la pregunta pero no estoy relacionado mucho con la programación en lua si no en Java.
  2. castaño

    Comando

    hola nesito saber como pasar un argumento de un comando a una función, tengo el siguiente cpdigo: function moneyAllPlayer(source, amount) local account = getAccountName(getPlayerAccount(source)) local playerName = getPlayerName(source) local players = getElementsByType("player") if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then for k, v in ipairs(players) do givePlayerMoney(v, amount) outputChatBox("#00ff00[iNFO: ] #ffff00Admin#00ff00 ["..playerName.."] #ffff00 Has give to all players #00ff00["..amount.."]", getRootElement(), 255, 0, 0, true) end else outputChatBox("#00ff00[iNFO] #ffff00You aren't admin", source, 255, 0, 0, true) end end addCommandHandler("giveallmoney", moneyAllPlayer, amount) loque sucede aca es el monto de dinero que quiero dar no me lo recibe en la función por ejemplo hago esto: /giveallmoney 100 , pero los 100 no pasan a la función, me sale que la variable amount es nula.
  3. ya solucione el problema gracias por participar
  4. castaño

    imagen

    A eso le agregaría un while para que parpadee hasta que se cumpla una condición. hmm entonces como implementaría el while?
  5. castaño

    binkey

    es server, he mirado que getLocalPlayer solo es para client, pero entonces que puedo usar para sacar el health del player?
  6. castaño

    binkey

    hola nesito ayuda con el siguiente código if getElementHealth( getLocalPlayer()) > 90 then bindKey(getLocalPlayer(), "F3", "down", selectTeamKey) end lo que pasa es que quieo que cuando un jugador con health mayor a 90 pueda presionar la tecla f3 y seleccionar de nuevo equipo, pero coloco esta parte de código y me bloquea el select team, pero yo solo quiero que lo bloquee para los players que tienen menos de 90 de health,
  7. necito bloquear el chat para crear un tag en el admin pero el código que tengo no me funciona, este código: if (msgtype == 0) and isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then cancelEvent(true) outputChatBox("#ff0000*[Admin] "..RGBToHex(getTeamColor(team))..name..": "..textcolor..text, getRootElement(), 255,255,255, true) outputServerLog(name .. ": " .. text) end no me sale error, lo pruebo con msgType == 2 y si me funciona, me bloque el chat entre teams pero para msgType == 0 no me bloque el chat , sale el tag de admin pero también sale el chat por aparte.
  8. castaño

    imagen

    nesito saber como darle animaciones a una imagen por jemplo tengo este código: function pjetEventHandler(text) local x, y, w, h = 0.2, 0.4, 0.6, 0.8 local blood = guiCreateStaticImage(x, y, w, h, "images/ludicrouskill.png", true) guiSetVisible(blood, true) setTimer(guiSetVisible, 9000, 1, blood, false) local sound = playSound("sounds/ludicrouskill.mp3") setSoundVolume(sound, 2) end y nesito que cuando la imagen salga salga como titilando o parpadeando como
  9. trato de hacer una función parecido a este ejemplo tomado de la wiki : function showLocalHealth() -- get the player's health and output it local playerHealth = getElementHealth ( getLocalPlayer() ) outputChatBox ( "Your health: " .. playerHealth ) -- get the player's vehicle: if he is in one, output its health as well local playerVehicle = getPedOccupiedVehicle ( getLocalPlayer() ) if playerVehicle then local vehicleHealth = getElementHealth ( playerVehicle ) outputChatBox ( "Your vehicle's health: " .. vehicleHealth ) end end addCommandHandler ( "showhealth", showLocalHealth ) pero resulta que esta malo y no se porque (este es código que aparece en la wiki)
  10. castaño

    sintasis

    ya me di cuenta del error
  11. castaño

    sintasis

    hola quisiera que me ayudaran a achar un vistaso a este función: function showProgress(objectiveId, bool, progress, total, stayText) if progressBar == nil then progressBar = {} end if progressBarText == nil then progressBarText = {} end if progressBar[objectiveId] == nil and bool == true then local x, y = guiGetScreenSize() x = x / 2 - 100 y = y * 0.6 progressBar[objectiveId] = guiCreateProgressBar(x, y, 200, 20, false) progressBarText[objectiveId] = guiCreateLabel(x, y - 30, 100, 25, stayText, false) guiSetSize(progressBarText[objectiveId], guiLabelGetTextExtent(progressBarText[objectiveId]), guiLabelGetFontHeight(progressBarText[objectiveId]), false) guiLabelSetColor(progressBarText[objectiveId], 255, 255, 255, 255) end if progressBar[objectiveId] == nil then return end guiSetVisible(progressBar[objectiveId], bool) guiSetVisible(progressBarText[objectiveId], bool) if progress ~= nil and total ~= nil then local p = math.ceil(progress / total * 100) guiProgressBarSetProgress(progressBar[objectiveId], p) guiSetText(progressBarText[objectiveId], "%s %d%%":format(stayText, p)) guiSetSize(progressBarText[objectiveId], guiLabelGetTextExtent(progressBarText[objectiveId]), guiLabelGetFontHeight(progressBarText[objectiveId]), false) end end el problema es que me sale un error en la sintasis pero no lo he poidido encontrar
  12. but you can say what program i can use for decompiled this type of file?
  13. exactly but there are some program for this type of file?
  14. castaño

    IDE for MTA

    I have some programs as "notepad++ and luaedit" , but I try open some scripts with extension .lua, but in the file there are illegible letters as "nul nul nul nul and others more", I want know if exist some type of program apart of notepad++ for I can make gamemode o scripts.[C:\Users\Duvan\Desktop\gg.png/img]
×
×
  • Create New...