Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 23/02/19 in all areas

  1. Use o resource ipb que já vem instalado no servidor. Ele mostra quanto cada resource está consumindo do seu servidor. Pra abrir a interface dele use /ipb
    2 points
  2. Hi, Because we have an atmosphere called winter, why is it only in reality? Abo, because you do not have this script that will add a winter climate to your server and its players. Together with the team, we have created another project! F7 - turning off the snow on the screen Download: https://www55.zippyshare.com/v/cwmhgfTo/file.html Video:
    1 point
  3. 'split' essa função que eu estava procurando, obrigado, ficará bem mais fácil agr
    1 point
  4. Falei sobre isso no seu outro tópico, você pode separar esses valores com vírgula e obter cada um com a função split: setElementData(localPlayer, "BoneClothes", "1,1,0,1" ) local bclothes = getElementData(localPlayer, "BoneClothes" ) if bclothes then local v = split( playerPosData, ',' ) iprint( v ) end
    1 point
  5. Account-data é utilizado para salvar e carregar os dados. Se vai pesar no banco de dados setando várias vezes, aí eu não sei se vai mesmo afetar ou o quanto vai afeitar. Você pode otimizar o salvamento definindo múltiplos valores para um registro, exemplo: local x,y,z = getElementPosition(thePlayer) local _,_,rot = getElementRotation(thePlayer) local acc = getPlayerAccount(thePlayer) -- não recomendado setAccountData( acc, "player_x", tostring(x) ) setAccountData( acc, "player_y", tostring(y) ) setAccountData( acc, "player_y", tostring(z) ) setAccountData( acc, "player_rot", tostring(rot) ) Otimizando: local x,y,z = getElementPosition(thePlayer) local _,_,rot = getElementRotation(thePlayer) local acc = getPlayerAccount(thePlayer) -- Com JSON setAccountData( acc, "player_pos", toJSON( {x, y, z, rot} ) ) -- Ou: setAccountData( acc, "player_pos", tostring(x)..", "..tostring(y)..", "..tostring(z)..", "..tostring(rot) ) Você pode usar esta função para reduzir o tamanho decimal: https://wiki.multitheftauto.com/wiki/Math.round; Ou a função Lua string.format() Com string.format: local p_pos = string.format( "%.4f,%.4f,%.4f,%.4f", x,y,z,rot ) -- salvando na conta: setAccountData( acc, "player_pos", p_pos ) Obtendo os valores separados por vírgula e JSON: local playerPosData = getAccountData( acc, "player_pos" ) if playerPosData then local pos = split( playerPosData, ',' ) local x,y,z,rot = pos[1], pos[2], pos[3], pos[4] end -- Obtendo os valores salvos com JSON: local playerPosData = getAccountData( acc, "player_pos" ) if playerPosData then local pos = fromJSON( playerPosData ) local x,y,z,rot = pos[1], pos[2], pos[3], pos[4] end Saí um pouco do assunto. Mas voltando ao que você mencionou da Wiki sobre account-data: Na verdade isso se aplica ao element-data, é recomendado evitar o excesso de setElementData sincronizado entre client/server para ter o menor uso de tráfego de rede. E também substituir o seu uso por tabelas preferencialmente. Para ver o desemprenho/performance dos seus scripts tem o resource ipb já mencionado e o performancebrowser que você pode analisar também o lado cliente. Sobre usar 50 account-data, sinceramente eu nunca usei essa quantidade em cada conta, você pode reduzir a quantidade de registros por fazer uma compactação com os métodos mostrados acima. Você também pode optar pelo banco de dados SQL.
    1 point
  6. كنت تقدر تكمل في نفس موضوعك بدل ما تفتح موضوع جديد قصدي تعرف الفنكشنات يعني تفهم معناهم ______ 1 - xmlLoadFile طبعا لازم قبل ما تكتب او تجيب شئ من ملف اكس ام ال لازم تحملوا اولا xmlLoadFile( "مسار الملف بتاعك" ) 2 - xmlFindChild() الفنكشن دا يدورلك الخانة اللي في ملف الاكس ام ال بالاسم xmlFindChild( xmlFile , "Child Name" , 0 ) 3 - xmlNodeGetValue دا بقا يجيبلك القيمة اللي في الخانة <test> -- دي الخانة "hi :)" -- القيمة </test>-- دي الخانة xmlNodeGetValue( xmlNode --[[ طبعا تجيبها من خلال الفنكشن اللي فات --]] ) : مثال server.lua : addCommandHandler( '1' , function( player ) local xmlFile = xmlLoadFile( "MapPos.xml" ) if( not xmlFile ) then return outputChatBox( "تأكد من اسم الملف او مساره" ) end local posNode = xmlFindChild( xmlFile , "pos1" , 0 ) if( posNode ) then local Position = split( xmlNodeGetValue( posNode ) , ',' ) ; if( type( Position ) == 'table' and #Position == 3 ) then setElementPosition( player , Position[1] , Position[2] , Position[3] ) end end xmlUnloadFile( xmlFile ) end ) MapPos.xml : <map> <pos1>"1230.15498,4562.13678,10.2132132"</pos1> </map>
    1 point
  7. addEvent("CreateGroup",true) addEventHandler("CreateGroup",root,function(Clan) local accountName = getElementData(source,"AccountName") local CheckClan = executeSQLQuery("SELECT * FROM ClanSistemi WHERE Clan=?",tostring(Clan)) if ( type(CheckClan) == "table" and #CheckClan == 0 or not CheckClan ) then if getPlayerMoney(source) >= 500000 then executeSQLQuery("INSERT INTO ClanSistemi (Account,Clan,RankPlayer,Kurucu,Event,Ruel) VALUES (?,?,?,?,?,?)",tostring(accountName),tostring(Clan),tostring("Kurucu"),tostring(string.gsub(getPlayerName(source),"#%x%x%x%x%x%x","")),tostring("Yok"),tostring("Yok")) executeSQLQuery("INSERT INTO ClanSistemiUyeler (Account,Clan,RankPlayer,State,Name) VALUES (?,?,?,?,?)",tostring(accountName),tostring(Clan),tostring("Kurucu"),tostring("Açık"),tostring(string.gsub(getPlayerName(source),"#%x%x%x%x%x%x",""))) executeSQLQuery("INSERT INTO ClanSistemiBanka (Clan,Banka) VALUES (?,?)",tostring(Clan),tostring("10000")) executeSQLQuery("INSERT INTO ClanSistemiLevel (Clan,Level) VALUES (?,?)",tostring(Clan),tostring("1")) executeSQLQuery("INSERT INTO ClanSistemiRENK (Clan,R,G,B) VALUES (?,?,?,?)",tostring(Clan),math.random(1,255),math.random(1,255),math.random(1,255)) _outputChatBox("Clanı Başarıyla Oluşturdun | "..tostring(Clan).."",source,0,255,255,true) triggerEvent("onPlayerCreatedGroup",source,source,Clan) setElementData(resourceRoot,"Event"..Clan.."","Yok") setElementData(resourceRoot,"Ruel"..Clan.."","Yok") setElementData(resourceRoot,"Kurucu"..Clan.."",tostring(string.gsub(getPlayerName(source),"#%x%x%x%x%x%x",""))) setElementData(resourceRoot,"Banka"..Clan.."","10000") setElementData(resourceRoot,"Level"..Clan.."","1") setElementData(source,"Clan",tostring(Clan)) setElementData(source,"RankPlayer",tostring("Kurucu")) takePlayerMoney(source,500000) --[[for _,plrs in ipairs (getElementsByType("player")) do getAllGroups(plrs) end--]] else outputChatBox("Clan Kurabilmen İçin $500.000 İhtiyacın Var",source,255,0,0,true) end else outputChatBox("Bu Clan Adı Kullanılamaz",source,255,0,0,true) Use this
    1 point
  8. أ، ب، ت، ث، ج، ح، خ، د، ذ، ر، ز، س، ش، ص، ض، ط، ظ، ع، غ، ف، ق، ك، ل، م، ن، هـ، و، ي تصير لي جارية ؟
    1 point
  9. شوف يغالي اولا يبيلك تعرف فنكشنات الاكس ام ال xmlCreateFile ; xmlLoadFile xmlFindChild xmlNodeGetValue وبعد كدا تحطهم في جريد ليست او شيك بوكس المهم براحتك يالتوفيق
    1 point
  10. اطرح محاولتك , عشان نساعدك ..
    1 point
  11. وين محاولاتك يا غالي ؟
    1 point
  12. Nunca resetei a internal.db e verifiquei se remove tudo. Nesses casos te recomendo fazer pela própria internal, nela vai ter 3 tabelas: accounts, userdata e serialusage o que você deve se certificar é de que todas estejam vazias. Mas que bom que já conseguiu resolver.
    1 point
  13. Im just saying you need the stolen NGSQL
    1 point
  14. 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
    1 point
  15. 0 points
×
×
  • Create New...