Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 19/04/19 in Posts

  1. Due to the fact, that each of the scripts are running over an own virtual machine you need to avoid from call export functions often, like in a render loops for a better performance. I suggest to get the language text on the resourceStart and store them in each scripts. It will be costs more ram, but you will save CPU as @IIYAMA said. My experiences that we need to save more CPU usage rather than RAM for a better performance. ~o~ Arra a tényre alapozva, hogy a scriptjeid mindegyike egy külön Lua virtuális gépen futnak, a közöttük lévő kommunikáció viszonylag lassabb, ezért nem ajánlom az export funkciókat sokszor hívni, mint például egy onClientRender-rel megfuttatott funkcióban. Azt ajánlom, hogy kérd ki a szükséges szövegeket a resource indulásakor és tárold őket lokálisan. A tapasztalatom azt mutatja, hogy jobb teljesítményt lehet elérni akkor, ha inkább RAM-ot használsz mint CPU erőforrást.
    3 points
  2. About SAPD:FR Online is mainly based on the popular GTA:SA SAPD:FR mod and it's aim is to bring the fun online and allow players to patrol together, assist other player officers, etc. This project has been going on for a few years already and has had it's ups and down, it also used to be known as FR:MP & 7Precint before receiving it's current SAPD:FR Online name. Originally it has been created by the original creators of SAPD:FR Palm Beach Games (previously known as FR Mods) and was officially taken over by Advanced Gaming near the end of 2016 through a signed contract. Our aim is to bring as realistic and fun at the same time police experience with the Non Player Characters (NPCs) spread around the map being potential fellas that are up to no good. The server gives ability for players to progress through the ranks by arresting criminals, respond to callouts that have different variety of possibilities to happen every time, patrol inside of the patrol zones, simply have fun with your friends or other players, pursuit suspects both on foot and in vehicles, do speed traps, etc. Features The server has quite a lot of features in store for the players to have fun with and the best part is that the features only keep expanding further and further with our weekly updates. Some noteable features are: Ability to patrol in 6 different departments, 3 Sheriff Departments and 3 Police Departments which have different ranking structure and each seperated into "saves" which save your progress in a specific department Callout system which contains a lot of different callout each which can have different outcomes when either you arrive on scene or try to interact with the Non Player Characters (NPCs), these vary from simple callouts such as injured person to somewhat big callouts such as armored truck robbery, street brawls, etc. A ELM system which lets you switch both your primary and secondary lights through different modes, 15 modes to be exact A neatly designed HUD which gives you the most cruical information such as your current level, exp amount, callout that you're in (if any), money, vehicle you're in, speedometer, zone that you're in, etc. Patrol zones which let you patrol around San Andreas for a small experience reward Multiple additional unmarked vehicles that have been designed by our outstanding modder ThatOneIowan Rank system which unlock different vehicles, equipment, etc. A dispatch (aka Central) with which you can interact to check for civilian's background, vehicle's information, request backup, inform that there's an armed suspect, request prisoner transport, etc. Ability to request special units which will assist you in different occasions, such as medics for injured civilians, towtrucks for vehicles that are in the way, etc. Ability to request backup to which other players can respond to Ability to see every unit's locations by opening the map on F11, each unit's number is displayed there Ability to interact with Non Player Characters (NPCs), ask them for their IDs, frisk them, arrest them, perform requests such as sit, flee, pursue them (if they evade), and much more Ability to install mods by just dragging them into a folder (full explanation of the system is available on our forums) Edited vehicle handlings to match IRL acceleration and top speeds and let you travel through San Andreas faster than originally intended by the game Multiple translations for our non English speaking players Helper system which lets new players use /ask to ask a question Simple Pay 'n' Spray script which lets you fix your vehicles for free Inventory system which lets you hold multiple items, in addition to this each precint has a officer vendor at which you can buy (or take) items such as armor, medical kits, spikestrips, vehicle repair kits and more Multiple precints spread around the major cities which players can use to arrest their suspects or reach vendors NEW Ability to play as a medic unit And much more! Updates & community feedback The script itself is being updated weekly, every saturday to be exact. Due to the script being a few years old we're focused onto polishing it as much as we can while also adding more fun features for you guys to use. We respect our community's feedback and are quite happy with the fact that they've already gave us 4 forum pages worth of suggestions to deal with. We may not add those suggestions as fast as some would expect but that's because we either need other features for it to get added or we have some more important focuses onto them, but we can assure you any suggestion we like will be eventually added in, so far we've added in 30+ different suggestions into the server and don't plan on stopping anytime soon. In addition, the server tends to undergo some major changes sometimes and to prevent us from making a mistake with such ideas we create public polls on our forums and notify our members everywhere about it to let them give their vote and also post their opinion on that. If the majority votes against it then ofcourse, we scratch the idea and make something else instead. Media Ever since the server started our users have been posting media around youtube, our facebook inbox or the forums. We're also happy to say that we've inspired few people to start youtube channels as well as have an long active youtube member recording videos in the server actively. Therefore, before the media we'd like to point out some channels that you might want to check if you're interested in seeing more of the server: Unit23OnPatrol Unit 170 Officer371 Unit 28 Videos: **All of the following media is created by our users, full credits go to them** Screenshots: **Warning: a lot of pictures inside of the spoiler** Social Media SAPD:FR Online Website Forum Discord: https://discordapp.com/invite/0sefStnGcNuXyA8u Where to join? IP: mtasa://37.187.250.129:22103
    1 point
  3. Slipe is an open source framework that enables anyone to write scripts for MTA:San Andreas in C# instead of Lua, wrapping all MTA elements and classes and including some .NET Core namespaces. It is based on CSharp.Lua by Yang Huan. Slipe features: Runs on Windows and Linux Built in continuous deployment support with (GitHub) webhooks Object oriented wrappers for all MTA elements Async/await for MTA functions that use callbacks C# style Http requests, sockets and XML methods. Use Visual Studio and its Intellisense Type safety You can find more information about the project on https://prod.mta-slipe.com. Our Discord Our Github The project is still in Alpha, and since it is open source anyone is welcome to contribute
    1 point
  4. Já responderam, deixe um like nas minhas respostas já que te ajudei, você me ajuda desta forma xD, só clicar no icone de coração aqui nos meus comentarios.
    1 point
  5. Pra fazer isso você deve escolher um resource pra baixar por último e setar prioridade negativa nele no meta.xml e logicamente o resource que vai baixar primeiro que todos que seria o de tela de download, bem no resource de tela de download você pode fazer assim, fiz um exemplo aqui: local screen = { guiGetScreenSize () } function renderLoading () if getElementData (localPlayer, "downloaded") then -- Se o player tiver essa data, vai cancelar este render e depois remover essa data, que não será mais utilizada nesta sessão. removeEventHandler ("onClientRender", getRootElement(), renderLoading) setElementData (localPlayer, "downloaded", false) end dxDrawText("Baixando Resources...", 0, 0, screen[1], screen[2], tocolor(255, 255, 255, 255), 1, "clear", "center", "center", false, false, true) end addEventHandler ("onClientRender", getRootElement(), renderLoading) Agora no resource que você setar prioridade negativa pra iniciar por último faça assim: function closeScreen () setElementData (localPlayer, "downloaded", true) end addEventHandler ("onClientResourceStart", resourceRoot, closeScreen)
    1 point
  6. الاسم زرفته و الافتار زرفته وش باقي ؟ ?
    1 point
  7. @#DeltaSCR Vc quis dizer server-side
    1 point
  8. @Gabriel63495 Use este botão em vez de colar código direto no texto.
    1 point
  9. Isso não faz sentido! Aquele terceiro print faz exatamente a mesma coisa que no seu script, ele pega a vida da carga e mostra no debug. Não tem como dar erro na sua comparação por valor booleano. Edit: NOOSSAAA! Descobri! No seu script vc fez assim: if not getElementHealth( Carga_Disel ) <= 350 then -- Se (não número) é menor ou igual a 350, então: -- QUE É O MESMO QUE: Se (false) é menor ou igual a 350, então: ERRO -- Mas vc quis dizer: if not (getElementHealth (Carga_Disel) <= 350) then -- Se (vida da carga NÃO É menor ou igual a 350), então: -- Que seguindo uma lógica mais otimizada de acordo com as boas práticas de programação, pode ser escrita como: if (getElementHealth (Carga_Disel) > 350) then -- Se (vida da carga é maior que 350), então: Faça assim: if getElementHealth (Carga_Disel) > 350 then
    1 point
  10. https://github.com/Bonsai11/Multigamemode this resource might help you as it deals with loading map script files for specific player ( only client sided but might give you an idea on how to do it). CCS_wrapper This resources handles the loading of map scripts. Only clientside scripts are supported. CSS_wrapper is what you are looking for !
    1 point
  11. In my opinion you can attach this table to the resource using setElementData(getResourceRootElement(getThisResource()),"texts",texts,false) -- keep this table client side and then you can get this table from anywhere on the server using getElementData(getResourceRootElement(getResourceFromName("resource")),"texts") -- client side and i think it will take less CPU but more ram.
    1 point
  12. You mean protection from stealers? Or access to files from different resources?
    1 point
  13. Well, I have done some test and looks that it is getting a better look. Btw, which one should be the way to test if my code is vulnerable to be read by those codes ? Tried with fileOpen, fileread ...etc but not success. (Obyously, the enviroment is removed during this test.)
    1 point
  14. Fíjate en el archivo c_snow_ground.lua, hay un evento que activa o desactiva la nieve: triggerEvent( "switchGoundSnow", resourceRoot, not bEffectEnabled ) Deberías borrar todas las funciones que lo activan (el bind del F7 por ejemplo) y hacer un evento personalizado para luego ejecutarlo al entrar en la zona o scriptearlo directamente en el archivo.
    1 point
  15. @holuzs As long as you do not use a database, it will be hardly noticeable. This whole table + it's sub-tables are located in the ram and will be available without much delay. And exporting will use a bit more CPU than a normal function call, but it will save RAM because you only have 1 location for the data.
    1 point
  16. Se poder deixar um thanks como agradecimento em minhas respostas agradeço <=3 Só clicar no icone de coração
    1 point
  17. local chat_range = 100 function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end addEventHandler ("onPlayerChat", root, function (msg, type) if type == 0 then cancelEvent () end end ) function MensagemTwitter (source, cmd, ...) local MessagemT = table.concat ( { ... }, " " ) local name = getPlayerName(source); local everybody = getElementsByType("player") for _, v in ipairs(everybody) do outputChatBox("᠉ #00BFFFTwitter- #ffffff"..name.."#00BFFF - #FFFFFF"..MessagemT, v, 255, 255, 255, true) end end addCommandHandler ("Twitter", MensagemTwitter) addCommandHandler ("DeepWeb", function (source, cmd, ...) local message2 = #{...} > 0 and table.concat({...}," ") or nil if message2 then local everybody = getElementsByType("player") for _, p in ipairs (everybody) do if hasObjectPermissionTo(p, "command.mute", true) then outputChatBox("᠉ #696969 DeepWeb- #696969"..message2, p, 255, 255, 255, true) end end end end) addEventHandler ("onPlayerJoin", getRootElement(), function () bindKey (source, "u", "down", "chatbox", "DeepWeb") bindKey (source, "o", "down", "chatbox", "Twitter") end ) addEventHandler ("onResourceStart", resourceRoot, function () local everybody = getElementsByType("player") for index, player in pairs(everybody) do bindKey (player,"u", "down", "chatbox", "DeepWeb") bindKey (player,"o", "down", "chatbox", "Twitter") end end )
    1 point
  18. O chat twitter coloquei na tecla t '-'
    1 point
  19. Editei, tente novamente, acho que você esta com o chat padrão do freeroam ativo, você tem que tirar ele colega.
    1 point
  20. Tenta assim: local chat_range = 100 function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end addEventHandler ("onPlayerChat", root, function (msg, type) if type == 0 then cancelEvent () local mainChatDelay = 1000 if chatTime[source] and chatTime[source] + mainChatDelay > getTickCount() then return outputChatBox ("Não floode....", source, 255, 50, 50, true) else chatTime[source] = getTickCount() end if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ("Everyone")) then outputChatBox("᠉ #00BFFFTwitter- #ffffff"..getPlayerName(source).."#00BFFF - #FFFFFF"..msg, root, 255, 255, 255, true) end end end ) addCommandHandler ("DeepWeb", function (source, cmd, ...) local message2 = #{...} > 0 and table.concat({...}," ") or nil if message2 then local everybody = getElementsByType("player") for _, p in ipairs (everybody) do if hasObjectPermissionTo(p, "command.mute", true) then outputChatBox("᠉ #696969 DeepWeb- #696969"..message2, p, 255, 255, 255, true) end end end end) addEventHandler ("onPlayerJoin", getRootElement(), function () bindKey(source, "u", "down", "chatbox", "DeepWeb") end ) addEventHandler ("onResourceStart", resourceRoot, function () local everybody = getElementsByType("player") for index, player in pairs(everybody) do bindKey(player,"u", "down", "chatbox", "DeepWeb") end end )
    1 point
  21. Manda o codigo do seu chat twitter aí.
    1 point
  22. Aperte 't' e envie uma mensagem tire print e mostre aqui por favor, poste a print.
    1 point
  23. Então, você tem que achar aonde ta esse código provavelmente esta no seu freeroam.
    1 point
  24. Mas no chat 't' está saindo alguma mensagem quando você digita algo e da enter?
    1 point
  25. 1. Você deve achar aonde esta esse chat do 't' ai que você diz.
    1 point
  26. Então, coloque o chat twitter como principal, onde nele você pode usar os comandos enviar mensagens normalmente etc, e o chat deepweeb pra conversar somente.
    1 point
  27. 1 point
  28. Use getPedTotalAmmo e compare com o valor obtido da editbox.
    1 point
  29. but what about if I want to block some variables/arrays ?
    1 point
  30. newEnv = {} setmetatable(newEnv,{__index=_G}) local fnc = loadstring(code) if fnc then setfenv(fnc,newEnv) fnc() end Maybe this can be better for new enviroment
    1 point
  31. @IIYAMA Well, as far as I read pcall executes the string and if it detecs an error it just ignores it. So, the code should be like this local resourceRoot = createElement("resourceRootFaked") local enviroment = {} local blockedFunctions = { ["enviroment"] = true, ["newEnviroment"] = true, } function newEnviroment() enviroment = {} for name, valor in pairs(_G) do if not blockedFunctions[name] then enviroment[name] = valor end end end function runScript(scriptData, executeIt) newEnviroment() local loaded = loadstring(script) local ex = pcall(loaded) setfenv(ex, enviroment) if ex then if executeIt then triggerEvent("onClientResourceStart", resourceRoot, getResourceFromName("scriptLoaderResource")) end end end
    1 point
  32. Not really, pcall is already running the code. After that you are calling it without pcall again. pcall(loaded) -- call 1 loaded() -- call 2 Note: pcall executions do hide most of the debug information. So even if you did debug it, you wouldn't have noticed it. It is recommended to develop without pcall and when you are finish use it. I also saw you use triggerEvent on the resourceRoot. It is better if you do NOT use that at first. It is very important to understand that you can't just use the same element for all the resources. It will go bad... If you really want to use that. Top: local resourceRoot = createElement("resourceRootFaked") Bottom: triggerEvent("onClientResourceStart", resourceRoot, getResourceFromName("scriptLoaderResource")) And try to use the setfenv function as I have recommended before. In your current code all the global variables are exposed.
    1 point
  33. look into shader examples on wiki, mainly shader_bloom to see how to set texture for dxDrawImage.
    1 point
  34. Oh, you thief... ? It's my signature xd
    1 point
  35. Update 1.0.24 is now live! Features the fully rewritten patrol zones: Full changelog
    1 point
  36. Just a really small taste of what's coming with the medical update:
    1 point
  37. Well I've let this thread get quite some dust on it as I haven't attended to it in a while. So, instead of making a whole new reply on how we released the 1.0.23 I'll just give a short recap on what's been going on at SAPD:FR Online lately: Update 1.0.23 was released, yet another minor update with some bug fixes and requested changes by the players. In addition to that Tosfera has returned to the MTA:SA branch of SAPD:FR Online and is slowly starting with the work on the long promised EMS and FD updates. Due to the summer season ending I have also managed to get more free time and will be a lot more active in terms of scripting on the server, these two changes in the development will result in bigger and faster updates (yay!). Through this reply I'd like to thank all of our players that are quite active in the server as well as our amazing staff members Nick & Caracatus1 for keeping the server clear from up to no good guys during the summer, hopefully you guys will like the future updates as we can assure you that we'll do our best in them.
    1 point
  38. Update 1.0.22 Update 1.0.22 is now live! Just some minor improvements to the tow truck units feature & bug fixes. Changelog: Towtruck units are marked yellow on the minimap & the F11 map from now on Towtruck units will no longer recieve callouts Fixed a rare occurance in which Armored Truck Robbery callout vehicles would blow up Fixed evading suspects walking styles sometimes being reset to CJ's resulting into players not being able to catch up to them & more Full changelog can be found here.
    1 point
  39. Update 1.0.21 Update 1.0.21 is now live! It comes with the long requested tow truck system. Changelog: Fixed players being unable to get NPCs out of their vehicles in rare occurances Added ability for players to do towtruck related duties Made some minor adjustments to player prisoner transport system Full changelog can be found here.
    1 point
  40. Update 1.0.20 This week's update has been mainly aimed to minor improvements to the existing scripts as well as minor script clean ups, in addition a new feature worth mentioning is the unmarked Yosemite which has been made for us by our modder ThatOneIowan, therefore big thanks to him once again. This vehicle is the first pickup type vehicle to come to SAPD:FR Online and I just can't wait to see what the modders come up with when creating vehicles for it, so far they failed to disappoint us and I'm sure it'll keep that way with the pickup vehicles. Changelog is as follows: Added unmarked Yosemite Fixed partner system bugs that occured after accepting callouts Increased NPCs density from 0.20 to 0.25 Minor adjustments to the exp system, aimed to the Administrator's side Added 2 more locations to the armored truck robbery callout Full changelog can be found here.
    1 point
  41. It has come to our attention that our response to support related forum threads can be sometimes rather slow. This is due to the fact that most of our staff team has work, college or school to attend and therefore we're not able to respond that fast on the forum. However, due to us having access to our phones we tend to answer support related questions on Discord a lot faster than the forums, therefore if you have an issue that you would like to resolve quicker please use the Discord to which link you can find on the original post. Ofcourse, as the answers tend to usually come from our phones we'd like to apologize for any grammar mistakes in advance.
    1 point
  42. Update 1.0.19 Update 1.0.19 is now live on the main server! Thanks to the big help from our beta tester team we've finally managed to push in the long awaited partner patrol system, changelog is as follows: Removed GTA:SA speed limiter that occured on roads such as LS Skate Park, SF Bridge, Vinewood to Jefferson connection, etc (courtesy of MTA:SA's 1.5.4 update) Increased weapon damages to increase realism Added the long awaited partner patrol system For full changelog which includes all of the things that were added to the partner patrol please procceed to our forum thread.
    1 point
×
×
  • Create New...