-
Posts
2,947 -
Joined
-
Last visited
Everything posted by JR10
-
Create the gui and use guiSetVisible to hide it, then use addCommandHandler with guiSetVisible to show it again, shouldn't be hard. addCommandHandler('updates', function() guiSetVisible(WINDOW, true) end) You can use guiMemoSetReadOnly to disable editing a memo: local memo = guiCreateMemo(...) guiMemoSetReadOnly(memo, false)
-
If you're new, then this is definitely not yours. We don't offer help with leaked/stolen scripts. Locked. You can PM me if you want to protest.
-
Because it doesn't work like that? You can't cross-return data. You have to trigger another event to return any data.
-
Yes, there is no problem setting it client-side, but it's useless to trigger a client event just to set the element data, when you can just do it server-side.
-
You mean from a function? One way to do that would be coroutines. viewtopic.php?f=91&t=86184&p=779671&hilit=coroutine#p779671 viewtopic.php?f=91&t=92076&p=828272&hilit=coroutine#p828272
-
You don't need to store the query handle returned from dbQuery since you're using callbacks. You don't need to use -1 as the timeout since the data will surely be ready, you can just use 0.
-
You can check the wiki page of any function for the syntax and a basic example. local qh = dbQuery('SELECT * FROM accounts') local results = dbPoll(qh, -1) -1 means that it will wait for the database to return the results. You can also use callbacks which is better because it doesn't freeze the server till the data is returned.
-
I made one some time ago: viewtopic.php?f=148&t=38203
-
The code I posted should solve just that. Check /debugscript 3
-
You're calling getPlayerName with a boolean value. Add an if statement to make sure that the player argument is an element: _getPlayerName = getPlayerName function getPlayerName(player) if (not isElement(player) or getElementType(player) ~= 'player') then return end if get("hexRemove") == "true" then if string.find(_getPlayerName(player), "#%x%x%x%x%x%x") then return string.gsub(_getPlayerName(player), "#%x%x%x%x%x%x", "") else return _getPlayerName(player) end else return _getPlayerName(player) end end
-
What's the problem exactly here? The code should solve the hud showing on join. If it doesn't, post any errors or warnings in /debugscript 3
-
Server: addEventHandler('onPlayerLogin', root, function() triggerClientEvent(source, 'showHud', resourceRoot) end) Client: addEvent('showHud', true) addEventHandler('showHud', root, function() addEventHandler("onClientHUDRender",getRootElement(), dxtest) end) Remove line 94 from the rest of the code.
-
dbExec returns a boolean value, mostly true unless the connection is incorrect. dbQuery returns a query handle which can be polled using dbPoll to get the returned data. It's mostly used with SELECT.
-
Yes. Use /debugscript 3 to check for any errors/warnings in your scripts. You can also use /debugdb 2 to set the logging level which could help you identify database problems in the future.
-
You haven't specified any columns for the table. The basic syntax is this: CREATE TABLE IF NOT EXISTS accounts (column1 TEXT, column2 INTEGER) Also, don't use dbQuery when you don't need to return anything.
-
Did you try what I told you to?
-
Post your code then. I checked it from the other topic, you're adding the handler as soon as the script starts. Use onPlayerLogin server-side to trigger a client event, add the on render handler in that event.
-
This is where the key is bound and the events handlers are added. addEventHandler("onClientResourceStart", getResourceRootElement(thisResource), Superman.Start, false) So you can just remove that and trigger an event to the client.
-
Are we supposed to figure out what's wrong with the screenshot? It looks fine to me. Is this related to your other topic?
-
I didn't understand a word but this should do. Server-side: function testing () setElementData(source, 'wins', (getElementData(source, 'wins') or 0) + 1) end addEventHandler ( "onPlayerFinish", root, testing )
-
Add to the Console group or the Admin group.
-
Use source not client, the triggerEvent line shows that the base element (source) is the player who finished the race. So, both client and kazanma is not defined. Why are you triggering a client event just to set the element data? You can do just that on the server-side.