-
Posts
28 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Prever77
-
Yeah. I've seen this documentation. So much to start with xD. But yesterday i checked it and downloaded server folder from github repo. I thought that there will be more code. But for my luck that code is acceptably short. Like i guess still month to understand all functions, and how to call them. But one month to start code something is not that wrong. Anyway. Thank you so much for your help. For now i decided to make my own buffer system as module. As im not having problems with understanding C/C++ it will be easier even for me to make whole server as C code lol. I can make that module as lua script. But i like to keep everything organized. When i'll get courage to make that module. Maybe also i'll get will to make my own documentation and publish it. So no one longer gonna strugle with modules. Anyway. Thank you for your help again and your recomendations. From me i can recommend you getting in to C languages. Getting point of how them work improve also skills in lua. As you are "closer" to machine. I think that this topic can be locked.
-
Ofc you are right. and this should always be good advice for everyone to not mess with critical data. i know it, and more programmers should know that. i like to organize everything in hierarchy of importance. like cars possitions can be lost if something happens wrong. as that's not so crucial to server working after shutdown. and in database are still hold relativeley "fresh" data, like vehicle possitions and so on. But money and housing systems for examples are 1st or 2nd importance. so it must be sure that after buying a house money amount is right and house owner is assigned afap in buffer and database. and ofc validate everything. yeah i know that i can do that this way. but i was thinking about directly working with server objects. like buffermodule takes objects how they real look like. and scan only for lets say vehicles. and all previous ideas of how it will be implemented in lua. and make them in Cpp instead of lua. oldtable newtable etc. direct calling from module to built in dbFunctions should be faster in theory. and if i use some coroutines i can prevent that way server from lagging. but still keeping the lua code just to drive module. but i can mistaken somewhere and what i think can be fast. can also be not fast. on one side i can then keep everything hardly bounded together. but on the other side it can be error generating nightmare. what i know from experience in Cpp xD. and my question is. do i'm right about it? and if so. are there good sources to start with it? cause personaly i didn't found anything more usefull on the internet than example module. and ofc mta blue repo. im having in mind some sort of documentation. cause looking at servers source code just to get an idea of how module should look like and work pushes me back even from trying. im doing it everyday, so getting point of my mates is my second nature. but mta blue server is a lot of code. so i guess my natural questions are. if there is a chance that server can save 5% to 10% of power and space. is there any code documentation? so i can short my working time on module. ofc if im right that it can save cycles. i never wrote mta module, and didn't heard opinions of people who did. maybe someone is reading this rn. please get in to discussion. you can help me and others just by getting in to discussion. EDIT also thanks for earlier replying @IIYAMA
-
Maybe model has no plates, but defined texture one.
-
make sure that problem isn't on client side first. Does someone see it. Check your render distance. As everybody sets it different. If problem is on all clients. Try to separate LOD model. And work with your LOD as variable.
-
Ty so much for reply. Yes i had same thing in head about how buffer should look like. Changing only values that has changed etc. I didn't precised it well. By sending tables to database every 30s. i was thinking about mechanism that also stacks changed values to certain amount. Like old table and new table concept. Lets say im checking every 30s if cars changed their position. I compare old table with new. And values that has changed i move to some sort of stack. And stack is let say sent every 4 cycles of checking car positions. Before that stack is sent to database he's checked for latest values and reduced in size. By validating what comes from client i was thinking about putting clever anticheat trigger mechanism. Like while checking for changes. It's checking if that change was possible with my scripts for cars. Is car moving too fast or something. If it's. Then anticheat is triggered. and let me end here about anticheat mechanism. But ty also for mentioning your script. I'll take a look on it. Also by outside database i was thinking about LAMP thing in LANetwork on the other physical device. As i wanna only let one device to talk with the world. Just to reduce risk. Im sharing same network so i need to keep packs small so i have transfer reserved for server talking to trustfull world. Not exact desciption on purpouse here. Im having physical hardware so CPU and RAM are not problem. Problem is rational use of power. As i want to run my server independent. And made it most watt per player ratio effective. And keep it cheap. As im not planing earn money from server. Sorry for not mentioning details, but i didn't knew how to describe it all earlier and now too. as english is not my great side. Also ty for yours recommendations. Especialy about last one i forgot about that nice feature EDIT ADD Isn't it better for me to just make mta module that handle this stuff with multi core rather than single threaded lua? TheoreticaIy it should save me cycles on lua. And let them to be used more productive on bare bone server mechanics and scripting. And if so. what are good sources to begin with mta modules.
-
Hi. Long story short. I made year or two ago my own package of scripts for role play server, which i never started. 3 months ago i decided to rewrite everything. As i looked at it and said "what a mess. Who wrote this?" meanwhile i've gained experience in C and good habits, so choice to rewrite everything was obvious for me at that moment. So i did basic optimisation. What can be stored and should be in bools is now stored in bools. not 1 and 20s lol. etc etc But for now i hitted the wall. Which is named "to buffer. Or not to". By that i mean. My scripts are connected to outside database as built in database is.. well not so fast and secure. And i didn't used to do that mechanism in original code. But i think it's rational to store very often pulled data from database localy on server memory. And update tables in parts to database like every 30seconds. Also i want to use buffer data and database to validate what comes from client side. Im storing vehicles on map, their custom data etc etc. And here's my main questions. 1.is it worth of effiord to make buffer if i plan 80-200 players on my server. 2.is validating client data with buffer and database worth concept 3.what are your coding advices for me?. Im Asking experienced ones that ruled servers with large player base. --[[btw i know that if server has 3 players buffer is not needed. Thanks, awesome advice.--]]
-
Hi. i've came here with specific question. is it possible to convert Blue in any way to run with GTA 3 as DLL like regular MTA:SA? they are pretty the same games i guess. i know for sure that there can be difference in game functions and blue server must be modified etc etc. but is it possible? i wanted to start modifying MTA Blue in purpose of running it with GTA 3. so i started to think that it would be easiest if i find Blue 1.0. But oldest i found on GitHub repo was in version 1.4.7. And here comes second question. Is it good way of making it by starting with older versions of Blue? Also i don't know where to start and how MTA really works. if i understand right. it takes GTASA executable and forces it to things by injecting functions. but is it right i don't really know. if someone can help me, i'll be so thankfull. i really like playing GTA 3. don't get me wrong. SA is nice. but in my hearth only 3 Exist. and i wanted to make MTASA functionality in GTA3. i know that there are projects in this direction. but i'm not interested in 0.5r2 etc etc. to get all functionality of MTA to gta3 servers. i know C language. but i'm asking someone who knows better. before i jump to code and disappoint my self after realizing that it's not possible. Sorry for my english. it's not my native language.
-
I also wanted to make module to my server. But everything i found then was Example module code and MTA modules . On the internet there is not that much useful informations about coding modules in C++. Many example modules are soo old and outdated. For sure you need Lua liblary dll. And knowledge of MTA code that is here Mtasa-blue. I know that is not much. But it's better than nothing. I give up with coding modules. Maybe you have more luck keep going dude Edit1# down the rabbit whole Edit2# in pressent days. I don't see any sense of making modules. There is so much functionality in lua scripts provided by MTA. You can do many things faster by typing lua code, rather than making module from absolute zero. ofc this puts more load on the server. But it's a lot easier. Ofc this is only my personal opinion. If i'm wrong, then correct me someone.
-
Server Side Client Side ElementTree
-
If you are using Linux you can use easely linux API. If Mac or Windows. The easiest way is to use WEB tool https://luac.mtasa.com/. It compiles lua code, idk how about model files.
-
Ok. You can do it by three options. First is by defining cache in meta xml <file src="car.txd" chache="false" /> This will cause that models will be loaded only to dynamic memory (RAM) Nothing lands on hard drive. But every time client connects with server. He needs to download resource every time. If your hosting is so poor. And upload speeds are more like, communicating with voyager 1 . This will not pass the test. For example. Client 1 joined to server first time. He's speed connection is realy poor. He waited 20minutes to join the server. He loged out. And on the next day joined again. But this time he will wait 5minutes to download resource that he downloaded yesterday but not saved on HD. If server network speed condition will be same or worser than Clients 1. Then time will be doubled. Second way is to use fileDelete() This will do simmilar thing. But this can sometimes cause issues. To be honest, i used it once. And it makes things more complicated. Third way is to compile code. This can be useful in pair with xml cache. But only if you want to secure something very fragile on client side. Idk maybe you made hashing password system on client side. (Which is terrible idea) and you want to secure this script from being seen by third person.
-
By "Vehicle mod" you mean. Vehicle txd files ? btw links doesn't work
-
local con = dbConnect("mysql","dbname=<database name>;host=127.0.0.1","login","password","share=1") addEventHandler("onResourceStart",resourceRoot,check) local function check() if con then outputServerLog("[database] connected with server") dbQuery(con,'SET NAMES utf8;') else outputServerLog("[database] can't find connection point") end end function set(x) if x then dbExec(con,x) end end function get(y) if y then local rawtab = dbQuery(con,y) local tab = dbPoll(rawtab,200) return tab end end Now XML file <meta> <script src="sside.lua" /> <export function="set" type="server" /> <export function="get" type="server" /> </meta> I did not tested it. But it should work. But remember that you need to call functions get() and set() with exports like: function thatDoSomething() if something then exports['x-x']:get('your php code') --use this if your resource have a special characters or-- exports.xx.get() --this for resource without specialcharacters --ofc xx is name of your resource end end
-
Hi. I have came here with small question. I've made login panel. And everything works fine with standard sha256 function. But i want add salt to passwords and i have no idea how to do it.maybe someone of you can help. Thanks function etcetc(pass,log) --pass is string if log and pass then local passwd = sha256(pass+"salt") dbQuery(myBasePass,"INSERT etc etc.."passwd" ") end --i realy don't know what i'm doing xDD, maybe --it's time for sleep Edit1 Nevermind. Contagenation in lua is made by two dots operand. Small thing. And can take whole day.
-
Ok. I think that i understand now. So i can make new dimension by chosing id from range 2^16 and set weather,fog,colorfilter etc. of that dimension. Add elemenets etc etc. Thank you so much for help guys. I think this topic can be closed
-
So, just by finding empty dimension or dimension with few elements. I can destroy them and place new ones if i understand it right? Standard world dimension 0 have clouds and skybox. Is it possible to set dimensions sky by any way ? Just wondering on that, cause i wanna to make new island. And gray sky like british weather isn't something that i really need.
-
Hi. Is it possible to create new empty dimensions. If so. How i can do it. I cannot find anything usefull about this topic.
-
Everything you need is isVehicleBlown and DestroyElement and maybe few lines of code that moves vehicle to some sort of garage. Idk maybe something like this if isVehicleBlown(vehicle) == true then DestroyElement(vehicle) dbExec(pass,"UPDATE garage SET statusIn=1 or true") else return end end I didn't tested it. But it would be something like this if your cars are stored in MySQL database. You can close it in Timer for example or event
-
After few modification code works fine. Your PHP line helped a lot. Thanks I think topic can be closed
-
Hi. I wanted to make timer on server side that will updating players money. Cause my money in the corner are based on custom dxText that download money status from getPlayerMoney. And here i have a problem. When i want to setPlayerMoney ,from database i still receive only playername. For sure i did something wrong. I checked PHP code in my SQL tab (XAMPP) and it worked as intended. Here is the code. Please Help. I'll be thankfull local dbc = dbConnect("") setTimer("onClientRender",function(nick) local pn = getPlayerName local dbq = dbQuery(dbc,"SELECT money FROM users WHERE nickname='pn'") setPlayerMoney(pn,dbq)1000,0) in dbc is defined utf8, same as my sql database Edit1 and variable coming from database should be INT
-
Nie jestem pewien. Ale to raczej nie w blenderze. Zobacz może to. https://wiki.multitheftauto.com/wiki/CreateLight Edit#1 Na pewno widziałem taki efekt na neonach. Jakiś to serwer był ale jaki? To nie pamiętam
-
Hi this is my first script made by me. I wan't make RP server and i made this script for that purpouse. Script have small problems. Like burning car for very short period of time after hitting elements. And vehicles aren't always protected from exploding. Like hitting gas station by car. Or picking down to the ground by plane. Edit 1# Script is only server side https://community.multitheftauto.com/index.php?p=resources&s=details&id=18831 I'm opened for sugestions and opinions. Have a nice day
-
Link nie działa
