-
Posts
1,050 -
Joined
-
Last visited
Everything posted by ViRuZGamiing
-
<meta> <script src="client.lua" type="client" /> <min_mta_version server="1.5.0-9.07439" /> </meta> Client: local x, y = guiGetScreenSize() local browser = createBrowser(x, y, true) addCommandHandler("lgn", function() loadBrowserURL(browser, "http://mta/local/login.html") addEventHandler("onClientRender", getRootElement(), function() dxDrawImage(0, 0, x, y, browser, 0, 0, 0, tocolor(255, 255, 255), true) end) end) File tree being:
-
Lol there is no part attaching it to the player, it's not good. It does work but that's not the question. Read the question
-
'without having to compile' read the question
-
Not sure if this will help but I found the MTA source code and the error you're getting: function edfLoadDefinition(fromResource, inResource, alreadyLoaded) local fromResourceName = getResourceName(fromResource) --get the EDF filename local definitionName = getResourceInfo(fromResource, "edf:definition") if not definitionName then return false end --try to load it local definitionRoot = xmlLoadFile(':' .. getResourceName(fromResource) .. '/' .. definitionName) if not definitionRoot then outputDebugString(fromResourceName .. ': couldn\'t load edf file', 1) return false end --etc.. https://github.com/multitheftauto/mtasa-resources/blob/master/[editor]/edf/edf.lua#L220 As I see and the error says, there's an error finding the file, are the Caps correctly? maybe try writing lowercase in meta and change the file name to be lowercase
-
then make sure the team name is indeed HassoN or change that
-
Remove if getPlayerTeam(v) == getTeamFromName("HassoN") then
-
Atom is quite good as well, especially when you have LUA installed it can show you compile errors
-
Not just the OS, reinstalling MTA does it as well (when deleting all remains, been there and used it as work around to create multiple accounts on a same server type) but about the code, what does Debuglog tell you at the moment, still boolean?
-
Do keep in mind the serial does change, for example reinstalling could change the serial and people won't be able to play from different pc's
-
getAccount(tostring(getPlayerSerial(source))) This won't give an error but would not work, since getAccount asks for a string that represents the username, you're giving a string that represents the user serial. Both are strings. I think you ment to do: getAccount(getPlayerName(source))
-
So I got it to work by changing the if state to check if instead of query that query[1] returns true. Appearantly Query did return true although it was empty. I think it's default like this: local query = { {} } which makes that query isn't nil cause query returns a table but that table is empty. addEventHandler ("onPlayerJoin", getRootElement(), function () local query = execQuery("SELECT username FROM users WHERE username = ?", {getPlayerName(source)}) if (query[1]) then outputChatBox("found! "..query[1]["username"]) else outputChatBox("didn't found username, inserting!") execQuery("INSERT INTO users (username) VALUES(?)", {getPlayerName(source)}) end end ) But I guess this isn't clean code probably
-
returns 0 strangely
-
how about giving it a name and checking isTimer() before creating? local timer if not isTimer(timer) then timer = setTimer(...) end
-
createMarker addEventHandler --"onMarkerHit" setPedStat
-
attempt to index field '?' (a nil value)
-
give the timer a name and kill it, killTimer()
-
By using math, screenX / 2 is the horizontal middle screenY / 2 is the vertical middle this gives the center.
- 4 replies
-
- dxdrawline
- dxdrawrectangle
-
(and 2 more)
Tagged with:
-
appearantly I'm not able to concate my query and I need to use:
-
Thanks for the clear answer!
-
Thanks!
-
I do know how that works, mine is just an analogue example to show you what I mean, I do know i'd need an onClientRender, etc. it could've been GUI as well, just an example. My question is all about a client OR server sided function which can be called from both client AND server side with the same name 'exported'. For example (as mentioned before): outputChatBox() which is both Server and Client sided (Shared Function)
-
I do know I'm a programmer in multiple languages, just not that good in LUA (C#, Java, VB.NET, HTML, Javascript + jQuery, PHP, and a bit of python if you're wondering) I just thought that would be my result if i'd do a SELECT * but since I did SELECT username I thought I'd just return 1 value. So it'd always returns an entire row?
-
So I do have to name them by 2 different names, it's not possible to have 1 name?