-
Posts
14 -
Joined
-
Last visited
About Siriius
- Birthday 01/05/1997
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Siriius's Achievements

Square (6/54)
0
Reputation
-
Forgive the aggressiveness. Try to add the function to that line
-
I read again my post, and no one asked me to do the script, I just asked for an indication of where I could add the "FadeCamera" There are times that minimal things are overlooked, so if you do not care or bother or just do not want to help I invite you to leave the post no offense.
-
Siriius changed their profile photo
-
Good night, I had problems with a login panel that I am using, the login works correctly, the only inconvenience I have is that I try to add a spawn point and it does not work, the image goes black, then try to do it with the "FadeCamera " But I have not been successful in trying, so could you help me? PD: Sry for my bad english. Server Side: function PlayerLogin(username,password) if username == "" then return triggerClientEvent(source,"login_text",source,"error","Escribe tu nombre de usuario") end if password == "" then return triggerClientEvent(source,"login_text",source,"error","Escribe tu contraseña.") end local account = getAccount ( username, password ) if account == false then return triggerClientEvent(source,"login_text",source,"error","Usuario o Contraseña incorrecta!") end logIn(source, account, password) triggerClientEvent(source,"onLogin",source) triggerClientEvent(source,"saveLoginToXML",source,username) triggerClientEvent(source,"login_text",source,"sucess","Te has logeado con exito.") end addEvent("onRequestLogin",true) addEventHandler("onRequestLogin",getRootElement(),PlayerLogin) function registerPlayer(username,password) if username == "" then return triggerClientEvent(source,"login_text",source,"Error","Escriba su nombre de usuario.") end if password == "" then return triggerClientEvent(source,"login_text",source,"Error","Escriba su contraseña.") end local account = getAccount (username,password) if account then return triggerClientEvent(source,"login_text",source,"Error","Nombre De Usuario o Contraseña incorrecta.") end local accountAdded = addAccount(tostring(username),tostring(password)) if not accountAdded then return triggerClientEvent(source,"login_text",source,"Error","Este usuario esta en uso.") end outputChatBox ("[Usuario: #FFFFFF" .. username .. " #FF0000| Contraseña: #FFFFFF" .. password .. "#00FF00 ]",source,255,255,255,true) triggerClientEvent(source,"onRegister",source) triggerClientEvent(source,"login_text",source,"sucess","Se ha creado la cuenta con exito.") end addEvent("onRequestRegister",true) addEventHandler("onRequestRegister",getRootElement(),registerPlayer) Client Side: sx,sy = guiGetScreenSize() x,y = (sx/1366), (sy/768) messages = {} editBox = {} editBox.__index = editBox editBox.instances = {} function onClientResourceStart() tick = getTickCount() font = dxCreateFont("gfx/sans-pro-regular.ttf", 25) sound = playSound("sfx/NightMare.ogg",true) g = {} g.user = editBox.new() g.user:setPosition(x*610,y*320,x*213,y*41) g.user.color = {79,86,94,160} g.user.font = font g.user.text = loadLoginFromXML() g.user.visible = true g.user.onInput = function() g.user.color = {87, 95, 104, 160} end g.user.onOutput = function() g.user.color = {79,86,94,160} end g.pass = editBox.new() g.pass:setPosition(x*610,y*390,x*213,y*41) g.pass.color = {79,86,94,160} g.pass.font = font g.pass.masked = true g.pass.visible = true g.pass.onInput = function() g.pass.color = {87, 95, 104, 160} end g.pass.onOutput = function() g.pass.color = {79,86,94,160} end g.rUser = editBox.new() g.rUser:setPosition(x*610,y*320,x*213,y*41) g.rUser.color = {79,86,94,160} g.rUser.font = font g.rUser.onInput = function() g.rUser.color = {87, 95, 104, 160} end g.rUser.onOutput = function() g.rUser.color = {79,86,94,160} end g.rPass = editBox.new() g.rPass:setPosition(x*610,y*390,x*213,y*41) g.rPass.color = {79,86,94,160} g.rPass.font = font g.rPass.masked = true g.rPass.onInput = function() g.rPass.color = {87, 95, 104, 160} end g.rPass.onOutput = function() g.rPass.color = {79,86,94,160} end showChat(false) showCursor(true) addEventHandler("onClientRender", root, paint) end addEventHandler("onClientResourceStart",resourceRoot,onClientResourceStart) function paint() local rh,ry = interpolateBetween(0, (y*559/2)+y*105, 0, y*559, y*105, 0, (getTickCount()-tick)/1400, "Linear") dxDrawImage(0,0,sx,sy,"gfx/wallpaper.png") if getTickCount()-tick > 1500 then local bColor = tocolor(25, 20, 15,150) if isMouseInPosition(x*552,y*450,x*262,y*44) then bColor = tocolor(50, 40, 30,150) end dxDrawImage(x*605,y*90,x*199,y*178,"gfx/logo.png",getTickCount()/30,0,0,tocolor(255,255,255,255)) if not inRegisterTab then dxDrawRectangle(x*562,y*320,x*49,y*41,tocolor(40,45,48,160)) dxDrawImage(x*563,y*322,x*45,y*38,"gfx/user.png") dxDrawRectangle(x*562,y*390,x*49,y*41,tocolor(40,45,48,160)) dxDrawImage(x*563,y*392,x*45,y*38,"gfx/pass.png") dxDrawRectangle(x*561,y*450,x*262,y*44,bColor) dxDrawBorder(x*561,y*450,x*262,y*44,tocolor(0,0,0,240),1.4) dxDrawText("Comenzar",x*561,y*450,x*552+x*262,y*450+y*44,tocolor(255,255,255),y*1,font,"center","center") dxDrawText("MTA: Dawn Of The NightMare",x*-400,y*-450,x*552+x*262,y*450+y*44,tocolor(100,90,80),y*1,font,"center","center") dxDrawText([[ ¿No estas registrado? #00ccff¡Registrate!]],x*588,y*420,x*588+x*192,y*592+y*43,tocolor(255,255,255),y*0.6,font,"center","center",false,false,false,true) end for k,self in pairs(editBox.instances) do if self.visible then local px,py,pw,ph = self:getPosition() local text = self.masked and string.gsub(self.text,".","•") or self.text local alignX = dxGetTextWidth(text,self.scale,self.font) <= pw and "left" or "right" dxDrawRectangle(px, py, pw, ph, tocolor(unpack(self.color))) dxDrawText(text,px+x*5, py,px-x*5+pw, py+ph,tocolor(unpack(self.textColor)),self.scale,self.font,alignX,"center",true) if self.input and dxGetTextWidth(text,self.scale,self.font) <= pw then local lx = dxGetTextWidth(text,self.scale,self.font)+px+x*8 local lx = dxGetTextWidth(text,self.scale,self.font)+px+x*8 dxDrawLine(lx, py+y*10, lx, py+ph-y*10, tocolor(255,255,255,math.abs(math.sin(getTickCount()/300))*200), 2) end end end if not inRegisterTab then dxDrawBorder(x*561,y*320,x*262,y*41,tocolor(0,0,0,240),1) dxDrawBorder(x*561,y*390,x*262,y*41,tocolor(0,0,0,240),1) else dxDrawRectangle(x*561,y*320,x*49,y*41,tocolor(40,45,48,160)) dxDrawImage(x*563,y*322,x*45,y*38,"gfx/user.png") dxDrawRectangle(x*561,y*390,x*49,y*41,tocolor(40,45,48,160)) dxDrawImage(x*563,y*392,x*45,y*38,"gfx/pass.png") dxDrawBorder(x*561,y*320,x*262,y*41,tocolor(0,0,0,240),1) dxDrawBorder(x*561,y*390,x*262,y*41,tocolor(0,0,0,240),1) dxDrawRectangle(x*561,y*450,x*262,y*44,bColor) dxDrawBorder(x*561,y*450,x*262,y*44,tocolor(0,0,0,240),1.4) dxDrawText("Registrar",x*561,y*450,x*552+x*262,y*450+y*44,tocolor(255,255,255),y*1,font,"center","center") end end if getKeyState("backspace") then for k,self in pairs(editBox.instances) do if self.visible and self.input then if not keyState then keyState = getTickCount() + 400 self.text = string.sub(self.text,1,string.len(self.text)-1) elseif keyState and keyState < getTickCount() then keyState = getTickCount()+100 self.text = string.sub(self.text,1,string.len(self.text)-1) end return end end keyState = nil end for i, v in pairs(messages) do if v.visible then dxDrawRectangle(sx-dxGetTextWidth(v.text, 1, "default-bold")-10, 35*i, dxGetTextWidth(v.text, 1, "default-bold")+50, 32,v.color) dxDrawBorder(sx-dxGetTextWidth(v.text, 1, "default-bold")-10, 35*i, dxGetTextWidth(v.text, 1, "default-bold")+20, 32,tocolor(255,255,255,200),1.6) dxDrawText(v.text,sx-dxGetTextWidth(v.text,1,"default-bold")-5, 9+35*i, dxGetTextWidth(v.text, 1, "default-bold"), 32, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false ,false, true) end end end function onClientClick(button,state,cX,cY) if not isCursorShowing() then return end if button == "left" and state == "up" then for k,self in pairs(editBox.instances) do if self.visible then if self.input then self.input = nil self.onOutput() end local x,y,w,h = self:getPosition() if isMouseInPosition(x,y,w,h) then self.input = true self.onInput() end end end if not inRegisterTab then if isMouseInPosition(x*552,y*450,x*262,y*44) then triggerServerEvent("onRequestLogin",localPlayer,g.user.text,g.pass.text) elseif isMouseInPosition(x*700,y*520,x*44,y*22) then g.user.visible = false g.pass.visible = false inRegisterTab = true g.rUser.visible = true g.rPass.visible = true end else if isMouseInPosition(x*552,y*450,x*262,y*44) then triggerServerEvent("onRequestRegister",localPlayer,g.rUser.text,g.rPass.text) end end end end addEventHandler("onClientClick", root, onClientClick) function onClientCharacter(character) if not isCursorShowing() then return end for k,self in pairs(editBox.instances) do if self.visible and self.input then if (string.len(self.text)) < self.maxLength then self.text = self.text..character end end end end addEventHandler("onClientCharacter", root, onClientCharacter) function editBox.new() local self = setmetatable({}, editBox) self.text = "" self.maxLength = 20 self.scale = y*0.8 self.state = "normal" self.font = "sans" self.color = {255,255,255,220} self.textColor = {255,255,255,220} table.insert(editBox.instances, self) return self end function editBox:getPosition() return self.x, self.y, self.w, self.h end function editBox:setPosition(x,y,w,h) self.x, self.y, self.w, self.h = x,y,w,h return true end function dxDrawBorder(posX, posY,posW,posH,color,scale) dxDrawLine(posX, posY, posX+posW, posY, color, scale,false) dxDrawLine(posX, posY, posX, posY+posH, color, scale,false) dxDrawLine(posX, posY+posH, posX+posW, posY+posH, color, scale,false) dxDrawLine(posX+posW, posY, posX+posW, posY+posH, color, scale,false) end function isMouseInPosition(x,y,width,height) local cx, cy = getCursorPosition() local cx, cy = (cx*sx), (cy*sy) if (cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then return true else return false end end function onLogin() showChat(true) showCursor(false) stopSound(sound) removeEventHandler("onClientRender", root, paint) removeEventHandler("onClientClick",root,onClientClick) removeEventHandler("onClientCharacter",root,onClientCharacter) end addEvent("onLogin", true) addEventHandler("onLogin", localPlayer, onLogin) function onRegister() g.user.visible = true g.pass.visible = true g.user.text = "" g.pass.text = "" inRegisterTab = false g.rUser.visible = false g.rPass.visible = false g.rUser.text = "" g.rPass.text = "" end addEvent("onRegister", true) addEventHandler("onRegister", localPlayer, onRegister) function loadLoginFromXML() local XML = xmlLoadFile ("userdata.xml") if not XML then XML = xmlCreateFile("userdata.xml", "login") end local usernameNode = xmlFindChild (XML, "username", 0) if usernameNode then return xmlNodeGetValue(usernameNode) else return "" end xmlUnloadFile ( XML ) end function saveLoginToXML(username) local XML = xmlLoadFile ("userdata.xml") if not XML then XML = xmlCreateFile("userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (XML, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(XML, "username") end xmlNodeSetValue (usernameNode, tostring(username)) end xmlSaveFile(XML) xmlUnloadFile (XML) end addEvent("saveLoginToXML", true) addEventHandler("saveLoginToXML", root, saveLoginToXML) function login_text(result, text) if result == "sucess" then addNotification(text,1) elseif result == "error" then addNotification(text,2) end end addEvent("login_text",true) addEventHandler("login_text",root,login_text) function addNotification(text, type) text = string.gsub(text,"#%x%x%x%x%x%x","") local i = 0 if text == "" or text == nil or not type then return else for i = 0, #messages+1 do if messages[i] then i = i+1 else messages[i] = {} messages[i].text = text messages[i].visible = true if type == 1 then messages[i].color = tocolor(0,255,0,160) elseif type == 2 then messages[i].color = tocolor(255,0,0,160) end setTimer(removeNotify,5000,1,i) end end end end function removeNotify(i) messages[i].visible = false messages[i] = nil end function dxDrawBorder(posX, posY,posW,posH,color,scale) dxDrawLine(posX, posY, posX+posW, posY, color, scale,false) dxDrawLine(posX, posY, posX, posY+posH, color, scale,false) dxDrawLine(posX, posY+posH, posX+posW, posY+posH, color, scale,false) dxDrawLine(posX+posW, posY, posX+posW, posY+posH, color, scale,false) end
-
It is if it works, but the sound continues to play even after 22
-
After it finishes, it reproduces again, even though it is more than 22 Probe this way and work for me. I do not know if it would give me a problem in the future. setTimer(function() local h, m = getTime() if ( h == 22 ) then if not yes then sound = playSound("Night.mp3", false ) yes = true end else yes = false end end, 3000, 0)
-
I had previously tried to place it at an exact time but it did not reproduce the music and the message. And no, it does not work
-
Eh attempted to reproduce the sound at a certain time, once the playback is finished, do not play again unless the cycle is restarted (or re-do the indicated time). But the error gives that when finishing the reproduction continues reproducing again and again. Sry for my bad englis function Nightmare() local sound = playSound("Night.mp3",true) local gateTimer = getTime() if (gateTimer >= 22) then outputChatBox( "Esta anocheciendo. . .", 80, 80, 200 ) if (gateTimer < 22) then stopSound ( sound ) end end end setTimer(Nightmare, 73000, 0)
-
function Boss () blip = {23} local localPed = exports [ "slothBot" ]:spawnBot ( 1551, -1315.73, 331, 90, math.random ( 300, 303 ), 0, 0, ex, 9, "hunting", true ) local health = exports.extra_health:setElementExtraHealth ( localPed, 5500 ) setElementModel ( localPed, 38 ) setElementParent (localPed, PigZombie) outputChatBox("#ff0000 El Boss #33ff00PigZombie #ff0000 a aparecido en Los Santos #33ff00RECOMPENSA >[$20,000]< ",getRootElement(),255,0,0,true) setElementData(localPed, "type", "RealBoomer") setPedStat(localPed, 24, 1000) RealBoomer = localPed blip[23] = (createBlipAttachedTo ( localPed, 23 )) triggerClientEvent ( "sound2", root ) end addEventHandler("onResourceStart", resourceRoot, Boss) addEvent("onWitchReady", true) addEventHandler("onPedWasted", getRootElement(), function(ammo, theKiller) if isElement(RealBoomer) then if source == RealBoomer then givePlayerMoney(theKiller,math.random(20000,20000)) local r,g,b = getPlayerNametagColor (theKiller) local chatterName = getPlayerName (theKiller) outputChatBox ( chatterName.." #FF0000 A matado al #33ff00PigZombie #33ff00RECOMPENSA >[$20,000]< *", getRootElement(), r, g, b, true) local x, y, z = getElementPosition(RealBoomer) local PigZombie = getElementParent(RealBoomer) destroyElement(blip[23]) destroyElement(PigZombie) createExplosion ( x, y, z, 5 ) triggerClientEvent ( "estallido", root ) setTimer(Boss, 1200000 , 1) end end end ) No sé si esta bien así, al ser así.... Si destruye la zona pero, prohíbe las armas en todos lados.
-
local PigZombie = createColRectangle ( 1551.4, -1151.8, 288.57, 312.22 ) function zoneEnter ( thePlayer, matchingDimension ) if matchingDimension and isElement(thePlayer) and getElementType(thePlayer) == "player" then triggerClientEvent(thePlayer, "zoneEnter", thePlayer) WeaponID = { [4] = true, [5] = true, [8] = true, [16] = true, [35] = true, [36] = true, [37] = true, [38] = true, [39] = true, [40] = true, } toggleControl ( thePlayer, "fire", false ) end end addEventHandler ( "onColShapeHit", PigZombie, zoneEnter ) function zoneExit ( thePlayer, matchingDimension ) if matchingDimension and isElement(thePlayer) and getElementType(thePlayer) == "player" then triggerClientEvent(thePlayer, "zoneExit", thePlayer) WeaponID = { [4] = false, [5] = false, [8] = false, [16] = false, [35] = false, [36] = false, [37] = false, [38] = false, [39] = false, [40] = false, } toggleControl ( thePlayer, "fire", true ) end end addEventHandler ( "onColShapeLeave", PigZombie,zoneExit ) addEventHandler ( 'onPlayerWeaponSwitch', getRootElement ( ), function ( previousWeaponID, currentWeaponID ) if ( WeaponID [currentWeaponID] ) then toggleControl ( source, 'fire', false ) --disable the fire button outputChatBox( "**#FFFF00Esta arma no esta permitida en esta area.**",source, 255,0,0, true) else toggleControl ( source, 'fire', true ) --enable it end end ) function Boss () blip = {23} local localPed = exports [ "slothBot" ]:spawnBot ( 1643.2351074219, -1043.0762939453, 23.8984375, 90, math.random ( 38, 38 ), 0, 0, ex, 9, "hunting", true ) local health = exports.extra_health:setElementExtraHealth ( localPed, 100 ) setElementModel ( localPed, 38 ) outputChatBox("#ff0000 El Boss #33ff00PigZombie #ff0000 a aparecido en Los Santos #33ff00RECOMPENSA >[$20,000]< ",getRootElement(),255,0,0,true) setElementData(localPed, "type", "RealBoomer") setPedStat(localPed, 24, 1000) RealBoomer = localPed blip[23] = (createBlipAttachedTo ( localPed, 23 )) triggerClientEvent ( "sound2", root ) end addEventHandler("onResourceStart", resourceRoot, Boss) addEvent("onWitchReady", true) addEventHandler("onPedWasted", getRootElement(), function(ammo, theKiller) if isElement(RealBoomer) then if source == RealBoomer then givePlayerMoney(theKiller,math.random(20000,20000)) local r,g,b = getPlayerNametagColor (theKiller) local chatterName = getPlayerName (theKiller) outputChatBox ( chatterName.." #FF0000 A matado al #33ff00PigZombie #33ff00RECOMPENSA >[$20,000]< *", getRootElement(), r, g, b, true) local x, y, z = getElementPosition(RealBoomer) destroyElement(blip[23]) destroyElement(PigZombie) createExplosion ( x, y, z, 1 ) triggerClientEvent ( "estallido", root ) setTimer(Boss, 1800000 , 1) return end end end ) El sistema anti armas en dicho boss funciona perfectamente, pero... no logro que al derrotar dicha ped (al morir) se destruya el elemento "PigZombie" Es decir la zona que prohíbe las armas. Perdón si no especifico mi error en el script.
-
function Boss () blip = {23} local Ghost = exports [ "slothBot" ]:spawnBot ( -2677.095703125, 1830.666015625, 67.467254638672, 90, math.random ( 300, 303 ), 0, 0, ex, 26, "hunting", true ) local vehicle = createVehicle ( 463,-2677.095703125, 1830.666015625, 67.467254638672 ) if vehicle then warpPedIntoVehicle(Ghost, vehicle) local health = exports.extra_health:setElementExtraHealth ( Ghost, 200 ) setElementModel ( Ghost, 61 ) outputChatBox("#ff0000 El Boss #33ff00Ghost Rider #ff0000 Esta esperando por tu alma en el puente de San Fierro... #33ff00RECOMPENSA >[$70,000]< ",getRootElement(),255,0,0,true) setElementData(Ghost, "type", "RealBoomer") setPedStat(Ghost, 24, 1000) RealBoomer = Ghost blip[23] = (createBlipAttachedTo ( Ghost, 23 )) triggerClientEvent ( "Ghost", root ) end end addEventHandler("onResourceStart", resourceRoot, Boss) addEvent("onWitchReady", true) addEventHandler("onPedWasted", getRootElement(), function(ammo, theKiller) if isElement(RealBoomer) then if source == RealBoomer then givePlayerMoney(theKiller,math.random(70000,70000)) local r,g,b = getPlayerNametagColor (theKiller) local chatterName = getPlayerName (theKiller) outputChatBox ( chatterName.." #FF0000 A vencido al #33ff00Ghost Rider pero volvera... #33ff00RECOMPENSA >[$70,000]< *", getRootElement(), r, g, b, true) local x, y, z = getElementPosition(RealBoomer) destroyElement(blip[23]) destroyElement(vehicle) triggerClientEvent ( "DefeatGhost", root ) setTimer(Boss, 1000 , 1) end end end ) Eh usado las funciones setPedControlState, & setPedAnalogControlState, eh logrado montarlo en el vehículo Pero no logro que avance, o por lo menos que dispare sobre el vehículo.
-
addEvent("Invisible1 ",true) addEventHandler("Invisible1 ",root, function Invi () local PlayerMoney = getPlayerMoney( source ) if ( PlayerMoney >=5000) then takePlayerMoney(source, 5000) setPlayerNametagShowing(source, false) setElementAlpha(source, 0) outputChatBox(" has bought invis $5000 !!!", 255, 255, 0, root) setTimer(Invi, 1800000 ) else outputChatBox("You Dont Have Money to buy invis",source) end end) SetTimer (Function, Tiempo.) Puedes leer más sobre SetTimer en https://wiki.multitheftauto.com/wiki/SetTimer
-
Soy nuevo en el foro, e trabajado a base de posts viejos y eh logrado trabajar algunos proyectos. Mi pregunta o duda sería "¿Es posible agregar dicho ped en un vehículo? " Eh intentado con warpedintovehicle y no eh logrado conseguir que dicha ped aparezca juntamente con el vehículo (El ped usa Slothbot ya que el createped no me es... Funcional a mi criterio.) El boss que planeo es el "Ghost Rider" Pero antes de matarme en pensar y pensar decidí consultarlo en el foro. Y si es así ¿que funciones debería usar? (Subiría el archivo pero ahora estoy en cel )