
Overkillz
Members-
Posts
545 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Overkillz
-
I tried it but the image isn't the same for everybody. Each one has his own image.
-
Hey dear community, Im trying to draw multiple photos using mask shader. The script is based on shader_hud_mask or something like that. Well, my problem is that using this method it lags me a lot, but a lot of. I hope you can help me to use a better way for it. function dxDrawMaskAvatar(posX,posY,sizeX,sizeY,url,r,g,b,a,postGUI) if url and url ~= "" then imageTexture = dxCreateTexture(url) hudMaskShader = dxCreateShader("files/img/hud_mask.fx") maskTexture1 = dxCreateTexture("files/img/circle_mask.png") validMask = hudMaskShader and imageTexture and maskTexture1 if not validMask then outputChatBox( "Could not create some things. Please use debugscript 3" ) else dxSetShaderValue( hudMaskShader, "sPicTexture", imageTexture ) dxSetShaderValue( hudMaskShader, "sMaskTexture", maskTexture1 ) end --### DRAW dxSetShaderValue( hudMaskShader, "sMaskTexture", maskTexture1 ) dxDrawImage( posX,posY,sizeX,sizeY, hudMaskShader, 0,0,0, tocolor(r,g,b,a),postGUI or false ) end end --######## --##Draw Avatar --######## function testingDrawAvatar() dxDrawMaskAvatar(sX/2,sY/2,sY*0.05,sY*0.05,"files/img/defaultavatar.png",255,255,255,255,true) dxDrawMaskAvatar(sX/2,sY/3,sY*0.05,sY*0.05,"files/img/user.png",255,255,255,255,true) end addEventHandler( "onClientRender", getRootElement(),testingDrawAvatar) Thanks for reading.
-
Im a bit dump. I have solved the problem following ur example. I didn't realize that ??=?? expression is remplaced by the arguments. However, I was using a for, so, the code can be shorter by this local tableNamecall = "core_members" local name = "name" for i=1,#tableAccount do local randomValues = math.random(1000,328842) dbExec( dbConnectTable.connection, "UPDATE ?? SET ??=? WHERE ??=?", tableNamecall, tableAccount[i], randomValues, name, account ) end Regards. #You can close the topic
-
Hey there dear community, today I started to work on a system which will be sync with my forum, leaving out it. Im trying to update a value on a colum, however, I couldn't do it due to I cannot understand at all dbExec Function local tableAccount = {"plCash","plPoints","plMapsplayed","plMapswon","plWinratio","plHunters","plToptimes","plToptimes1","plPvps","plPvpswon","plPvpsratio"} function updatePlayerDatas(account) for i=1,#tableAccount do local randomValues = math.random(1,328842) dbExec (dbConnectTable.connection, "UPDATE core_members SET "..tableAccount[i].."="..randomValues.." WHERE `name` = "..account .."" ) end end Table: core_members Column: tableAccount Array Debugscript 3 drops me: You have an error on your SQL syntax ... Thanks for reading. Regards.
-
I don't think so
-
Your function is a bit weard, I'm not sure if semi1 is the left or right one, anyways I left u a comment respecting it. Also, there are some unnecessary things like Circle Width and dxGetTextWidth is not defined as a varaible, so, u can use it like that function dxDrawRoundedRectangle( x, y, width, height, color, postGUI ) local color = color or tocolor( 0, 0, 0, 150) dxDrawRectangle(x, y, width, height, color, postGUI) --Semi 1 Circle must be the LEFT one and Semi 2 Circle must be the RIGHT one dxDrawImage(x-height, y, height/2, height, "img/semi.png", 0, 0, 0, color, false) dxDrawImage(x+width, y, height/2, height, "img/semi2.png", 0, 0, 0, color, false) end NOT TESTED. PS: I would use dxDrawImageSection using just a circle
-
local allowedToSpawnVehicle = true function createVehicleForPlayer(thePlayer, command, vehicleModel) if allowedToSpawnVehicle then local x,y,z = getElementPosition(thePlayer) x = x + 5 if not vehicleModel then outputChatBox("SYNTAX:/createvehicle [id]",thePlayer) return end createVehicle(tonumber(vehicleModel),x,y,z) allowedToSpawnVehicle = false blockerTime = setTimer(function() allowedToSpawnVehicle = true end,1000,1) else outputChatBox("You cannot create a vehicle now!!Please try later again!",thePlayer,255,255,255,true) end end addCommandHandler("createvehicle", createVehicleForPlayer) Remember that it 1000 miliseconds is ONE second, so, be aware of it, I have changed something on the code, try it now. Regards. PS: The script is serverside
-
Im not sure if you are trying to block the function to create vehicle during a second after creating one. In case of yes, try this local allowedToSpawnVehicle = true function createVehicleForPlayer(thePlayer, command, vehicleModel) if allowedToSpawnVehicle then local x,y,z = getElementPosition(thePlayer) x = x + 5 local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z) if (createdVehicle == false) then outputChatBox("SYNTAX:/createvehicle [id]",thePlayer) end allowedToSpawnVehicle = false blockerTime = setTimer(function() allowedToSpawnVehicle = true end,1000,1) else outputChatBox("You cannot create a vehicle now!!Please try later again!",thePlayer,255,255,255,true) end end addCommandHandler("createvehicle", createVehicleForPlayer) It is not tested Regards.
-
No, I think u didn't understand me. Well, let me explain slowly. Some mappers apply shaders to their maps like skybox, watershaders ...etc I started the script and the first of the script works pretty well, it removes all the shaders IF THE PLAYER WANTS by clicking a simple key. However, If they want to restore it, they can't, I want to allow them to restore the shaders that were removed previously. Thats why I don't know what should I put on the second argument of engineApplyShaderToWorldTexture Regards.
-
Hey dear community, Im having a little issue to restore map shaders. I already used getElementsByType and apply it to an table to save all the datas that it got. It work pretty well while removing, but when i want to restore them, I don't know what can I put on the 2nd argument of engineApplyShaderToWorldTexture function lalala() if(#shadersTab > 0)then for i,shaderr in ipairs(shadersTab)do engineApplyShaderToWorldTexture( shaderr, "What to put here ?" ) end end end I hope u can understand me, Regards.
-
Try to use a onClientRender to keep it function wawawa() setPlayerHudComponentVisible(..Your Arguments ...) end addEventHandler("onClientRender",getRootElement(),wawawa) It is clientside
-
Thanks man, I've got it how does it work now. Regards # You can close the topic.
-
Hey dear community, some days ago, I wanted to do a rounded image using a formula, however, I really don't know how to do it. Let me explain better, I have an image which is a rectangle, well, so, I want to convert it on a circle using a function like dxDrawImageSection or another one which help me to do it. Please, don't tell me to use Photoshop because it won't be just an image, I will use a system to get an image and later round it. Thanks for reading, regads.
-
Other easy way could be if x >= 1280 and y >=720 then -- This will set the image only to the resolution 1280x720 or lower else -- This will set the image to the resolutions which surpass 1280x720 end
-
Alright, i just had disabled everything. Might it was the problem. Thanks newly.
-
Hey there dear community, today I've got a weard problem, some weeks ago I started to edit the race game mode script, however, today I set a hunter map and I realized that the camera is bug, I can't see the SQUARE using the first camera. To let you know what Im talking, I took 2 screen shots, The first one bugged And how it should look I don't know where could be the problem. Thanks for reading. Regards.
-
Yeah, I think im dumb today. Since I sleep few hours I couldn't get this on my mind haha. Thanks for it guys, Regards.
-
io library ? I have never heard about this, could you give me more details about it ? Thanks
-
Hey dear community, Im just looking for a way if I can get a table with a lot of values to add it on an script I don't know if you understand me, then I will explain it better. -- TXT Files (test.txt) thisIsMyTable = {"value1","value2","value3","value4","value5"} otherTable = {"value1","value2","value3","value4","value5"} later I would like to load it on my script local variableScript = {} local otherVariableScript = {} function getTheVariables(table1,table2) if table1 then variableScript = table1 end if table2 then otherVariableScript = table2 end end Thanks for reading. Regards.
-
Might this could help you https://wiki.multitheftauto.com/wiki/EngineImportTXD Regarding about create 2 m4a1 taking an useless weapon, replace the model and replace the txd. I would chose that way.
-
There's already an existed race game mode in your default resources pack. However he is looking for a race mode focus on DM mode. I think there are enought scripts on the community respecting race DM mode. Regards.
-
You can use triggerClientEvent triggerServerEvent triggerEvent
-
It's boring seeing people that doesn't try to do anything by himself. There is something called wiki where you can see everything with some examples ... Next time avoid requesting script without knowing whats the meaning of server side or client side ... function startVehicleChanging() if isTimer(vehChangeTimer) then killTimer(vehChangeTimer) end vehChangeTimer = setTimer( function() for _,plr in pairs(getElementsByType("player")) do local veh = getPedOccupiedVehicle(plr) local model = vehicleIDS[math.random(1,#vehicleIDS)] if veh and model and getPedOccupiedVehicleSeat(plr) == 0 then local x,y,z = getElementVelocity(veh) setElementVelocity(veh,x,y,z+0.05) local hp = getElementHealth(veh) setElementModel(veh,model) setElementHealth(veh,hp) end end end ,15000,0) end addEvent("onRaceStateChanging",true) addEventHandler("onRaceStateChanging",root, function (new) if (new == "Running") then startVehicleChanging() triggerClientEvent(source,"onCounterStart",source) end end) local sX,sY = guiGetScreenSize() local counter = 15 local r,g,b = 0,255,0 function drawCounterSHI() dxDrawText("Your vehicle will change in: "..counter,0,sY*0.8,sX,sY,tocolor(r,g,b,255),2,"default","center","top",false,false,false) end function startEverything() addEventHandler("onClientRender",root,drawCounterSHI) setTimer(function() counter = counter - 1 if counter < 0 then counter = 15 r,g,b = 0,255,0 end if counter <= 3 then r,g,b = 255,0,0 end end,1000,0) end addEvent("onCounterStart",true) addEventHandler("onCounterStart",getRootElement(),startEverything)
-
Do a triggerClientEvent using the following function addEvent("onRaceStateChanging",true) addEventHandler("onRaceStateChanging",root, function (new) if (new == "Running") then --Do your trigger to the source to prevent any other bug .. end end)
-
Already done, It works, but Im not looking for this. When the camera is attached, I cant move it from left to right or whaterver using the mouse ... My goal is move the mouse as If I would be driving a vehicle ...