-
Posts
1,056 -
Joined
-
Last visited
Everything posted by Sasu
-
Oh I was thinking that colshape is only client. Thank you very much.
-
So post the script where is the event "onClientGUIClick"
-
I'm using the command /showcol so yes and Its type client.
-
u.u Edit: TAPL outputChatBox dont have element to visible to.
-
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?
-
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.
-
Now, I created a variable. local vehicle = getPedOccupiedVehicle(localPlayer) And works perfectly.
-
Nothing . Its happen when I spawn a vehicle with admin panel "P". EDIT: I solved.
-
Also, the event is wrong because when a player join He is in guest account.
-
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)
-
Maybe you can use: guiGridListSetItemData guiGridListGetItemData
-
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?
-
It's works correctly now. Thank you very much.
-
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?
-
MySQL and SQLite are different. So be careful.
-
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] ?
-
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)
-
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 ]
-
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.
-
De nada :3
-
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?
-
Sorry. I forgot include the meta. Thank you.
