
Artisz
Members-
Posts
69 -
Joined
-
Last visited
Everything posted by Artisz
-
The young tree, what is going to be a big tree
- 7 replies
-
- object put
- front
-
(and 2 more)
Tagged with:
-
Hi! How can I do that create an object front of the player. Where can the player look, front of the player. So not that get the player position, add 3 to the x coordinate, and create there, but also get the player rotation, and create the object so that it's in front of the player(the object is a sapling). And how can I do that the player can't place a sapling next to another sapling, what is already placed? I think it's colshape, but how? I am not good in English, sorry.
- 7 replies
-
- object put
- front
-
(and 2 more)
Tagged with:
-
Hi! How can I do this, that from the inventory I hover an item to a player, then show that player the image? local tipus = getElementType ( hoverElement ) if(tipus == "player") then if(mozgatTargyInfo[1] == 60) then local jelveny = guiCreateStaticImage(50, 50, 295, 388, "kepek/jelveny.png", false) guiSetEnable(jelveny, false) if(hoverElement == getRootElement()) then guiSetVisible(jelveny, true) else guiSetVisible(jelveny, false) end else ... end I try to do like this, but it's not working, the picture visible just for me, how try to show the image. Sorry for my English!
-
Hi! I found this function: onVehicleWeaponFire But is it possible, that I have a fire object(with this resource, what I downloaded from here). And can I retrieves the object elementdata, what I shooted with the firetruck? The custom object ID: 2021
-
Thanks! It's working!
-
It's still bad. There is an addEventHandler too, I think there is the problem. addEventHandler("onClientRender",root, PanelRenderClient) I think it's add all players, who online.
-
I changed like this: triggerServerEvent("vehPanel",localPlayer,clickedElement) Now it's trigger to server side, but now there is a problem. The clickedElement isn't good. Server side: addEvent("vehPanel",true) addEventHandler("vehPanel",root,function(playerSource, clickedElement) local posX, posY, posZ = getElementPosition( clickedElement ) local vehSphere = createColSphere( posX, posY, posZ, 5) if(isElementWithinColShape ( playerSource, vehSphere )) then triggerClientEvent("panelRender",playerSource, clickedElement) end end) For the position I got nil For the ColSphere and for the if i got boolean
-
Hi! What is the problem with this line? When I clicked on the vehicle, show all players the panel. I want to show just one player, who clicked. triggerServerEvent("vehPanel",root,localPlayer,clickedElement)
-
Hi! I want to create a mechanic system. When I clicked the vehicle, it is show me a panel, with the door/panel states, and if it isn't 0, then it is red. When I click the red dxdraw, he repair the element(this part is the problem). I have two problems. The first, if I do this, that the repair is on client side, all players see the repaired element, or they still see broken? The second problem is that I can't retrieves the clicked vehicle at the part, when I repair. I can do it when I check the broken elements, It is correct, but another function I can't do it. I try to save elementdata, but it's save this: userdata: 0000277 And don't repair the clicked element. Here is the code: First, the clicking on vehicle, client side: function jarmuKlikk ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if (getElementType( clickedElement ) == "vehicle") and (button == "right" and state == "up") then triggerServerEvent("SzereloPanel",root,localPlayer,clickedElement) end end addEventHandler ( "onClientClick", root, jarmuKlikk) Then the triggered event on server side: addEvent("SzereloPanel",true) addEventHandler("SzereloPanel",root,function(jatekos, clickedElement) if(getPlayerFaction(jatekos) == 2) then local posX, posY, posZ = getElementPosition( clickedElement ) local jarmuSphere = createColSphere( posX, posY, posZ, 5) if(isElementWithinColShape ( jatekos, jarmuSphere )) then triggerClientEvent("szereloPanelMegjelenit",getRootElement(), clickedElement) end end end) Again client side, this is the last. And here is the problem too, I think addEvent("szereloPanelMegjelenit",true) addEventHandler("szereloPanelMegjelenit",root, function(clickedElement) nev = getVehicleName ( clickedElement ) setElementData(localPlayer, "jarmureklikkelt", clickedElement) panel0 = getVehiclePanelState(clickedElement, 0) or 0 panel1 = getVehiclePanelState(clickedElement, 1) or 0 panel2 = getVehiclePanelState(clickedElement, 2) or 0 panel3 = getVehiclePanelState(clickedElement, 3) or 0 panel4 = getVehiclePanelState(clickedElement, 4) or 0 panel5 = getVehiclePanelState(clickedElement, 5) or 0 panel6 = getVehiclePanelState(clickedElement, 6) or 0 door0 = getVehicleDoorState(clickedElement, 0) door1 = getVehicleDoorState(clickedElement, 1) door2 = getVehicleDoorState(clickedElement, 2) door3 = getVehicleDoorState(clickedElement, 3) door4 = getVehicleDoorState(clickedElement, 4) door5 = getVehicleDoorState(clickedElement, 5) --outputChatBox(tostring(door3)) triggerEvent("PanelRender",localPlayer,clickedElement) addEventHandler("onClientRender", getRootElement(), PanelRender) end) function PanelRender(clickedElement) dxDrawRectangle(screenW * 0.2760, screenH * 0.2253, screenW * 0.4480, screenH * 0.4427, tocolor(0, 0, 0, 200), false) dxDrawRectangle(screenW * 0.2760, screenH * 0.6927, screenW * 0.4480, screenH * 0.0638, tocolor(0, 0, 0, 200), false) dxDrawRectangle(screenW * 0.2760, screenH * 0.2201, screenW * 0.4480, screenH * 0.0052, tocolor(219, 102, 7, 200), false) dxDrawImage(screenW * 0.4898, screenH * 0.1758, screenW * 0.0271, screenH * 0.0482, "kepek/haromszog.png", 0, 0, 0, tocolor(219, 102, 7, 200), false) dxDrawText(tostring(nev), screenW * 0.2760, screenH * 0.1081, screenW * 0.7240, screenH * 0.1693, tocolor(255, 255, 255, 255), 2.10, "default", "center", "center", false, false, false, false, false) dxDrawRectangle(screenW * 0.2796, screenH * 0.6979, screenW * 0.1384, screenH * 0.0534, tocolor(0, 0, 0, 190), false) dxDrawRectangle(screenW * 0.4305, screenH * 0.6979, screenW * 0.1384, screenH * 0.0534, tocolor(0, 0, 0, 190), false) dxDrawRectangle(screenW * 0.5820, screenH * 0.6979, screenW * 0.1384, screenH * 0.0534, tocolor(0, 0, 0, 190), false) dxDrawText("Ajtók", screenW * 0.2796, screenH * 0.6979, screenW * 0.4180, screenH * 0.7513, tocolor(255, 255, 255, 255), 1.70, "default", "center", "center", false, false, false, false, false) dxDrawText("Panelek", screenW * 0.4305, screenH * 0.6979, screenW * 0.5688, screenH * 0.7513, tocolor(255, 255, 255, 255), 1.70, "default", "center", "center", false, false, false, false, false) dxDrawText("Kerekek", screenW * 0.5820, screenH * 0.6979, screenW * 0.7204, screenH * 0.7513, tocolor(255, 255, 255, 255), 1.70, "default", "center", "center", false, false, false, false, false) if(door0 == 0) then dxDrawRectangle(screenW * 0.3023, screenH * 0.2682, screenW * 0.1633, screenH * 0.0638, tocolor(0, 189, 0, 170) ) else dxDrawRectangle(screenW * 0.3023, screenH * 0.2682, screenW * 0.1633, screenH * 0.0638, tocolor(189, 0, 0, 170) ) end if(door1 == 0) then dxDrawRectangle(screenW * 0.3023, screenH * 0.3932, screenW * 0.1633, screenH * 0.0638, tocolor(0, 189, 0, 170) ) else dxDrawRectangle(screenW * 0.3023, screenH * 0.3932, screenW * 0.1633, screenH * 0.0638, tocolor( 189, 0, 0, 170) ) end if(door2 == 0) then dxDrawRectangle(screenW * 0.3023, screenH * 0.5208, screenW * 0.1633, screenH * 0.0638, tocolor(0, 189, 0, 170) ) else dxDrawRectangle(screenW * 0.3023, screenH * 0.5208, screenW * 0.1633, screenH * 0.0638, tocolor(189, 0, 0, 170) ) end if(door3 == 0) then dxDrawRectangle(screenW * 0.5344, screenH * 0.2695, screenW * 0.1633, screenH * 0.0638, tocolor(0, 189, 0, 170) ) else dxDrawRectangle(screenW * 0.5344, screenH * 0.2695, screenW * 0.1633, screenH * 0.0638, tocolor(189, 0, 0, 170) ) end if(door4 == 0) then dxDrawRectangle(screenW * 0.5344, screenH * 0.3932, screenW * 0.1633, screenH * 0.0638, tocolor(0, 189, 0, 170) ) else dxDrawRectangle(screenW * 0.5344, screenH * 0.3932, screenW * 0.1633, screenH * 0.0638, tocolor(189, 0, 0, 170) ) end if(door5 == 0) then dxDrawRectangle(screenW * 0.5344, screenH * 0.5208, screenW * 0.1633, screenH * 0.0638, tocolor(0, 189, 0, 170) ) else dxDrawRectangle(screenW * 0.5344, screenH * 0.5208, screenW * 0.1633, screenH * 0.0638, tocolor(189, 0, 0, 170) ) end dxDrawText("Motorháztető", screenW * 0.3016, screenH * 0.2669, screenW * 0.4656, screenH * 0.3320, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Csomagtartó", screenW * 0.3016, screenH * 0.3919, screenW * 0.4656, screenH * 0.4570, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Bal első", screenW * 0.3016, screenH * 0.5195, screenW * 0.4656, screenH * 0.5846, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Jobb hátsó", screenW * 0.5337, screenH * 0.5195, screenW * 0.6977, screenH * 0.5846, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Bal hátsó", screenW * 0.5337, screenH * 0.3932, screenW * 0.6977, screenH * 0.4583, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) dxDrawText("Jobb első", screenW * 0.5337, screenH * 0.2682, screenW * 0.6977, screenH * 0.3333, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) --if(menu == 1) then if getKeyState("mouse1") == true then outputChatBox("Leütötte a bal klikket!") local cx,cy = getCursorPos() local jarmu = getElementData(localPlayer, "jarmureklikkelt") outputChatBox("Lekérte a járművet, ami:"..tostring(jarmu)) if isInBox( cx, cy, screenW * 0.3016, screenW * 0.4656, screenH * 0.2669, screenH * 0.3320 ) then setVehicleDoorState( jarmu, 0, 0 ) elseif isInBox( cx, cy, screenW * 0.3016, screenW * 0.4656, screenH * 0.3919, screenH * 0.4570 ) then setVehicleDoorState( jarmu, 1, 0 ) elseif isInBox( cx, cy, screenW * 0.3016, screenW * 0.4656,screenH * 0.5195, screenH * 0.5846 ) then setVehicleDoorState( jarmu, 2, 0 ) elseif isInBox( cx, cy, screenW * 0.5337, screenW * 0.6977, screenH * 0.5195, screenH * 0.5846 ) then setVehicleDoorState( jarmu, 3, 0 ) elseif isInBox( cx, cy, screenW * 0.5337, screenW * 0.6977, screenH * 0.3932, screenH * 0.4583 ) then setVehicleDoorState( jarmu, 4, 0 ) elseif isInBox( cx, cy, screenW * 0.5337, screenW * 0.6977, screenH * 0.2682, screenH * 0.3333 ) then setVehicleDoorState( jarmu, 5, 0 ) else outputChatBox("Egyikre se ment rá!") end end --end --dxDrawText(tostring(door3), screenW * 0.4078, screenH * 0.3177, screenW * 0.5908, screenH * 0.3828,tocolor ( 255, 255, 255, 255 ), 1.7,"default","center","center",false,false,false,true) end If I change here: "setVehicleDoorState( jarmu, 0, 0 )" the "jarmu" to "clickedElement", I got a warning, that in argument 1, got nil.
-
Ah.. Thanks! You help me twice! You are awesome! And sorry
-
I copy your code, but It's still don't working. I put messages the code, and what is under these lines: local pedX, pedY, pedZ = getElementPosition(clickedWorld) local x, y, z = getPositionFromElementOffset(clickedWorld, 0, 3, 0) setCameraMatrix(x, y, z, pedX, pedY, pedZ) Dont working.
-
It's don't working. I create a ped: thePed = createPed(120, 1053.97461, 2096.96313, 10.82031) And I set the camera target: setCameraTarget (thePed) But nothing. And with the CameraTarget we can move the camera, no? I want to freeze the camera, that we can see the ped front side.
-
Hi! How can I do that when I click on a ped(there are more ped, where can we talk with them), and after click, set the camera on him, so we can look at him. I create a ped, in x,y,z, and where I need put the camera that I can see the ped front? Sorry for my English!
-
It's working, thank you! Sorry for the lot of problem! If someone need this, here is my version: addEventHandler( 'onClientRender', root, function() local players = getElementsByType ( "player" ) for key, player in ipairs ( players ) do setPlayerNametagShowing ( player, false) if(getElementData(getLocalPlayer(), tonumber(getElementData(player,"accountID"))) == 1) then setPlayerNametagShowing ( player, true ) end end end)
-
Nothing. Always show the all player's nametag. And It's don't react anything(outputChatBox don't do anything).
-
It's not working. I have no errors or warnings.
-
So if I set the elementdata, when he introduce himself like this: setElementData(source, tonumber(targetPlayer), 1) And in clientside I try this: function resourceStart() local players = getElementsByType ( "player" ) for key, player in ipairs ( players ) do if(getElementData(source, tonumber(player) == 1) then setPlayerNametagShowing ( player, true ) end end end addEventHandler ( "onResourceStart", getResouceRootElement(getThisResource()), resourceStart It'll working? I can't try this now.
-
Hi! It is possible that show player's nametag just for his friends? So don't see all players the nametag, just the friends?
-
It's still bad. It's delete the ban from mysql, and I can connected, however I am banned
-
Hi! I don't know how can I do this, I have some problem with this. Here is the code, when the player is logging in: addEvent("onPlayerAttemptLogin",true) addEventHandler("onPlayerAttemptLogin",root, function(username,password) if (exports["secret_main"]:singleQuery("SELECT * FROM accounts WHERE username=? LIMIT 1",string.lower(username))) then local accData = exports["secret_main"]:singleQuery("SELECT * FROM accounts WHERE username=? AND password=? LIMIT 1",string.lower(username),sha256(password)) if (accData) then local banQuery = dbQuery( kapcsolat, "SELECT * FROM `tiltasok` WHERE `felhasznalo`=?? LIMIT 1", accData.id) local banQueryEredmeny, sorokSzama = dbPoll ( banQuery, -1 ) if(sorokSzama ~= 0) then local banData = exports["secret_main"]:singleQuery("SELECT * FROM `tiltasok` WHERE `felhasznalo`=? LIMIT 1",accData.id) if(tostring(banData.meddig) <= tostring(getRealTime())) then dbExec(kapcsolat, "DELETE FROM `tiltasok` WHERE felhasznalo='??'", accData.id) else kickPlayer(source, "Ki vagy tiltva a szerverről!") end elseif(sorokSzama == 0) then -- ..........ETC.. -- ..........ETC.. -- ..........ETC.. And it isn't kick me, when I am banned. I can logging in. How can I do it?
-
Hi! I want to make a faction list, but how can I add to the guiLabel an own ID, that I can distinguish it. When I click on it, write the clicked label's text. I can't do it. Here is the code: for k, v in ipairs(getJatekosFrakciok()) do szamlalo = szamlalo + 1 lista = k lista = guiCreateLabel(X+370, (Y+100)+k*30, 400, 200,getFrakcionevByID(v),false) end addEventHandler("onClientClick", getRootElement(), function(gomb, statusz, absX, absY) if statusz == "down" and gomb == "left" then for i = 1,szamlalo do if dobozbaVan(X+370, (Y+100)+i*30, 130,30, absX, absY) then outputChatBox(i) text = guiGetText(lista) outputChatBox(text) end end end end) At this line: outputChatBox(i) It is write it correct(1,2,3, etc.) but at these lines: text = guiGetText(lista) outputChatBox(text) It is just write the latest created label's text(faction name), never mind, that I click the first or the latest faction name(label)
-
NevermindxD The alpha's max value just one? I think it is 100. Sorry, the problem solved
-
Hi! I want to create a flashing gui label. It's disappearing slowly, and appear, but once a time. Next time it doing it when I restart the resource. Sorry for my English! Here is the code: (There is no error, warning) local prog = "eltunes" addEventHandler( "onClientResourceStart", getRootElement( ), function () setTimer( function() local alpha = guiGetAlpha(kattints) if(alpha ~= 0 and prog == "eltunes") then guiSetAlpha(kattints, alpha - 0.1) elseif(alpha == 0 and prog == "eltunes") then prog = "elotunes" end if(alpha ~= 100 and prog == "elotunes") then guiSetAlpha(kattints, alpha + 0.1) elseif(alpha == 100 and prog == "elotunes") then prog = "eltunes" end end, 70, 0) end)
-
Hi! Is it possible to change the gridlist word size, what are in the rows?
-
Thank you, I am going to try this when I can. Sorry for this so much problems