-
Posts
282 -
Joined
-
Last visited
Everything posted by Gordon_G
-
I know this'll work but, I'll need to do this for all my guiFunc's I would like to be faster
-
Hello, I've a little problem with the lua unpack function. This is my code : -- CLIENT local loginPanelPos = { ["globalPanel"] = {0,0,557,400} } function showLoginPanel( ) a = guiCreateStaticImage( unpack(loginPanelPos["globalPanel"]), "LOGIN.png", false ) end This is what I'm getting in /debugscript 3 Bad argument @guiCreateStaticImage [Expected number at argument 3, got boolean]
-
Add this at line 29 guiSetVisible(graphics.window, false)
-
addEventHandler("onClientMarkerHit" , Marker , markerhit) try to put it at the end of the file, because actually, when you trigger, markerhit is a nil value and Marker too
-
You never call getUpdates()
-
You handle a function who is not defined, put the event handler below the function
-
function getUpdates() local file = "UpdatesLog.txt" local openFile = fileOpen(file) local size = fileGetSize(openFile) if not openFile then outputChatBox("Error loading file") return false end local updates = fileRead(openFile, size+500) fileClose(openFile) triggerClientEvent(client, "getUpdates", client, updates) end It works fine for me when I create logs file for exemple.
-
Ok, thanks, I did not see the last 3 args. Anyway I did it myself by using : local image = dxCreateTexture( "multiColor.png" ) local white = tocolor(255,255,255,255) addEventHandler("onClientRender", root,function() dxDrawMaterialLine3D( 225,17,3,226.5,18.5,3,image,1.5,white,219.04632568359,19.361221313477,3 ) end) Thanks for your help
-
Hello, I'm not very strong with the dx elements. I've seen this on wiki for creating a 3D image at a world position : https://wiki.multitheftauto.com/wiki/DxDrawImage3D But, when I move the camera, the image is rotating with it, how can I create a function with no rotation of the image ? Like this, when I move the camera, the image don't move.
-
If you put getRootElement() it ill trigger the client event for everyone, not only for the players who are in the CT team, I do not thing it's what you want to do. You should keep the last code you did, because here, there is no loop, so the execution of the triggerClientEvent can't work. You can not define getRootElement() to take all the players. What @DNL291 said was not in order to modify your code, that was just a right information
-
Yes, it'll work if CT value is goodly a team created in the same resource
-
So, the code above will do this
-
If there a 10 players in CT team alive, it'll trigger the client event 10 times. Want do you want to do exactly ?
-
https://wiki.multitheftauto.com/wiki/FindRotation
-
Move the fonction gethp to the top
-
I do not do that to patch a security prob. Juste to reduce lag because I use a lot datas
-
Oh yes, it is, I did not noticed it, thanks !
-
Hello, I've read the elementData were not secured, and very slow. So, we can replace it with table, but what could be the better ? This ? datas_ = {} function setPlayerData(player,data,value) datas_[player][data] = value end Or this ? datas_ = {} function setPlayerData(player,data,value) datas_[data][player] = value end
-
It can not works because "marker1" is created inside the fonction who is handled. You can not handle a marker who do not exist. So, you'll need to create "marker1" before handling it.
-
That's not
-
It depends when allCpTimes table is defined : print(test) -- print nil test = "try" print(test) -- print try
-
projectile How to change a projectile's blip color?
Gordon_G replied to Lord Henry's topic in Scripting
In order to reduce lag, you should use for i,v in pairs(getAttachedElements(yourProjectileElementHere) do setBlipColor(v,255,0,0,255); end instead of for i,v in ipairs(getAttachedElements(yourProjectileElementHere) do setBlipColor(v,255,0,0,255); end 'Cause you don't need to order the execution.