Jump to content

Sasu

MTA Contributors
  • Posts

    1,056
  • Joined

  • Last visited

Everything posted by Sasu

  1. Sasu

    colshape

    Oh I was thinking that colshape is only client. Thank you very much.
  2. Sasu

    What's wrong ?

    So post the script where is the event "onClientGUIClick"
  3. Sasu

    colshape

    I'm using the command /showcol so yes and Its type client.
  4. Sasu

    colshape

    u.u Edit: TAPL outputChatBox dont have element to visible to.
  5. Sasu

    colshape

    local colshape = createColCuboid( 1107.72, -2080.25, 0, 194, 100, 100) function projectiles(hitElement) if source == colshape then local data = getElementData(hitElement, "Basejuli") if getElementType(hitElement) == "player" and data == "Aceptado" then outputChatBox("Bienvenido a la base", 0, 255, 0) elseif data == "Rechazado" or nil then outputChatBox("Intruso detectado. Lanzando projectiles...", 255, 0, 0) end end end addEventHandler("onColShapeHit", root, projectiles) Why this dont work and no error on debug?
  6. Sasu

    What's wrong ?

    Try: local serverContainer = {} serverContainer.Settings = {} -- settings serverContainer.Settings.user = 'zahrej' serverContainer.Settings.pass = " Can't tell you it :* " serverContainer.Settings.host = 'mysql.mmhost.eu:3306' serverContainer.Settings.name = 'zahrej' serverContainer.startResource = function() local connection = dbConnect('mysql', 'dbname='..serverContainer.Settings.name..';host='..serverContainer.Settings.host, serverContainer.Settings.user, serverContainer.Settings.pass) if connection then outputDebugString('[MYBB-CONNECTER]: Could connect to the mysql server') serverContainer.connection = connection; else outputDebugString('[MYBB-CONNECTER]: Couldn\'t connect to the mysql server') end end addEventHandler('onResourceStart', resourceRoot, serverContainer.startResource) serverContainer.loginClient = function(user, pass) local qh = dbQuery(serverContainer.connection,'SELECT * FROM mtamembers WHERE username = ?',user) local result, row, errmsg = dbPoll ( qh, 5000 ) if row > 0 then for id, result in ipairs(result) do local salt = result['salt'] local username = result['username'] local password = result['password'] if salt and username and password then local newPass = md5(md5(salt):lower()..md5(pass):lower()):lower() if newPass == password then triggerClientEvent(source,'onClientSuccessfullyLogin',source) outputChatBox('#ff6666[sERVER]#ffffff You have successfully login.', source,1,1,1,true) else outputChatBox("#ff6666[sERVER]#ffffff This account doesn't exists or the password is wrong.", source,1,1,1,true) end end end end end addEvent('onClientLogins', true) addEventHandler('onClientLogins', root, serverContainer.loginClient) Edit: Lol. Thanks miki.
  7. Now, I created a variable. local vehicle = getPedOccupiedVehicle(localPlayer) And works perfectly.
  8. Nothing . Its happen when I spawn a vehicle with admin panel "P". EDIT: I solved.
  9. Also, the event is wrong because when a player join He is in guest account.
  10. Sasu

    Need help fast

    function FBIjob(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) and (getTeamName(getPlayerTeam(localPlayer) == 'FBI' )) then if not guiGetVisible(windowjob) then guiSetVisible(windowjob, true) showCursor(true) end else outputChatBox('You Are Not F.B.I', 255, 255, 0) end end addEventHandler("onClientMarkerHit", marker, FBIjob)
  11. Maybe you can use: guiGridListSetItemData guiGridListGetItemData
  12. The script works perfectly but in debugscript appears errors: WARNING: velocidad\panel.lua:23: Bad 'element' pointer @ 'getElementVelocity'(1) ERROR: velocidad\panel.lua:24: attempt to perform arithmetic on local 'speedx' (a boolean value) The script is client side: local x,y = guiGetScreenSize() addEventHandler("onClientResourceStart", resourceRoot, function() velocity = guiCreateLabel(x*0.6984375, y*0.74609375, x*0.23359375, y*0.1276041666666667, "KM/H: 0", false) Font = guiCreateFont( "Pricedown.ttf", 70 ) guiSetFont(velocity, Font) guiSetVisible(velocity, false) end ) function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end function mostrar(vehicle) guiSetVisible(velocity, true) local timer = setTimer(function( vehicle ) if (not getPedOccupiedVehicle(localPlayer) ) then guiSetVisible(velocity, false) return end local speedx, speedy, speedz = getElementVelocity ( vehicle ) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) kmh = actualspeed * 180 guiSetText(velocity, "KM/H: "..math.round(kmh)) end , 50, 0, vehicle) end addEventHandler("onClientPlayerVehicleEnter", root, mostrar) function desaparecer(vehicle) guiSetVisible(velocity, false) if isTimer(timer) then killTimer(timer) end end addEventHandler("onClientPlayerVehicleExit", root, desaparecer) Can you help me?
  13. Sasu

    moveObject

    It's works correctly now. Thank you very much.
  14. Sasu

    moveObject

    Hi guys! Can you help me with my script? local barrera2 = createObject(968, 1288.59998, -2049.1001, 59, 0, 270, 90) function cerrar2() moveObject( barrera2, 1000, 1288.59998, -2049.1001, 59, 0, 270, 90) end addEventHandler("onMarkerLeave", marker1, cerrar2) function abrir2() moveObject( barrera2, 1000, 1288.59998, -2049.1001, 59, 0, 0, 90) end addEventHandler("onMarkerHit", marker1, abrir2) Well, my problem is when a hit the marker the object dont rotate as I want. It rotates to either side. Why?
  15. MySQL and SQLite are different. So be careful.
  16. Sasu

    Ayuda

    Eso debes editarlo tu en freeroam.
  17. Client: function napisSciagnie() local x, y = guiGetScreenSize() dxDrawText ( "ASDASDADADSDASDADDDASDAD", 100,100,400,400, tocolor(255,255,255,255), 2, "default-small", "center","top",false,false,false ) end function startText() addEventHandler("onClientRender", root, napisSciagnie) end addEvent("downloadingFiles", true) addEventHandler("downloadingFiles", root, startText) function stopText() removeEventHandler("onClientRender", root, napisSciagnie) end addEventHandler("onClientResourceStart", resourceRoot, stopText) Server: function startText() triggerClientEvent(source, "downloadingFiles", source) end addEventHandler("onPlayerJoin", root, startText) Is it correct #Pain_[N] ?
  18. Fail. I wrote wrong the event: function napisSciagnie() local x, y = guiGetScreenSize() dxDrawText ( "ASDASDADADSDASDADDDASDAD", 100,100,400,400, tocolor(255,255,255,255), 2, "default-small", "center","top",false,false,false ) end function startText() addEventHandler("onClientRender", root, napisSciagnie) end addEventHandler("onClientResourceStart", root, startText)
  19. function napisSciagnie() local x, y = guiGetScreenSize() dxDrawText ( "ASDASDADADSDASDADDDASDAD", 100,100,400,400, tocolor(255,255,255,255), 2, "default-small", "center","top",false,false,false ) end function startText() addEventHandler("onClientRender",root, napisSciagnie) end addEventHandler("onClienResourceStart",root,startText) And pls use lua tags [ lua ] [ /lua ]
  20. Ese mapa te sale porque el resource "Freeroam" esta activado. Veras que si lo desactivas no aparecera mas. Tendras que buscarlo dentro de ese recurso.
  21. Server: avion = createVehicle(592, -1673, -182, 15) conductor = createPed(1, -1673, -182, 15) function warpearped() setElementRotation(avion, 0, 0, 317.08401489258) warpPedIntoVehicle(conductor, avion) triggerClientEvent("onDriver", resourceRoot, conductor) end addEventHandler("onResourceStart", resourceRoot, warpearped) Client: function ped(conductor) setPedControlState ( conductor, "special_control_down", true ) end addEvent("onDriver", true) addEventHandler("onDriver", resourceRoot, ped) And on debug appears: Server triggered clientside event onDriver, but event is not added clientside Any help?
  22. Sasu

    createProjectile

    Sorry. I forgot include the meta. Thank you.
×
×
  • Create New...