Jump to content

Sticmy

Members
  • Posts

    254
  • Joined

  • Last visited

Everything posted by Sticmy

  1. En realidad ese bug creo que es dafult le pasa a cual quiera, ami también en mi sv local pasaba eso creo que es por los skins o el bajos de fps que tienen ellos.
  2. Yo no soy de cobrar cosas, te puedo ayudar a mi me gusta ayudar así puedo mejorar más mi experiencia en MTA!
  3. Buen aporte, pero el vídeo es muy rápido casi nadie sabrá que pusiste.
  4. El getPedControlState estás los controles donde puedes controlar el ped, osea caminar, correr, saltar, disparar, y más cosas acá te dejo todo los controles.. https://wiki.multitheftauto.com/wiki/Control_names
  5. Cambie un poco de las funciones quizás te sirva para todo tus paneles.. Client: addEventHandler("onClientResourceStart", resourceRoot, function () ventana = guiCreateWindow(147, 212, 534, 273, "Selector de Teams | Street Gang", false) guiWindowSetSizable(ventana, false) botonlossantos = guiCreateButton(19, 58, 164, 45, "Los Santos Crew", false, ventana) guiSetFont(botonlossantos, "default-bold-small") guiSetProperty(botonlossantos, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", botonlossantos, entrarTeam, false) botonballas = guiCreateButton(354, 58, 164, 45, "Ballas Street", false, ventana) guiSetFont(botonballas, "default-bold-small") guiSetProperty(botonballas, "NormalTextColour", "FFAAAAAA") botonvagos = guiCreateButton(190, 113, 164, 45, "The Vagos Blood", false, ventana) guiSetFont(botonvagos, "default-bold-small") guiSetProperty(botonvagos, "NormalTextColour", "FFAAAAAA") botonaztecas = guiCreateButton(354, 168, 164, 45, "Aztecas Family", false, ventana) guiSetFont(botonaztecas, "default-bold-small") guiSetProperty(botonaztecas, "NormalTextColour", "FFAAAAAA") botongrove = guiCreateButton(19, 168, 164, 45, "Groove Danger ", false, ventana) guiSetFont(botongrove, "default-bold-small") guiSetProperty(botongrove, "NormalTextColour", "FFAAAAAA") labeeel = guiCreateLabel(158, 223, 218, 15, "Selecciona El Team Que mas Te guste.", false, ventana) guiSetFont(labeeel, "default-bold-small") guiLabelSetColor(labeeel, 8, 114, 246) showCursor(true) end ) addEventHandler("onClientGUIClick", resourceRoot, function() if source == botonlossantos then triggerServerEvent("ganster",localPlayer) guiSetVisible(ventana, false) showCursor(false) --elseif source == botonballas then puedes poner los demás botones con el elseif source == variable then no es necedidad de crear muchos eventos con el onClientGUIClick. end end ) Server: gansta = createTeam ("Los Santos Crew", 6, 183, 248) addEventHandler("gangster", true) addEventHandler("gangster", root, function() setPlayerTeam (source, getTeamFromName("Los Santos Crew")) outputChatBox("Bienvenido, Ahora perteneces Al gang (Los Santos Crew).",source,0,255,0) end )
  6. Puedes hacer uno para mi lo haría, con estás funciones.. getPedControlState createPed onClientPedDamage
  7. También puedes poner esa función en una parte del login cuando aparece.. acá te dejo un pequeño ejempleo del playSound quizás te sirva en otra ocasiones.. addEventHandler("onClientPlayerJoin", root, function() local sound = playSound("http://youtubeinmp3.com/fetch/?video%3Dhttp://www.youtube.com/watch?v%3D57UZVVvtX-M", true) --Play wasted.mp3 from the sounds folder default: playSound("folder/music.mp3") setSoundVolume(sound, 0.5) -- set the sound volume to 50% outputChatBox("el jugador (".. getPlayerName(source)..") entro al juego.", source, 0, 255, 0, true) end ) Tú código ya lo adapte. local screenWidth, screenHeight = guiGetScreenSize() local page = "http://mta/local/index.html" local initBrowser = guiCreateBrowser(0, 0, screenWidth, screenHeight, true, true, false) local theBrowser = guiGetBrowser(initBrowser) addEventHandler("onClientBrowserCreated", theBrowser, function() loadBrowserURL(source, page) showCursor(true) guiSetInputEnabled(true) local sound = playSound("http://youtubeinmp3.com/fetch/?video%3Dhttp://www.youtube.com/watch?v%3D57UZVVvtX-M", true) --Play wasted.mp3 from the sounds folder default: playSound("folder/music.mp3") setSoundVolume(sound, 0.5) -- set the sound volume to 50% addNotification("Porfavor Crea una cuenta o logeate!", "info") end ) function belepesfunkc(UsernameValue, PasswordValue) username = tostring(UsernameValue) password = tostring(PasswordValue) UsernameValue = nil PasswordValue = nil if (string.len(username)<4) then addNotification("Username should be at least 4 characters long.", "warning") elseif (string.len(username)>35) then addNotification("Username not be longer than 35 characters.", "warning") elseif (string.len(password)<4) then addNotification("Password should be at least 4 characters long.", "warning") elseif (string.len(password)>35) then addNotification("Password not be longer than 35 characters.", "warning") else triggerServerEvent("attemptLogin", getRootElement(), getLocalPlayer(), username, password) end end addEvent("belepesfunkc", true) addEventHandler("belepesfunkc", root, belepesfunkc) function belepesfunkct() destroyElement(initBrowser) destroyElement(zene) guiSetInputEnabled(false) showCursor(false) end addEvent("belepesfunkctsiker", true) addEventHandler("belepesfunkctsiker", getLocalPlayer(), belepesfunkct) function belepesfunkctsikerregisztraciohandler() executeBrowserJavascript ( theBrowser, "gotologinfromregister()" ) end addEvent("belepesfunkctsikerregisztracio", true) addEventHandler("belepesfunkctsikerregisztracio", getLocalPlayer(), belepesfunkctsikerregisztraciohandler) function belepesfunkcregisztral(UsernameValue, PasswordValue, PasswordConfirmValue) username = tostring(UsernameValue) password = tostring(PasswordValue) passwordC = tostring(PasswordConfirmValue) UsernameValue = nil PasswordValue = nil PasswordConfirmValue = nil if (string.len(username)<4) then addNotification("El nombre de usuario debe tener al menos 4 caracteres.", "warning") elseif (string.len(username)>35) then addNotification("El nombre de usuario no debe tener más de 35 caracteres.", "warning") elseif (string.len(password)<4) then addNotification("La contraseña debe tener al menos 4 caracteres.", "warning") elseif (string.len(password)>35) then addNotification("La contraseña no debe tener más de 35 caracteres.", "warning") elseif (password ~= passwordC) then addNotification("Las contraseñas no coinciden.", "error") else triggerServerEvent("attemptRegister", getRootElement(), getLocalPlayer(), username, password) end end addEvent("belepesfunkcregisztral", true) addEventHandler("belepesfunkcregisztral", root, belepesfunkcregisztral) local displayWidth, displayHeight = guiGetScreenSize(); local notificationData = {}; local notificationFont = dxCreateFont('files/fonts/roboto.ttf', 12 * 2, false); local iconsFont = dxCreateFont('files/fonts/icons.ttf', 12 * 2, false); addEventHandler('onClientRender', root, function() for k, v in pairs(notificationData) do if (v.State == 'fadeIn') then local alphaProgress = (getTickCount() - v.AlphaTick) / 650; local alphaAnimation = interpolateBetween(0, 0, 0, 255, 0, 0, alphaProgress, 'Linear'); if (alphaAnimation) then v.Alpha = alphaAnimation; else v.Alpha = 255; end if (alphaProgress > 1) then v.Tick = getTickCount(); v.State = 'openTile'; end elseif (v.State == 'fadeOut') then local alphaProgress = (getTickCount() - v.AlphaTick) / 650; local alphaAnimation = interpolateBetween(255, 0, 0, 0, 0, 0, alphaProgress, 'Linear'); if (alphaAnimation) then v.Alpha = alphaAnimation; else v.Alpha = 0; end if (alphaProgress > 1) then notificationData = {}; end elseif (v.State == 'openTile') then local tileProgress = (getTickCount() - v.Tick) / 350; local tilePosition = interpolateBetween(v.StartX, 0, 0, v.EndX, 0, 0, tileProgress, 'Linear'); local tileWidth = interpolateBetween(0, 0, 0, v.Width, 0, 0, tileProgress, 'Linear'); if (tilePosition and tileWidth) then v.CurrentX = tilePosition; v.CurrentWidth = tileWidth; else v.CurrentX = v.EndX; v.CurrentWidth = v.Width; end if (tileProgress > 1) then v.State = 'fixTile'; setTimer(function() v.Tick = getTickCount(); v.State = 'closeTile'; end, string.len(v.Text) * 45 + 5000, 1); end elseif (v.State == 'closeTile') then local tileProgress = (getTickCount() - v.Tick) / 350; local tilePosition = interpolateBetween(v.EndX, 0, 0, v.StartX, 0, 0, tileProgress, 'Linear'); local tileWidth = interpolateBetween(v.Width, 0, 0, 0, 0, 0, tileProgress, 'Linear'); if (tilePosition and tileWidth) then v.CurrentX = tilePosition; v.CurrentWidth = tileWidth; else v.CurrentX = v.StartX; v.CurrentWidth = 0; end if (tileProgress > 1) then v.AlphaTick = getTickCount(); v.State = 'fadeOut'; end elseif (v.State == 'fixTile') then v.Alpha = 255; v.CurrentX = v.EndX; v.CurrentWidth = v.Width; end roundedRectangle(v.CurrentX, 20, 25 + v.CurrentWidth, 25, tocolor(0, 0, 0, 150 * v.Alpha / 255), _, true); dxDrawRectangle(v.CurrentX, 20, 25, 25, tocolor(0, 0, 0, 255 * v.Alpha / 255), true); if (v.Alpha == 255) then dxDrawText(v.Text, v.CurrentX + 25 + 10, 20, v.CurrentX + 25 + 10 + v.CurrentWidth - 20, 20 + 25, tocolor(255, 255, 255, 255), 0.40, notificationFont, 'center', 'center', true, false, true); end if (v.Type == 'error') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(215, 90, 90, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'warning') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(220, 180, 80, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'info') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(85, 180, 245, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'success') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(80, 205, 105, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); end end end ) addEvent('addNotification', true); function addNotification(text, type) if (text and type) then if (notificationData ~= nil) then table.remove(notificationData, #notificationData); end table.insert(notificationData, { StartX = (displayWidth / 2) - (25 / 2), EndX = (displayWidth / 2) - ((dxGetTextWidth(text, 0.40, notificationFont) + 20 + 25) / 2), Text = text, Width = dxGetTextWidth(text, 0.40, notificationFont) + 20, Alpha = 0, State = 'fadeIn', Tick = 0, AlphaTick = getTickCount(), CurrentX = (displayWidth / 2) - (25 / 2), CurrentWidth = 0, Type = type or 'info' } ); playSoundFrontEnd(11); end end addEventHandler('addNotification', root, addNotification); function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI) if (x and y and w and h) then if (not borderColor) then borderColor = tocolor(0, 0, 0, 200); end if (not bgColor) then bgColor = borderColor; end --> Background dxDrawRectangle(x, y, w, h, bgColor, postGUI); --> Border dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI); -- top dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI); -- bottom dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI); -- left dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI); -- right end end
  8. Lo que dice tomas es cierto, no hay de que disculparse todos nos apoyamos jeje
  9. Sí me funciono perfecto mira. En mi servidor Roleplay estoy que hago cosas con mysql y me funciona perfecto man. http://imgur.com/CuuP8NS
  10. Te recomiendo usar mysql, yo use estás funciones: executeSQLUpdate, executeSQLQuery, executeSQLInsert
  11. Hola hay alguna manera de mandar un setElementData(source, "Bebidas", "Si") que un strings se guarde en getElementData, al reconectar no se guarda el strings "Si". Me entienden?
  12. Hola man yo ando creando un RP, sobre el host quizás necesite ayuda pero en los scripts no se preocupe que yo lo ando creando PD: Si quieres ver lo que ya hice te dejaré mi facebook y te enviaré fotos: https://www.facebook.com/luillysteven
  13. Sticmy

    Pregunta...

    Hola quisiera saber como puedo conectarme ala internal.db Estoy que hago un panel para ver todas las cuentas pero no funciona un ejemplo para conectarme? si es executeSQLQuery o dbQuery.. También quisiera saber como puedo ver todo los elementsData desde un comando uu gracias?
  14. Sticmy

    Ayuda D:

    Es que realmente cuando compran un vehículo, les aparece todo pero cuando reconnectan ya no y me sale ese error D:
  15. Sticmy

    Ayuda D:

    Entonces no debo usar las funciones executeSQLInsert?
  16. Sticmy

    Ayuda D:

    Hola quisiera saber porque me causa este error D: Imagen:http://subefotos.com/ver/?f7951b2b2ec8a71ab3991c5570b6ee06o.png Codígo: function Insertar (source, ide, cost, x, y, z, r, r1, g1, b1, r2, g2, b2) local account = getPlayerAccount(source) local id = math.random (0,999999999) local check = executeSQLQuery("SELECT * FROM Vehiculos where Numero = '" .. id .. "'") if not ( type( check ) == "table" and #check == 0 ) or not check then InsertarData (source, ide, cost, x, y, z, r, r1, g1, b1, r2, g2, b2) else executeSQLInsert ( "Vehiculos", "'0','"..id.."','"..getAccountName(account).."','"..ide.."','"..cost.."','0','1000','"..x.."','"..y.."','"..z.."','"..r.."','"..r1.."','"..g1.."','"..b1.."','"..r2.."','"..g2.."','"..b2.."','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'" ) setElementID (getElementData(source, "hisCar"), tostring(id)) triggerClientEvent (source, "onBuyGuiSetText", source, getVehicleNameFromModel(ide), tostring(id)) end end
  17. Sticmy

    Ayuda pls

    Me podrías ayudar porfavor tienes fb o desde PM D:
  18. Sticmy

    Ayuda pls

    Hola amigos estoy la función getElementSpeed estoy haciendo un script de porcentaje cuando un jugador corre, pero lo que pasa es que cuando camina y trota el porcentaje sigue bajando en vez que suba D: ayudenme no pongo el código porque la mayoria ahora roban códigos uu
  19. Sticmy

    Me ayudan

    Hola quiero que me ayuden en algo estuve hace una tabla que cuando un jugador tome un vehículo y le salga cual quier texto por ejemplo en la tabla que hice puse estó. texto = {"Text", "Text2", "Text3"} function drawve() local screenW, screenH = guiGetScreenSize() dxDrawText("Carga Actual: "..texto[math.random(1, #texto)].."", (screenW * 0.3050) - 1, (screenH * 0.7844) - 1, (screenW * 0.6913) - 1, (screenH * 0.8900) - 1, tocolor(255, 255, 0, 255), 1.50, "default-bold", "center", "center", false, false, false, false, false) end Todo esta bien solo que cuando aparece se cambia rápidamente los nombres que puse en la tabla. y lo que quiero hacer es que aparezca 1 pero con cual quier texto que salga uu
  20. Ya gracias a todos, la función funciono exacto!
  21. Explicaré de nuevo D: Mira por ejemplo en la gridlist están todos los jugadores del server utilizo getElementsByType cierto? La otra es que cuando YO presiono el botón 'Mandar Dimensiones. (Todos' Como sale en la imagen... Que todos los que están en la gridlist, los mande ala dimensión 10. Ahora si me entendieron? D:
  22. La primera función ya la hice, la segunda no quiero selecciona un solo jugador, sino todos?
×
×
  • Create New...