-
Posts
147 -
Joined
-
Last visited
-
Days Won
6
Everything posted by FlorinSzasz
-
function find_value_in_table(table,value) local a = table for i=1,#a do if a[i] == value then return true end end end function find_value_pos_in_table(table,value) local a = table for i=1,#a do do if a[i] == value then local t = i return t end end end end 1.Prima functie este folosita la a verifica daca o valoare se afla sau nu intr-un tabel. 2.Urmatoarea functie folosita pentru a gasi pozitia (index-ul) unei valori intr-un tabel daca acea valoare exista in tabelul respectiv. *Sunt testate si merg.
-
Corect așa fac in general cu task-urile zilnice însa aici am evitat asta cel mai probabil pentru ca mi se pare interesant să îți pui în practică ce faci pe hârtie. Ideea e că acum am schimbat abordarea și cred ca o să meargă în acest caz. ?
-
Am realizat de ceva vreme un backup la wiki offline și am gasit un loc unde sa il încarc în cloud poate cuiva îi va fi util în diverse situații fie probleme la internet etc. De menționat este că anumite elemente din pagini ce prezintă diverse culori nu vor mai fi evidențiate precum sunt pe pagina oficială. Link: 1.5.9: https://drive.google.com/file/d/1oYFFeR-kw2htWFGrB_0i_iT97HaxKOjP/view 1.6.0: https://drive.google.com/file/d/16xBwa0aZBxxb4CcldlYDZNyLGhKOhPgr/view?usp=sharing În caz că link-urile nu mai funcționează în timp lăsați un comentariu la topic și în acest caz voi actualiza link-urile!
-
[WIKI] Account blocked
FlorinSzasz replied to FlorinSzasz's topic in Site/Forum/Discord/Mantis/Wiki related
Thank you! ? -
[WIKI] Account blocked
FlorinSzasz replied to FlorinSzasz's topic in Site/Forum/Discord/Mantis/Wiki related
I hope maybe some administrators will take a look on this so i can have a clear view on what i have done wrong. -
In schimb tu ai ceva proiecte realizate, eu lucrez la un server de prin 2019 și nici acum nu e gata :))) tot perioade de revenire și plecare și tot așa sper doar sa il termin.
-
Hi, i want to translate some pages from wiki to Romanian language so we can have functions and events translated to our language. And i was saving a page and i got this: This user is currently blocked. The latest block log entry is provided below for reference: 17:16, 16 March 2023 Abuse filter talk contribs blocked FlorinSzasz talk contribs with an expiration time of indefinite (account creation disabled, cannot edit own talk page) (Automatically blocked by abuse filter. Description of matched rule: Spam bot detection) I want to know where i was wrong or where i did something wrong?
-
no, u write it how big u want the radius to be for the collision sphere. also use this client side to see how big is your ColSphere so u can adjust it. setDevelopmentMode (true) addCommandHandler ("devdebug", function () showCol (not isShowCollisionsEnabled()) end)
-
float -- e un numar real ce poate sa aiba sau nu zecimale poate sa fie sau nu negativ Asta am vrut să adaug doar. Good Work Man.
-
attempt to call global guiCreateWindow (a nil value)
FlorinSzasz replied to tomasitopiola's topic in Scripting
Hi, did u wrote this code client side right? (in client script) Check your meta.xml to see if your script is client side or server side. If is type server then replace server with type="client" like in the example i wrote below. <meta> <script src="mecanico_c.lua" type="client" /> </meta> -
Good, i am glad u managed to do it ?
-
Is the same like the one i wrote you but u replace in my example with your factions data or what data you use. I dont know what u use there so i just gave you a basic idea. I can help u but i have to see your faction script or what u use to add a player in a faction.
-
Ați mai pățit să vă apucați de o resursă să lucrați serios la ea și după câteva zile ai scris la cod de nu mai ai chef să faci nimic decât să iei o pauză de la scripting :)) LET`S SHARE OPINIONS nu sunt singurul care a pățit asta sunt sigur, dar am vrut să fac un topic pe chestia asta.
-
Well u can try something like this 1.) U can create a function for notification in your cop / departament resource and export the function and use it in rob resource. 2.) if u had used setElementData in your cop/ departament resource then u can do somehting like this loop through all players in your rob resource and outputChatBox only for those who have "cop data" or "departament data". addCommandHandler("rob",function(thePlayer,commandName) if thePlayer then if getElementData(thePlayer,"cop_data") == true or getElementData(thePlayer,"departament_data") == true then outputChatBox("[ROB] You are part of departament or cop team u cant rob",thePlayer,255,50,50) else local x,y,z = getElementPosition(thePlayer) for id,player in ipairs(getElementsByType("player")) do if getElementData(player,"cop_data") == true or getElementData(player,"departament_data") == true then local zone = getZoneName(x,y,z) outputChatBox("[ROB] Someone robbed a shop or ATM in "..zone.." area!!!",player,255,50,50) end end end end end)
-
E super keep up the good work man! ? Jocul ala e legendar, ma faci curios de cum o sa fie varianta finala
-
Well i think it should look something like this local alpha = 255 bindKey ( "aim_weapon", "both", function ( _, state ) if getPedWeaponSlot ( localPlayer ) == 6 then if ( state == "down" ) then alpha = 0 elseif ( state == "up" ) then alpha = 255 end for _, v in ipairs ( getElementsByType ( "object", root, true )) do if isElementAttached ( v ) then local id = getElementModel ( v ) if ( id == 2584 ) then setElementAlpha ( v, alpha ) end end end end end )
-
Well if u dont use the bone_attach resource i think u should replace isElementAttachedToBone() --- with this isElementAttached() https://wiki.multitheftauto.com/wiki/IsElementAttached Also u dont need to change the dimension of the object u cant just set the alpha to 0 and it should be enough.
-
Interesant, mult succes cu proiectul cine stie poate o sa iasa ceva cool.
-
You can use GUI gridlist then it will look like this -> https://wiki.multitheftauto.com/wiki/GuiCreateGridList If u want it to look like in the picture u showed than u need dxDrawRectangle dxDrawText Here is an example how data is inserted in gridlist from database on a basic skin saving system ->
-
Fixed I had to increase my 2200g allocated video memory from 64 to 512mb i had no FreeVideoMemoryForMTA, i tought MTA will use as much memory as it needs i have in BIOS 64mb but any game will take as much as it needs even if limit is 64 so when i dont play a game i dont waste ram as video memory. Well at least i have 16 GB of ram so ram wont be a problem.
-
Well the font is the right extension and is in the same folder as the scripts. Here is a picture! https://drive.google.com/file/d/1GdXLMYHo7q4_TVtT0LbQfn_6EjvjriTf/view?usp=sharing
-
So i want to add for my own drift resource a custom font i have done this thing in other resources long time ago but now it doesnt work and i dont know why? Also the font is installed on windows. <meta> <script src="drift_C.lua" type="client"/> <script src="drift_s.lua" type="server"/> <map src="drift.map" dimension="2"></map> <file src="oceanicdrift.ttf"></file> </meta> Client Side local font = guiCreateFont("oceanicdrift.ttf",20) driftlabel = guiCreateLabel(511, 859, 320, 81,"[ DRIFT: "..drift.." X "..counter.." ]", false) guiSetFont(driftlabel,font) guiLabelSetHorizontalAlign(driftlabel, "center", false) guiLabelSetVerticalAlign(driftlabel, "center") Errors [2023-03-08 22:01:25] WARNING: drift\drift_C.lua:25: Error creating font @ 'guiCreateFont' [oceanicdrift.ttf] [2023-03-08 22:01:25] WARNING: drift\drift_C.lua:28: Bad argument @ 'guiSetFont' [Expected gui-font at argument 2, got boolean]
-
Well i dont know if this might help you but if u mean something like this i can give u some ideas i think, also i used dxDrawImage() dxDrawRectangle() https://drive.google.com/drive/folders/1vF7AlP8S1ggWoi7DZa60vZRxWRLnzDlQ?usp=sharing
-
Got it fixed! Somehow i replaced your image draw with a button for test! Also dont forget to put your picture back on client side part. Server side function desligarGeradorS( player, generatorID ) local id = getElementData(markers[generatorID], "generatorID") if id == generatorID then setElementData(markers[generatorID], "state", false) end end addEvent( "desligarGerador", true ) addEventHandler( "desligarGerador", root, desligarGeradorS ) function ligarGeradorS( player, generatorID ) local id = getElementData(markers[generatorID], "generatorID") if id == generatorID then setElementData(markers[generatorID], "state", true) end end addEvent( "ligarGerador", true ) addEventHandler( "ligarGerador", root, ligarGeradorS ) Client Side local data = {} -- or u name it the way u want local screenW, screenH = guiGetScreenSize() function AbrirGeradorM( generatorID, currentFuelLevel, fuelLevel, maxFuelLevel, state, x, y, z ) data["id"] = generatorID data["currentFuelLevel"] = currentFuelLevel data["fuelLevel"] = fuelLevel data["maxFuelLevel"] = maxFuelLevel data["state"] = state data["x"] = x data["y"] = y data["z"] = z setElementData( localPlayer, "AbrirGerador", true ) end addEvent( "AbrirGerador", true ) addEventHandler( "AbrirGerador", root, AbrirGeradorM ) addEventHandler("onClientRender", root, function() if getElementData( localPlayer, "AbrirGerador" ) == true then -- if a == 0 then -- a = 1 local generatorID = data["id"] local currentFuelLevel = data["currentFuelLevel"] local fuelLevel = data["fuelLevel"] local maxFuelLevel = data["maxFuelLevel"] if fuelLevel then -- showCursor(true,true) -- test = guiCreateButton(310, 359, 98, 50, "test", false) -- addEventHandler("onClientGUIClick",test,aaa,false) -- replace back with your picture i took here one random for testing dxDrawImage(screenW * 0.4103, screenH * 0.4401, screenW * 0.0235, screenH * 0.2734, "cube.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Combustivel:", 412, 459, 548, 491, tocolor(255, 255, 255, 255), 1.00, "default", "right", "bottom", false, false, false, false, false) --progress gasolina local imageWidth = screenW * 0.0147 local maxHeight = screenH * 0.2617 local imageHeight = maxHeight * fuelLevel / maxFuelLevel dxDrawImage(screenW * 0.4147, screenH * 0.4453 + maxHeight - imageHeight, imageWidth, imageHeight, "cube.png", 0, 0, 0, tocolor(195, 181, 32, 206), false) if data["state"] == true then r,g,b = 74, 255, 80 dxDrawText("Desligar", screenW * 0.3206, screenH * 0.6602, screenW * 0.3963, screenH * 0.7018, tocolor(255, 255, 255, 255), 1.00, "arial", "center", "center", false, false, false, false, false) dxDrawImage(screenW * 0.3132, screenH * 0.6471, screenW * 0.0941, screenH * 0.0664, "cube.png", 0, 0, 0, tocolor(r, g, b, 217), false) elseif data["state"] == false then r,g,b = 147, 74, 60 dxDrawText("Ligar", screenW * 0.3206, screenH * 0.6602, screenW * 0.3963, screenH * 0.7018, tocolor(255, 255, 255, 255), 1.00, "arial", "center", "center", false, false, false, false, false) dxDrawImage(screenW * 0.3132, screenH * 0.6471, screenW * 0.0941, screenH * 0.0664, "cube.png", 0, 0, 0, tocolor(r, g, b, 217), false) end end end end) addEventHandler( "onClientClick", root, function (button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedWorld) if button == "left" then if state == "down" then if getElementData( localPlayer, "AbrirGerador" ) == true then if isCursorOnElement(screenW * 0.3206, screenH * 0.6602, screenW * 0.3963, screenH * 0.7018) then local state = data["state"] local x = data["x"] local y = data["y"] local z = data["z"] local id = data["id"] if data["id"] and data["state"] == true then triggerServerEvent( "desligarGerador", resourceRoot, localPlayer, data["id"] ) elseif data["id"] and data["state"] == false then playSound3D( "start.mp3", x, y, z ) triggerServerEvent( "ligarGerador", resourceRoot, localPlayer, data["id"] ) end end end end end end)
-
Server side u have to do this! local markers = {} local geradores = { {id = 1, fuelLevel = 50, maxFuelLevel = 200, state = false, position = {2397.336, -2472.24, 12.8}}, {id = 2, fuelLevel = 50, maxFuelLevel = 200, state = false, position = {150, 250, 10}}, {id = 3, fuelLevel = 50, maxFuelLevel = 200, state = false, position = {200, 300, 10}}, } -- Crie os marcadores para cada gerador na tabela for key, gerador in ipairs(geradores) do local marker = createMarker(gerador.position[1], gerador.position[2], gerador.position[3], "cylinder", 1, 255, 0, 0, 20) local markers[key] = marker setElementData(markers[key], "generatorID", gerador.id) setElementData(markers[key], "fuelLevel", gerador.fuelLevel) setElementData(markers[key], "maxFuelLevel", gerador.maxFuelLevel) setElementData(markers[key], "state", gerador.state) end addEventHandler("onPlayerMarkerHit", root, function (markerHit, matchingDimension) for k,v in ipairs(markers) do if markerHit == markers[k] then local generatorID = getElementData(markers[k], "generatorID") local fuelLevel = getElementData(markers[k], "fuelLevel") local maxFuelLevel = getElementData(markers[k], "maxFuelLevel") local state = getElementData(markers[k], "state") local x,y,z = getElementPosition( markers[k] ) triggerClientEvent(source, "AbrirGerador", root, generatorID, currentFuelLevel, fuelLevel, maxFuelLevel, state, x, y, z ) end end end) addEventHandler("onPlayerMarkerLeave", root, function (markerLeft, matchingDimension) for k,v in ipairs(markers) do if markerLeft == markers[k] then local generatorID = getElementData(markers[k], "generatorID") triggerClientEvent(source, "fecharGerador", root, generatorID) end end end) function desligarGeradorS( player, generatorID ) for i, marker in ipairs(markers) do local id = getElementData(markers[i], "generatorID") if id == generatorID then setElementData(markers[i], "state", false) end end end addEvent( "desligarGerador", true ) addEventHandler( "desligarGerador", root, desligarGeradorS ) function ligarGeradorS( player, generatorID ) for i, marker in ipairs(markers) do local id = getElementData(markers[i], "generatorID") if id == generatorID then setElementData(markers[i], "state", true) end end end addEvent( "ligarGerador", true ) addEventHandler( "ligarGerador", root, ligarGeradorS ) I just edited your code so you wont have a bug with the markers because u made the marker hit event to work for any marker u hit not only those 3 markers! Also client side u can do this here! local data = {} -- or u name it the way u want function AbrirGeradorM( generatorID, currentFuelLevel, fuelLevel, maxFuelLevel, state, x, y, z ) data["id"] = generatorID data["currentFuelLevel"] = currentFuelLevel data["fuelLevel"] = fuelLevel data["maxFuelLevel"] = maxFuelLevel data["state"] = state data["x"] = x data["y"] = y data["z"] = z setElementData( localPlayer, "AbrirGerador", true ) end addEvent( "AbrirGerador", true ) addEventHandler( "AbrirGerador", root, AbrirGeradorM ) I think this should fix the problem. And on client side u can use data from the table all over the script u dont need to setElementData to localPlayer