-
Posts
2,947 -
Joined
-
Last visited
Everything posted by JR10
-
The function list is made automatically using a script, so I have no idea why there is an xmlNodeFindChild function in _G.
-
N++ is highly customizable, you can add your own languages with syntax highlighting and auto completion. I had some free time last night so I decided to make it. I wrote a script that retrieves a list of all the available functions then exclude the deprecated ones, then made the language file with those functions. I also made a script to retrieve all the functions, get their wiki page content (fetchRemote) and extract the function signature from the page, then parse it into the MTA-Lua.xml file which adds auto completion. I might release the scripts later. I've created a repo for it on GitHub, it has 2 files for the users: mtalua-lang-import.xml > The file to import in the user defined language page to get the syntax highlighting MTA-Lua.xml > The auto completion file The repo contains the resource used to generate the function list and the node app used to retrieve the functions' syntax from the wiki. Repo: https://github.com/JR10/mta-npp THIS IS WHAT YOU WANT: Download the user files (MTA-Lua.xml and mtalua-lang-import.xml): https://github.com/JR10/mta-npp/release ... ta-npp.zip Steps: 1. Open Notepad++ > Language > Define your language... 2. Import > Select mtalua-lang-import.xml (Make sure from now on that the MTA-Lua language is always selected for Lua files) 3. Copy MTA-Lua.xml to your Notepad++ directory "Notepad++/plugins/APIs" (Usually in C:/Program Files) For questions, bug reports, suggestions or anything, just post here. Download: https://github.com/JR10/mta-npp/archive/master.zip
-
Done. Also removed all the resource theft and compilers as none of them are useful since the new MTA compiler. I've got it backed-up in case something needs to be brought back. Just tell me about it.
-
Your skill set describes a web designer not a developer. A web developer must be able to code server-side.
-
It would be better if you could link to the OOP Wikipedia page, it describes OOP in a more detailed way. Nice work!
-
This is not a place for requests. We can only help you with your code.
-
If your progress bar's value from the start is 0, then it would need 100 seconds to be filled. moveGate will be called after 5 seconds, the progress bar wouldn't equal 100 by that time, that's why it doesn't work.
-
There's no onAccountCreate. To create an account for a player you have to first create the account, using addAccount then logIn to log the player in. You'll have to modify the code where the account is created for the player to spawn him and give him the weapons.
-
And they have to worry about scamming and resource theft more than ever, let alone payments. Better focus on the mod itself.
-
This might help: https://wiki.multitheftauto.com/wiki/Call
-
That's not freedom of speech, that's false advertising.
-
Next time when you don't know how to make something, browser the wiki for examples. Here's one: --Server addEventHandler('onPlayerLogin', root, function() triggerClientEvent(source, 'showGUI', root) end) --Client addEvent('showGUI', true) addEventHandler('showGUI', root, function() --code to show the GUI end)
-
You can also use isTransferBoxActive with onClientRender to detect when the transfer box disappears.
-
local names = { 411 = 'Name' } function getVehicleName(model) return names[model] or 'Unknown' end You just need to export getVehicleName.
-
onPlayerLogin is a server-side only event, you need to use it server-side and trigger a client event that shows the GUI.
-
There is no setPlayerWantedLevel in your code. This is a very old code that I have, it's not perfect but it should do the job: addEventHandler("onPlayerDamage", root, function(attacker,weapon,bodypart,loss) if not attacker or attacker == source or getElementType ( attacker ) ~= "player" then return end setPlayerWantedLevel(attacker, getPlayerWantedLevel(attacker) + 1) end ) It still needs several checks, but that's for you to add.
-
I was talking about dxscoreboard already.
-
The scoreboard by default does not support images, only text. You will have to edit the scoreboard resource for this to work.
-
Try to explain a bit more. How are you adding them, functions? admin? Make sure the group exists.
-
Yes, you can simply disconnect before the script that deletes the file is ran. Best way to do this would be fetching the image content from the web and drawing it.
-
Try this: function drawText() local width1 = dxGetTextWidth(hexColorHome..homeName.."("..homeAlivePlayers.."):".."#ffffff "..displayHome, 1, 'default-bold') local width2 = dxGetTextWidth(hexColorVisit..visitName.."("..visitAlivePlayers.."):".."#ffffff "..displayVisit, 1, 'default-bold') local width = width1 > width2 and width1 or width2 dxDrawRectangle(sW-90,(sH/2)-50,width,40, tocolor(0,0,0,110)) dxDrawText ( hexColorHome..homeName.."("..homeAlivePlayers.."):".."#ffffff "..displayHome, sW-80, (sH/2.26), sW, sH, tocolor(255, 102, 1, 255), 1, "default-bold", 'right', 'center', false, false, false, true, true, 0, 0, 0) dxDrawText ( hexColorVisit..visitName.."("..visitAlivePlayers.."):".."#ffffff "..displayVisit, sW-80, (sH/2.17), sW, sH, tocolor(255, 0, 0, 255), 1, "default-bold", 'right', 'center', false, false, false, true, true, 0, 0, 0) end addEventHandler("onClientRender", root, drawText)
-
You store the two values in the same variable so it will only point to the width of the visitName text. Plus you're only drawing one rectangle. You need to learn more.
-
[HELP] MySQL - Query Datas and send it to the Client
JR10 replied to =KoG=Rouche's topic in Scripting
Try this: ---- MYSQL Connection ---- -- Create an connection object for the Database function connectDB() .... end -- Call the function to create a Connection Object function initVar() connect = connectDB() end addEventHandler("onResourceStart",root,initVar) -- When a player login it calls the readPlayerDatas function function init(_, account) account = "Blabla" -- Test Variable ! ##### readPlayerDatas(account) end addEventHandler("onPlayerLogin",root,init) function readPlayerDatas(account) -- Account must be a input variable from clientside -- Retrieve Player table datas from DB local playerData, EventsData, DMData, OLDData local function myCallBackPlayer(queryPlayer) local resultPlayer = dbPoll(queryPlayer,0) playerData = resultPlayer[1] end local queryPlayer = dbQuery(myCallBackPlayer,connect, "SELECT * FROM Player WHERE account = ?", account) -- Retrieve Events table datas from DB local function myCallBackEvents(queryEvents) local resultEvents = dbPoll(queryEvents,0) EventsData = resultEvents[1] end local queryEvents = dbQuery(myCallBackEvents,connect, "SELECT * FROM Events WHERE toPlayer = ?", account) -- Retrieve DM datas from DB local function myCallBackDM(queryDM) local resultDM = dbPoll(queryDM,0) DMData = resultDM[1] end local queryDM = dbQuery(myCallBackDM,connect, "SELECT * FROM DM WHERE toPlayer = ?", account) -- Retrieve OLD datas from DB local function myCallBackOLD(queryOLD) local resultOLD = dbPoll(queryOLD,0) OLDData = resultOLD[1] end local queryOLD = dbQuery(myCallBackOLD,connect, "SELECT * FROM OLD WHERE toPlayer = ?", account) -- Trigger an event clientside and send the previous datas with in triggerClientEvent(thePlayer,"onReplyFromReadDatas",root,playerData,EventsData,DMData,OLDData) end addEvent("onPlayerReadDatas",true) addEventHandler("onPlayerReadDatas",root,readPlayerDatas)