Jump to content

Aruna

Members
  • Posts

    72
  • Joined

  • Last visited

Details

  • Gang
    asdasf

Recent Profile Visitors

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

Aruna's Achievements

Transformer

Transformer (11/54)

1

Reputation

  1. Hola a todos quisiera saber si alguien sabe que string tengo que hacerle para que no me salga ese tal error
  2. Hola he intentado colocar una restriccion por lvl al sistema de shop, es decir Si un usuario quiere comprar tal cosa el shop este personalizado EJ Chaleco requiere ser lvl 5 y tener un cash de $500 Como podria hacerlo? aqui le dejo el lua function BuyWeaponOnServer(skins_name,data,value) player_money = getPlayerMoney(source) if(skins_name == "Skin_Ghillie") then if ( player_money >= 500) then setElementData(source, "Traje de Ghillie Desierto",getElementData(source,"Traje de Ghillie Desierto") + 1) takePlayerMoney(source, 50) outputChatBox("#FF0000[sHOP] #FFFFFFTraje de Ghillie Desierto Articulo Comprado", source, 255, 255, 255 , true) else outputChatBox("#FF0000[sHOP] #FFFFFF Usted no tiene suficiente dinero. [Compra más cash contactandote un Administrador]. ", source, 255, 255, 255 , true) end end if(skins_name == "Skin_Civilian") then if ( player_money >= 50) then setElementData(source, "Traje de Payday",getElementData(source,"Traje de Payday") + 1) takePlayerMoney(source, 50) outputChatBox("#FF0000[sHOP] #FFFFFFTraje de Payday Articulo Comprado", source, 255, 255, 255 , true) else outputChatBox("#FF0000[sHOP] #FFFFFF Usted no tiene suficiente dinero. [Compra más cash contactandote un Administrador]. ", source, 255, 255, 255 , true) end end if(skins_name == "Skin_Camouflage") then if ( player_money >= 50) then setElementData(source, "Traje de Militar",getElementData(source,"Traje de Militar") + 1) takePlayerMoney(source, 50) outputChatBox("#FF0000[sHOP] #FFFFFFTraje de Militar Articulo Comprado", source, 255, 255, 255 , true) else outputChatBox("#FF0000[sHOP] #FFFFFF Usted no tiene suficiente dinero. [Compra más cash contactandote un Administrador]. ", source, 255, 255, 255 , true) end end if(skins_name == "Skin_Survivor") then if ( player_money >= 50) then setElementData(source, "Traje de Ghillie Suit",getElementData(source,"Traje de Ghillie Suit") + 1) takePlayerMoney(source, 50) outputChatBox("#FF0000[sHOP] #FFFFFFTraje de Ghillie Suit Articulo Comprado", source, 255, 255, 255 , true) else outputChatBox("#FF0000[sHOP] #FFFFFF Usted no tiene suficiente dinero. [Compra más cash contactandote un Administrador]. ", source, 255, 255, 255 , true) end end end addEvent("onClientBuySkin", true) addEventHandler("onClientBuySkin", getRootElement(), BuyWeaponOnServer)
  3. Pero funciona bien el script
  4. Hola me podrían ayudar a realizar lo siguiente, con el siguiente Scripts un Administrador puede Advertir a un usuario, pero yo quiero que las Advertencia queden acumuladas osea guardadas, es decir que Si yo Advierto a "X" usuario el usuario tenga 1/3 y en la siguiente advertencia se le sume 2/3 y asi sucesivamente. function getPlayerFromNamePart(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end function warnPlayer_CMD(thePlayer, theCMD, theTarget, ...) local accN = getAccountName ( getPlayerAccount (thePlayer) ) local groupName = "Admin" or "Moderator" or "SuperModerator" or "Console" -- you can add more if groupName then if theTarget ~= nil and isObjectInACLGroup ("user."..accN,aclGetGroup (groupName) ) -- missing bracket then local theTargetElement = getPlayerFromNamePart(theTarget) if(getElementType(theTargetElement) == "player") then local allArgs = {...} local theReason = table.concat(allArgs, " ") outputChatBox("#ff0000[ADVERTENCIA]: "..getPlayerName(thePlayer).."#FFFFFF advertio a "..getPlayerName(theTargetElement).."", getRootElement(), 255, 0, 0, true) outputChatBox("#ff0000[ADVERTENCIA]: #ffffffRazon: #FFFFFF("..tostring(theReason)..")", getRootElement(), 255, 0, 0, true) else outputChatBox("#ff0000[ADVERTENCIA]: #ffffffInvalid target! Syntax: /warn [player] [reason]", thePlayer, 255, 0, 0, true) end end end end addCommandHandler("warn", warnPlayer_CMD, false)
  5. Aruna

    Solucionado

    @Tomas Muchas Gracias
  6. Aruna

    Solucionado

    Alguien me da una mano :c local nivel = exports.exp_system:getPlayerLevel ( thePlayer ) local message = messagePrefix .. colorCodes.colorcode2 .. string.gsub ( ( getPlayerName ( playersource ) .. " : " ), '#%x%x%x%x%x%x', '' ) ..tostring ("[Lvl:"..nivel.."]") .. colorCodes.colorcode3 .. msg --precreate the message string local message = string.sub ( message, 1, outputLimit ) --since the chatbox won't display messages with more than 128 characters we just drop the ones at the end local r, g, b = getColorFromString ( colorCodes.colorcode1 ) outputChatBox ( message, root, r, g, b, true ) playerTickTable[playersource] = getTickCount ( ) end end addCommandHandler ( "Globalchat", playeGlobalChat )
  7. Aruna

    Solucionado

    local nivel = getPlayerLevel (thePlayer) local message = messagePrefix .. colorCodes.colorcode2 .. string.gsub ( ( getPlayerName ( playersource ) .. " : " ), '#%x%x%x%x%x%x', '' ) ..tostring ("[Lvl:"..nivel.."]") .. colorCodes.colorcode3 .. msg --precreate the message string local message = string.sub ( message, 1, outputLimit ) --since the chatbox won't display messages with more than 128 characters we just drop the ones at the end local r, g, b = getColorFromString ( colorCodes.colorcode1 ) outputChatBox ( message, root, r, g, b, true ) playerTickTable[playersource] = getTickCount ( ) end end addCommandHandler ( "Globalchat", playeGlobalChat ) Estaba tratando de conectar el nivel del jugador al mensaje Global cada vez que escribe.
  8. Aruna

    Solucionado

    Hola quiero hacer una variable y me dice lo siguiente attemp to call global 'getPlayerLevel' (a nil value) Este es lo que hice local level = getPlayerLevel
  9. Hola una pregunta he intentado agregar una fila de FPS pero me tira error he buscado por la Wiki de MTA y no he encontrado nada alguien me puede ayudar. EJ la del Ping o Money es facil porque usamos getPlayerMoney y getPlayerPing pero en el FPS no hay nada yA = 0 local screenWidth, screenHeight = guiGetScreenSize() local sw, sh = guiGetScreenSize() scoreboardColumns = { { name = "Nombre", width = 180, data = function (element) return getPlayerName ( element ) end }, { name = "Asesinato", width = 80, data = function (element) return ( getElementData ( element, "murders" ) or 0 ) end }, { name = "Z Asesinados", width = 80, data = function (element) return ( getElementData ( element, "zombieskilled" ) or 0 ) end }, { name = "Supervivencia", width = 80, data = function (element) return formatTimeFromMinutes(getElementData ( element, "alivetime" ) or 1 ) end }, { name = "Clan", width = 100, data = function (element) return getElementData ( element, "gang" ) or "None" end }, { name = "Ping", width = 60, data = function (element) return getPlayerPing ( element, "ping" ) end }, } local serverName = "ScoreBoard Argentina-America " -- название сервера local topsize = 60 -- величина шляпы local playersize = topsize-30 -- высота одной строки local panelsize = playersize*10 -- величина панели function calculateWidth() local width = 0 for key, value in ipairs( scoreboardColumns ) do width = width + value.width end return width + 60 end local max_players = 0 local ploff = 0 local width = calculateWidth() local baseX = sw/2-width/2 local baseY = sh/2-(panelsize+topsize)/2 addEventHandler( "onClientRender", root, function() if getKeyState( "tab" ) == false then ploff = 0; return end if getElementData(getLocalPlayer(),"logedin") then dxDrawRectangle ( baseX, baseY, width, topsize, tocolor(32,32,32) ) dxDrawText ( serverName, baseX+20, baseY+10, baseX+width, baseY+topsize, tocolor(231,119,0), 0.9, "default-bold" ) dxDrawRectangle ( baseX, baseY+topsize, width, panelsize, tocolor(0,0,0,150) ) dxDrawLine ( baseX, baseY+30, baseX+width, baseY+30, tocolor(100,100,100),0.8 ) dxDrawLine ( baseX, baseY+30, baseX, baseY+panelsize+topsize, tocolor(100,100,100),0.8 ) dxDrawLine ( baseX, baseY+panelsize+topsize, baseX+width, baseY+panelsize+topsize, tocolor(100,100,100),0.8 ) dxDrawLine ( baseX+40, baseY+30, baseX+40, baseY+panelsize+topsize, tocolor(100,100,100),0.8 ) dxDrawText ( "№", baseX, baseY+60, baseX+40, baseY+topsize-30, tocolor(0,186,255), 1, "default-bold", "center", "center" ) local xoff = 60 for i, v in ipairs ( scoreboardColumns ) do dxDrawLine ( baseX+xoff+v.width, baseY+30, baseX+xoff+v.width, baseY+panelsize+topsize, tocolor(100,100,100),0.8 ) dxDrawText ( v.name, baseX+xoff, baseY+60, baseX+xoff+v.width, baseY+topsize-30, tocolor(255,255,255), 1, "default-bold", "center", "center" ) xoff = xoff+v.width end local playersTable = getElementsByType ( "player" ) --local playersTable = { localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer } dxDrawText ( "Jugadores: "..tostring(#playersTable), baseX+20, baseY+10, baseX+width-20, baseY+topsize, tocolor(0,186,255), 0.9, "default-bold", "right" ) local maxNum = #playersTable if maxNum > 10 then maxNum = 10 end for i = 1, maxNum do dxDrawLine ( baseX, baseY+topsize+playersize*i, baseX+width, baseY+topsize+playersize*i, tocolor(100,100,100),0.8 ) dxDrawText ( i+ploff, baseX, baseY+topsize+playersize*(i-1), baseX+40, baseY+topsize+playersize*i, tocolor(255,255,255), 1, "default-bold", "center", "center" ) if playersTable[i+ploff] == localPlayer then dxDrawRectangle ( baseX, baseY+topsize+playersize*(i-1), width, playersize, tocolor(112,112,112,100) ) end local xoff = 60 for c, d in ipairs ( scoreboardColumns ) do local data = d.data(playersTable[i+ploff]) local r,g,b = 43,250,86 if d.name == "Clan" and data == "None" then r,g,b = 255,0,0 data = "Sin Clan" end dxDrawText ( data, baseX+xoff, baseY+topsize+playersize*(i-1), baseX+xoff+d.width, baseY+topsize+playersize*i, tocolor(r,g,b), 1, "default-bold", "center", "center" ) xoff = xoff+d.width end end end end )
  10. en donde dice "ID" remplazo la id del vehiculo a eliminar?
  11. Hola Como puedo hacer un script o alguien que lo tenga lo podría compartir. Ej: al ejecutar el script y usar un comando elimine todo los vehiculos de una ID dicha en el script, osea quiero decir que si quiero destruir todos los Rustler del mapa, colocar la id de ese vehiculo en el script y iniciar el comando para destruir todo los rustler del servidor. No se si me explico Gracias
  12. Hola tengo un problema con este script de registro, cuando hago desde el Cliente con un panel no me deja registrarme Ustedes ven alguna falla en el script SERVER? local root = getRootElement() tryToLoginPlayer = function(username, password) local account = getAccount(username, password) if account then local accountName = getAccountName(account) logIn(source, account, password) triggerClientEvent(source, "onPlayerDoneLogin", source, accountName, password) triggerEvent("onPlayerDayZLogin", getRootElement(), username, pass, source) else outputChatBox("[Login]#FF9900 Contraseña o Cuenta Incorrecta", source, 255, 255, 255, true) end end addEvent("onClientSendLoginDataToServer", true) addEventHandler("onClientSendLoginDataToServer", root, tryToLoginPlayer) tryToRegsiterPlayer = function(username, pass) if not getAccount(username) then theAccount = addAccount(username, pass) if theAccount then logIn(source, theAccount, pass) outputChatBox("Registraste la cuenta" .. username .. "' Jugador '" .. getPlayerName(source) .. "'#FFFFFF su contraseña '" .. pass .. "'!", source, 255, 255, 255, true) triggerClientEvent(source, "onPlayerDoneLogin", source, username, pass) triggerEvent("onPlayerDayZRegister", getRootElement(), username, pass, source) else reason = "Error Desconocido, Preciona F8 y usa: (Register !" outputChatBox("[Login]#FF9900 " .. reason, source, 255, 255, 255, true) end else reason = "Ya existe esa cuenta" outputChatBox("[Login]#FF9900 " .. reason, source, 255, 255, 255, true) end end addEvent("onClientSendRegisterDataToServer", true) addEventHandler("onClientSendRegisterDataToServer", getRootElement(), tryToRegsiterPlayer)
  13. Hola quisiera hacer una pregunta como puedo hacer un log de esto osea quiero que se me cree un documento de texto o archivo .xml en la carpeta "logs" y se agregue los siguientes datos function build_loginWin() guiSetInputMode("no_binds_when_editing") showCursor(true) confFile = xmlLoadFile("preferencesL.xml") if (confFile) then infoTable["account"] = xmlNodeGetAttribute(confFile,"username") infoTable["pass"] = xmlNodeGetAttribute(confFile,"pass") else confFile = xmlCreateFile("preferencesL.xml","user") xmlNodeSetAttribute(confFile,"username","") xmlNodeSetAttribute(confFile,"pass","") infoTable["account"] = getPlayerName(localPlayer) infoTable["pass"] = "" end xmlSaveFile(confFile) confFile = xmlLoadFile("preferences.xml") if (confFile) then xmlNodeSetAttribute(confFile,"username","") xmlNodeSetAttribute(confFile,"pass","") end
  14. Hola quisiera hacer una pregunta si es posible realizar lo siguiente. Digamos que un Administrador al realizar un comando ej /duty y al colocar ese comando salga un mensaje en root diciendo Tal administrador esta en servicio. Hasta acá se que es posible, pero al estar en servicio, salir con un blips o punto de color en el Radar. osea Marcando la posicion del Administrador a todo los usuarios. queria saber si eso era posible Muchas Gracias
×
×
  • Create New...