
βurak
Members-
Posts
371 -
Joined
-
Last visited
-
Days Won
22
Everything posted by βurak
-
yes there must be something wrong with this link because it was working yesterday, now it's not working can you try to download it via archived website https://megalodon.jp/2022-0315-0707-50/bpb-team.ru/star-tR/files/maps.zip
-
There's something here but I'm not sure if that's what you want http://bpb-team.ru/star-tR/files/maps.zip
-
I'm not sure but can you try this code this is a bit different from the math you use local screenW, screenH = guiGetScreenSize() local myW, myH = 1920, 1080 -- your resolution here local relX, relY = (screenW/myW),(screenH/myH) --this dxDrawText("Password", screenW * 0.4844, screenH * 0.5093, screenW * 0.5188, screenH * 0.5222, tocolor(255, 255, 255, 255), 1.00 * relX, "default", "left", "top", false, false, false, false, false)
-
server sana ait ise kodu gösterirmisin? eğer değilse server sahibi ile irtibat kurun bu sorun için script sonsuz döngüye giriyor olabilir
-
You're welcome. Please open a new topic if you have any other questions, I'll help you as best I can. ?
-
Are the function parameters correct? Is the function you called defined as exports in meta.xml? Are the function you call and the file you run the script on the same side?
-
Can you try multiplying the size with screenW? --this dxDrawText("Password", screenW * 0.4844, screenH * 0.5093, screenW * 0.5188, screenH * 0.5222, tocolor(255, 255, 255, 255), screenW * 1.00, "default", "left", "top", false, false, false, false, false)
-
actually you can solve this with a single variable instead of using "isEventHandlerAdded" Since there are more operations in the isEventHandlerAdded function, you can do it economically with a single variable. local isSpeedoMeterVisible = false --speedometer visibility status function hideSpeedometer() if(isSpeedoMeterVisible) then -- Is the speedometer visible? removeEventHandler("onClientRender", root, speedoMeterGUI) end end function showSpeedometer() if(isSpeedoMeterVisible == false) then -- Is the speedometer invisible? addEventHandler("onClientRender", root, speedoMeterGUI) end end ---------------------------------------------- function A1(player) vehicle = getPedOccupiedVehicle(player) if getPedOccupiedVehicleSeat(player)==0 or getPedOccupiedVehicleSeat(player)==1 then showSpeedometer() -------call to create the handler end end addEventHandler("onClientVehicleEnter", root, A1) function A2() hideSpeedometer() -----call to remove the handler end addEventHandler("onClientVehicleStartExit", root, A2)
-
You can use a table for this, if you don't have very complex code on the client side, I strongly recommend using a table. example: local playerThings = {} -- storage place for player things function example(thePlayer, cmd) local thingCheck = playerThings[thePlayer] -- if player things are always going to be numbers then there is no need for "tonumber" --local thingCount = tostring(thingCheck) -- actually I think it is not needed because you convert it to string type with concatenation in outputChatBox function if (thingCheck and thingCheck >= 1) then outputChatBox("You have "..thingCheck.." thing(s).", thePlayer, 255,255,255) else outputChatBox("You don't have anything.", thePlayer, 255, 255, 255) end end addCommandHandler("mythings", example)
-
the problem may be in the sql query so make sure this query is correct
-
where the event is triggered before the resource starts on the client side or the use of the sql query may be wrong outputDebugString(sql.nivel) You can add a debug line inside the event to find out.
-
can you show the code
-
You can create a client-side timer with setTimer, then use the triggerServerEvent as is so it will constantly update the level text (1 second may be enough for the update to avoid creating too many network connections) parameter of client side event "updateLevelPlayer"
-
local sql = exports.sql:query_assoc_single("SELECT nivel FROM characters WHERE characterID = "..exports.players:getCharacterID(source)) I may have made a typo here, I fixed it, try this
-
You can't do this on client side and I don't recommend doing it. it's good to stay on server side, use "triggerServerEvent" and "triggerClientEvent" to do this example: server: addEvent("requestGetLevelPlayer", true) --create event on server side addEventHandler("requestGetLevelPlayer", root, function() local sql = exports.sql:query_assoc_single("SELECT nivel FROM characters WHERE characterID=?"..exports.players:getCharacterID(source)) triggerClientEvent(source, "updateLevelPlayer", source, sql.nivel) --send level information to client end ) client: local level = 0 triggerServerEvent("requestGetLevelPlayer", localPlayer) --send level update request (don't use it in onClientRender) dxDrawText("LVL: "..level, x*2079, y*185, x*21, y*14, tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false) addEvent("updateLevelPlayer", true) --event to update level addEventHandler("updateLevelPlayer", root, function(playerLevel) level = playerLevel --update level end )
-
i tested now it uses texture named "sphere" but they use fxp files to create the effect I'm not sure you can do this in mta but you can find them in "effects.fxp" file
-
if you want to run this event you can do it with setTimer For example you set the timer to 1 second, on the client side you then pass the triggerServerEvent to this timer this is better than calling it during every frame
-
In fact, there is a very bad situation that I noticed in this resource, and that is this. Running triggerServerEvent per frame inside onClientRender event It will cause the server to consume a very large network connection and cause bad optimization of the server, so it is a very critical situation. so I suggest you delete this line function getCarStateColor(fuelVeh) --triggerServerEvent("verGasolina", localPlayer) -- <-- this if (fuelVeh) then local g = (255/100.0000) * fuelVeh local r = 255 - g local b = 0 return r, g, b else return 0, 255, 0 end end local csr, csg, csb = getCarStateColor() -- <-- this for fuel maybe you can use setElementData setElementData(veh, "Fuel", column["fuelofcar"]) --Create a key named "Fuel" and export the information from the database on client side use getElementData to get it getElementData(vehicle, "Fuel")
-
getCarStateColor takes fuel parameter but no parameter in onClientRender event getCarStateColor(fuelVeh) local csr, csg, csb = getCarStateColor() maybe this issue can be fixed if you pass vehicle fuel status into onClientRender event
-
Can you show me where this function is used. are you using dx as hud? i would like to see them if possible
-
triggerServerEvent("verGasolina", localPlayer) can you change root to localPlayer
-
function checkGas() veh = getPedOccupiedVehicle(source) --here x,y,z = getElementPosition(veh) if (veh) then local plate = getVehiclePlateText(veh) local consulta = exports.mysql:_Query("SELECT * FROM vehicles WHERE plate=?", plate) if (consulta) then if (#consulta>0) then for _,column in ipairs(consulta) do ownerGet = tostring(column["owner"]) keyOW = tostring(column["keyOW"]) break end end end can you change the player to source
-
I think the player argument is invalid here, can you show me how to call this function?
-
where exactly is the error occurring? can you show the rest of the code?