pa3ck
Members-
Posts
1,141 -
Joined
-
Last visited
-
Days Won
7
Everything posted by pa3ck
-
Hello there, I'm trying to replace some buildings with a custom one, but the problem is, that from far away I can see the real object, but when I'm near the object it loads my custom one. Is there any way to solve this? Or is it a known bug?
-
The event is triggered when you click on a gui, and 'thePlayer' is sent from client side to server side. So its defined client side as getLocalPlayer()
-
Thanks for you help, this was my first try, but it gave me the same error. Now I copy-pasted your code and give the same error. Bad argument @ destroyElement
-
Thanks for reply, thePlayer was triggered from client side (so thePlayer = getLocalPlayer()). The problem is, that it wont destroy the element at all. I'll try what you said.
-
What I mean is that you triggered ('rotateHead', v, x, y, z) then you wanted to set the ped looking at rx, ry, rz, which is not defined.
-
You defined x, y, z not rx, ry, rz. You gotta correct that on the client side.
-
Okay, thanks for the reply. But I cant define every name like... What I need is something like this ( I dont know if this would work ): addEventHandler('onClientResourceStart', getResourceRootElement(getThisResource()), function() local thePlayer = getLocalPlayer() local myT = {} addEventHandler('onClientGUIClick', myButton, function() if source == myButton then local tNumber = #myT local bNumber = tNumber + 1 myT[bNumber] = createObject(id, x, y, z) end end) end) Question 2: If that wouldn't work, would this work: myN = getElementData(getLocalPlayer(), 'number') -- ofc, I would set a number before getting the elementdata myT[myN] = createObject(id, x, y, z) Thanks in advance.
-
Hi there, I would like to accomplish the following ( but I don't know how ) I got a function like: varName = createObject(id, x, y, z) But what I want is, that the variable would be different for all players, like the variable would be their name, serial, or anything like that ( numbers even ). Is there any way to do it?
-
The object is not double-sided and is invisible from one side, is that what you mean? If so, its not a script. There are lots of objects that are not double-sided by default, like LS / SF runway.
-
You could edit the server side code like this: setElementData ( source, "Rankicon", "_0.png" ) OR Edit the client side like this: if Level and fileExists ( Rankicon ) then dxDrawImage((557/1024)*sWidth, (745/768)*sHeight, size, size, Rankicon)
-
See the bottom of the picture you just posted? Thats what you need. The 'UPDATE' thing. First you will need to check his name in the table, if the name does not exist then create a new row, else update your row.
-
It was anwered in your other post already: https://forum.multitheftauto.com/viewtopic.php?f=91&t=67078
-
Read this: guiGridListAddRow. Its the best example.
-
Use triggerServerEvent from client side.
-
I got some problems with tables, I'm not that good at them. Here is my code: addEventHandler('onClientRender', getRootElement(), function() if getKeyState('l') == true then playerC = 0 playerL = 27 columnsP = 28 playersT = {} pt = 0 local swidth, sheight = guiGetScreenSize() local rx, ry = 600, 400 local rectangle = dxDrawRectangle(swidth / 2 - rx / 2, sheight / 2 - ry / 2, rx, ry, tocolor(0, 0, 0,150)) local titleLine = dxDrawLine(swidth / 2 - rx / 2, sheight / 2 - ry / 2 + 28, (swidth / 2) + (rx / 2), sheight / 2 - ry / 2 + 28, tocolor(255, 0, 0, 255)) local columnNameTitle = dxDrawText("Players",swidth / 2 - rx / 2 + 10, sheight / 2 - ry / 2 + 3, swidth, sheight, tocolor(255, 0, 0, 255),1.7) local columnPingTitle = dxDrawText("Ping",swidth / 2 - rx / 2 + 228, sheight / 2 - ry / 2 + 3, swidth, sheight, tocolor(255, 0, 0, 255),1.7) local columnName = dxDrawLine(swidth / 2 - rx / 2 + 220, sheight / 2 - ry / 2, swidth / 2 - rx / 2 + 220, sheight / 2 - ry / 2 + 28, tocolor(255, 0, 0, 255)) local columnPing = dxDrawLine(swidth / 2 - rx / 2 + 274, sheight / 2 - ry / 2, swidth / 2 - rx / 2 + 274, sheight / 2 - ry / 2 + 28, tocolor(255, 0, 0, 255)) for _,name in ipairs(getElementsByType("player")) do pt = pt + 1 playersT[pt] = name outputChatBox(#playersT) playerC = playerC + 28 playerL = playerL + 26 columnsP = columnsP + 26 txt = dxDrawText(getPlayerName(name),swidth / 2 - rx / 2 + 10, sheight / 2 - ry / 2 + playerC, swidth, sheight, tocolor(255, 0, 0, 255), 1.4) line = dxDrawLine(swidth / 2 - rx / 2, sheight / 2 - ry / 2 + playerL, (swidth / 2) + (rx / 2), sheight / 2 - ry / 2 + playerL, tocolor(255, 0, 0, 255)) name = dxDrawLine(swidth / 2 - rx / 2 + 220, sheight / 2 - ry / 2, swidth / 2 - rx / 2 + 220, sheight / 2 - ry / 2 + columnsP, tocolor(255, 0, 0, 255)) ping = dxDrawLine(swidth / 2 - rx / 2 + 274, sheight / 2 - ry / 2, swidth / 2 - rx / 2 + 274, sheight / 2 - ry / 2 + columnsP, tocolor(255, 0, 0, 255)) end end end) My problem is, that the 'outputChatBox(#playersT)' line 19 returns 1 and 2 (there are 2 players). Why is that?
-
That code should work, for the other one try this: addEventHandler('onClientVehicleExit', getRootElement(), function(thePlayer, seat) destroyElement(source) end)
-
Is 'theVehicle' defined server side? Client side should work if you change it a little bit. The timer should be like this: setTimer(function, interval, executes). You did not define execution ( how many times you want the timer to start over and over again. 0 = infinite) and: setElementFrozen(playerVehicle, true) If you created the marker inside a function, then place the client side thing you posted into the same function. EDIT: use getPedOccupiedVehicle instead of: getPlayerOccupiedVehicle Both of them works, but the first one is more generic, the second one is an old function.
-
Are you sure its a client side script src in meta?
