Jump to content

papam77

Members
  • Posts

    517
  • Joined

  • Last visited

Everything posted by papam77

  1. yes i know, but how ? I never made with SQL and XML
  2. Hello, i have ask. I am making my gamemode but i need when player disconnect server will save his/her position and when will player back it server will load player's position. How can do it ?
  3. papam77

    HTTP 404

    Hello i have problem when i start my script console says: client.lua local scrW, scrH = guiGetScreenSize() local gLP = getLocalPlayer() function showArenas() showChat(false) fadeCamera(false) local segoeui = guiCreateFont("fonts/segoeUI.ttf",45) Background = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "img/background.png", true) guiSetAlpha(Background , 0) closeBeta = guiCreateStaticImage(0, 0, 0.07, 0.07, "img/btnClassic.png", true, Background) arena_Editor = guiCreateStaticImage(0.32, 0.36, 0.14, 0.16, "img/btnEditor.png", true, Background) arena_new = guiCreateStaticImage(0.51, 0.36, 0.14, 0.16, "img/btnClosed.png", true, Background) text_two = guiCreateLabel(0.012,0.016,0.1,0.1,"Close", true, closeBeta) guiLabelSetColor(text_two, 0,0,0) guiSetFont(text_two, guiCreateFont("fonts/segoeUI.ttf", 18)) shadow_text_one = guiCreateLabel(0.365, 0.065, 0.26, 0.10, "Select arena", true, Background) guiSetFont(shadow_text_one, segoeui) guiLabelSetColor(shadow_text_one, 0, 0, 0) text_one = guiCreateLabel(0.36, 0.06, 0.26, 0.10, "Select arena", true, Background) guiSetFont(text_one, segoeui) guiFade(Background, "out") showCursor(true) fadeCamera(false) guiBringToFront(Background, true) guiSetAlpha(arena_Editor, 0.7) guiSetAlpha(arena_new, 0.7) removeCommandHandler("arenas", showArenas) addEventHandler("onClientMouseEnter", arena_Editor, f1) addEventHandler("onClientMouseEnter", arena_new, f2) addEventHandler("onClientGUIClick", closeBeta, function() if source == closeBeta then guiFade(Background, "in") fadeCamera(true) showCursor(false) showChat(true) addCommandHandler("area", showArenas) end end) end addCommandHandler("area", showArenas) function f1() if source == arena_Editor then guiFadeFastT(arena_Editor, "out", 1) addEventHandler("onClientMouseLeave", arena_Editor, f1e) end end function f1e() guiSetAlpha(arena_Editor,0.7) removeEventHandler("onClientMouseLeave", arena_Editor, f1e) end function f2() if source == arena_new then guiFadeFastT(arena_new, "out", 1) addEventHandler("onClientMouseLeave", arena_new, f2e) end end function f2e() guiSetAlpha(arena_new, 0.7) removeEventHandler("onClientMouseLeave", arena_new, f2e) end function guiFade( gui, state ) if state == "in" then fadeIn = setTimer(guiFade, 50, 1, gui, state) alpha = guiGetAlpha(gui) guiSetAlpha(gui, alpha - 0.05) if alpha == 0 then guiSetVisible(gui, false) destroyElement(gui) killTimer(fadeIn) fadeIn = nil end elseif state == "out" then guiSetVisible(gui, true) fadeOut = setTimer(guiFade, 50, 1, gui, state) alpha = guiGetAlpha(gui) guiSetAlpha(gui, alpha + 0.05) if alpha == 1 then killTimer(fadeOut) fadeOut = nil end end end function guiFadeFast( gui, state ) if state == "in" then fadeIn = setTimer(guiFade, 50, 1, gui, state) alpha = guiGetAlpha(gui) guiSetAlpha(gui, alpha - 0.15) if alpha == 0 then guiSetVisible(gui, false) destroyElement(gui) killTimer(fadeIn) fadeIn = nil end elseif state == "out" then guiSetVisible(gui, true) fadeOut = setTimer(guiFade, 50, 1, gui, state) alpha = guiGetAlpha(gui) guiSetAlpha(gui, alpha + 0.15) if alpha == 1 then killTimer(fadeOut) fadeOut = nil end end end function guiFadeFastT( gui, state, to) if state == "in" then fadeIn = setTimer(guiFade, 50, 1, gui, state) alpha = guiGetAlpha(gui) guiSetAlpha(gui, alpha - 0.1) if alpha == to then killTimer(fadeIn) fadeIn = nil end elseif state == "out" then guiSetVisible(gui, true) fadeOut = setTimer(guiFade, 50, 1, gui, state) alpha = guiGetAlpha(gui) guiSetAlpha(gui, alpha + 0.1) if alpha == to then killTimer(fadeOut) fadeOut = nil end end end outputChatBox("[Arenas] client.lua - started",getRootElement(), 255,255,0) Why?!
  4. Hello, i have problem with scoreboard. I need resize it for every resolution. Can someone help me with this? client.lua function serN(v) sN = v end addEvent("a", true) addEventHandler("a", root, serN) -- Country table -- countryTable = { ['AD'] = 'Andorra', ['AE'] = 'United Arab Emirates', ['AF'] = 'Afghanistan', ['AG'] = 'Antigua and Barbuda', ['AI'] = 'Anguilla', ['AL'] = 'Albania', ['AM'] = 'Armenia', ['AO'] = 'Angola', ['AP'] = 'ARIPO', ['AR'] = 'Argentina', ['AT'] = 'Austria', ['AU'] = 'Australia', ['AW'] = 'Aruba', ['AZ'] = 'Azerbaijan', ['BA'] = 'Bosnia and Herzegovina', ['BB'] = 'Barbados', ['BD'] = 'Bangladesh', ['BE'] = 'Belgium', ['BF'] = 'Burkina Faso', ['BG'] = 'Bulgaria', ['BH'] = 'Bahrain', ['BI'] = 'Burundi', ['BJ'] = 'Benin', ['BM'] = 'Bermuda', ['BN'] = 'Brunei Darussalam', ['BO'] = 'Bolivia', ['BQ'] = 'Bonaire', ['BR'] = 'Brazil', ['BS'] = 'Bahamas', ['BT'] = 'Bhutan', ['BV'] = 'Bouvet Island', ['BW'] = 'Botswana', ['BY'] = 'Belarus', ['BZ'] = 'Belize', ['CA'] = 'Canada', ['CD'] = 'Congo', ['CF'] = 'Central African Republic', ['CG'] = 'Congo', ['CH'] = 'Switzerland', ['CI'] = 'Cote dIvoire', ['CK'] = 'Cook Islands', ['CL'] = 'Chile', ['CM'] = 'Cameroon', ['CN'] = 'China', ['CO'] = 'Colombia', ['CR'] = 'Costa Rica', ['CU'] = 'Cuba', ['CV'] = 'Cape Verde', ['CW'] = 'Curacao', ['CY'] = 'Cyprus', ['CZ'] = 'Czech Republic', ['DE'] = 'Germany', ['DJ'] = 'Djibouti', ['DK'] = 'Denmark', ['DM'] = 'Dominica', ['DO'] = 'Dominican Republic', ['DZ'] = 'Algeria', ['EC'] = 'Ecuador', ['EE'] = 'Estonia', ['EG'] = 'Egypt', ['EH'] = 'Western Sahara', ['ER'] = 'Eritrea', ['ES'] = 'Spain', ['ET'] = 'Ethiopia', ['FI'] = 'Finland', ['FJ'] = 'Fiji', ['FK'] = 'Malvinas', ['FO'] = 'Faroe Islands', ['FR'] = 'France', ['GA'] = 'Gabon', ['GB'] = 'United Kingdom', ['GD'] = 'Grenada', ['GE'] = 'Georgia', ['GG'] = 'Guernsey', ['GH'] = 'Ghana', ['GI'] = 'Gibraltar', ['GL'] = 'Greenland', ['GM'] = 'Gambia', ['GN'] = 'Guinea', ['GQ'] = 'Equatorial Guinea', ['GR'] = 'Greece', ['GT'] = 'Guatemala', ['GW'] = 'Guinea-Bissau', ['GY'] = 'Guyana', ['HN'] = 'Honduras', ['HR'] = 'Croatia', ['HT'] = 'Haiti', ['HU'] = 'Hungary', ['ID'] = 'Indonesia', ['IE'] = 'Ireland', ['IL'] = 'Israel', ['IM'] = 'Isle of Man', ['IN'] = 'India', ['IQ'] = 'Iraq', ['IR'] = 'Iran', ['IS'] = 'Iceland', ['IT'] = 'Italy', ['JE'] = 'Jersey', ['JM'] = 'Jamaica', ['JO'] = 'Jordan', ['JP'] = 'Japan', ['KE'] = 'Kenya', ['KG'] = 'Kyrgyzstan', ['KH'] = 'Cambodia', ['KI'] = 'Kiribati', ['KM'] = 'Comoros', ['KN'] = 'Saint Kitts and Nevis', ['KP'] = 'Korea', ['KR'] = 'Korea', ['KW'] = 'Kuwait', ['KY'] = 'Cayman Islands', ['KZ'] = 'Kazakhstan', ['LA'] = 'Lao Peoples Republic', ['LB'] = 'Lebanon', ['LC'] = 'Saint Lucia', ['LI'] = 'Liechtenstein', ['LK'] = 'Sri Lanka', ['LR'] = 'Liberia', ['LS'] = 'Lesotho', ['LT'] = 'Lithuania', ['LU'] = 'Luxembourg', ['LV'] = 'Latvia', ['LY'] = 'Libyan Arab Jamahiriya', ['MA'] = 'Morocco', ['MC'] = 'Monaco', ['MD'] = 'Moldova', ['ME'] = 'Montenegro', ['MG'] = 'Madagascar', ['MK'] = 'Macedonia', ['ML'] = 'Mali', ['MM'] = 'Myanmar', ['MN'] = 'Mongolia', ['MO'] = 'Macao', ['MP'] = 'Northern Mariana Islands', ['MR'] = 'Mauritania', ['MS'] = 'Montserrat', ['MT'] = 'Malta', ['MU'] = 'Mauritius', ['MV'] = 'Maldives', ['MW'] = 'Malawi', ['MX'] = 'Mexico', ['MY'] = 'Malaysia', ['MZ'] = 'Mozambique', ['NA'] = 'Namibia', ['NE'] = 'Niger', ['NG'] = 'Nigeria', ['NI'] = 'Nicaragua', ['NL'] = 'Netherlands', ['NO'] = 'Norway', ['NP'] = 'Nepal', ['NR'] = 'Nauru', ['NZ'] = 'New Zealand', ['OM'] = 'Oman', ['PA'] = 'Panama', ['PE'] = 'Peru', ['PG'] = 'Papua New Guinea', ['PH'] = 'Philippines', ['PK'] = 'Pakistan', ['PL'] = 'Poland', ['PT'] = 'Portugal', ['PW'] = 'Palau', ['PY'] = 'Paraguay', ['QA'] = 'Qatar', ['RO'] = 'Romania', ['RS'] = 'Serbia', ['RU'] = 'Russian Federation', ['RW'] = 'Rwanda', ['SA'] = 'Saudi Arabia', ['SB'] = 'Solomon Islands', ['SC'] = 'Seychelles', ['SD'] = 'Sudan', ['SE'] = 'Sweden', ['SG'] = 'Singapore', ['SH'] = 'Saint Helena', ['SI'] = 'Slovenia', ['SK'] = 'Slovakia', ['SL'] = 'Sierra Leone', ['SM'] = 'San Marino', ['SN'] = 'Senegal', ['SO'] = 'Somalia', ['SR'] = 'Suriname', ['ST'] = 'Sao Tome and Principe', ['SV'] = 'Salvador', ['SX'] = 'Sint Maarten (Dutch part)', ['SY'] = 'Syrian Arab Republic', ['SZ'] = 'Swaziland', ['TC'] = 'Turks and Caicos Islands', ['TD'] = 'Chad', ['TG'] = 'Togo', ['TH'] = 'Thailand', ['TJ'] = 'Tajikistan', ['TL'] = 'TimorLeste', ['TM'] = 'Turkmenistan', ['TN'] = 'Tunisia', ['TO'] = 'Tonga', ['TR'] = 'Turkey', ['TT'] = 'Trinidad and Tobago', ['TV'] = 'Tuvalu', ['TW'] = 'Taiwan', ['TZ'] = 'Tanzania', ['UA'] = 'Ukraine', ['UG'] = 'Uganda', ['US'] = 'United States of America', ['UY'] = 'Uruguay', ['UZ'] = 'Uzbekistan', ['VA'] = 'Holy See', ['VC'] = 'Saint Vincent', ['VE'] = 'Venezuela', ['VG'] = 'Virgin Islands', ['VN'] = 'Viet Nam', ['VU'] = 'Vanuatu', ['WS'] = 'Samoa', ['YE'] = 'Yemen', ['ZA'] = 'South Africa', ['ZM'] = 'Zambia', ['ZW'] = 'Zimbabwe' } function getMaxPlayers() triggerServerEvent("sendMaxPlayers", localPlayer) end function getServerName() triggerServerEvent("a", localPlayer) end local sw, sh = guiGetScreenSize() local showing = false local maxPlayers = getMaxPlayers() local serverName = getServerName() local country = {} function addPlayerCountry(thePlayer) triggerServerEvent("nevimNazev", localPlayer) end addEventHandler("onClientPlayerJoin", root, addPlayerCountry) addEventHandler("onClientResourceStart", root, addPlayerCountry) function removePlayerCountry(thePlayer) triggerServerEvent("nevimNazevUzZas", localPlayer) end
  5. Helo, i decided to fix everything. Here are my errors and warnings. Line 448 dxDrawText(cv,(1205*(sw/1920))+(7*(sw/1920)),(((middle+116)*(sh/1080))+((28*(sh/1080))*(#playersWT-1)))+((28*(sh/1080))*(playersCount-1))+((28*(sh/1080))*(teamsi-1)),1418*(sw/1920),447*(sh/1080),tocolor(255,255,255,255),1.3*(sh/1080),"default","left","top",false,false,false) if getElementDimension(vehicle) ~= 999 or getElementDimension(player) ~= 999 or getElementInterior(player) ~= 999 or getElementInterior(vehicle) ~= 999 then setElementDimension(vehicle, 999) setElementDimension(player, 999) -------------- Line 60 setElementInterior(vehicle, 999) -------------- Line 61 setElementInterior(player, 999) end end
  6. papam77

    FPS 49 lagg

    Hello, i have ask about FPS differences when i set FPS 49 as max on my server it seems be laggy and on servers like ffs is FPS 49 without laggs... Why?
  7. Yes doesn't work, i see flag and country only in Admin Panel and in Scoreboard "TAB" i see "?" from Mars ( I have Mars like N/A ).
  8. It has writen my IP 217.117.213.74
  9. Before line 20? --[[********************************** * * Multi Theft Auto - Admin Panel * * admin_ip2c.lua * * Original File by lil_Toady * **************************************]] local aCountries = {} local makeCor function getPlayerCountry ( player ) return getIpCountry ( getPlayerIP ( player ) ) end function getIpCountry ( ip ) if not loadIPGroupsIsReady() then return false end local ip_group = tonumber ( gettok ( ip, 1, 46 ) ) local ip_code = tostring( gettok ( ip, 2, 46 ) * 65536 ) + ( gettok ( ip, 3, 46 ) * 256 ) + ( gettok ( ip, 4, 46 ) ) Where do you think ?
  10. It was only for test with command /country i wanted check errors. http://www.upload.ee/image/3344208/Ithi ... ntwork.png Doesn't work.
  11. I edited this function getPlayerCountry(theP) myCountry = exports.admin:getPlayerCountry(theP) outputChatBox("This is my country: " .. myCountry,getRootElement()) end addCommandHandler("country", getPlayerCountry) and nothing.
  12. Yes it is showing countries in Admin Panel...but no in Scoreboard.
  13. I stopped everything and still lagg.
  14. yes, this lag have everybody
  15. country_s.lua function getPlayerCountry(theP) myCountry = exports.admin:getPlayerCountry( thePlayer ) outputChatBox("This is my country: " .. myCountry,getRootElement()) end addCommandHandler("country", getPlayerCountry) admin_ip2c.lua --[[********************************** * * Multi Theft Auto - Admin Panel * * admin_ip2c.lua * * Original File by lil_Toady * **************************************]] local aCountries = {} local makeCor function getPlayerCountry ( player ) return getIpCountry ( getPlayerIP ( player ) ) end function getIpCountry ( ip ) if not loadIPGroupsIsReady() then return false end local ip_group = tonumber ( gettok ( ip, 1, 46 ) ) local ip_code = tostring( gettok ( ip, 2, 46 ) * 65536 ) + ( gettok ( ip, 3, 46 ) * 256 ) + ( gettok ( ip, 4, 46 ) ) if ( not aCountries[ip_group] ) then return false end for id, group in ipairs ( aCountries[ip_group] ) do local buffer = ByteBuffer:new( group ) local rstart = buffer:readInt24() if ip_code >= rstart then local rend = buffer:readInt24() if ip_code <= rend then local rcountry = buffer:readBytes( 2 ) return rcountry ~= "ZZ" and rcountry end end end return false end -- Returns false if aCountries is not ready function loadIPGroupsIsReady () if ( get ( "*useip2c" ) == "false" ) then return false end if ( #aCountries == 0 and not makeCor) then makeCor = coroutine.create(loadIPGroupsWorker) coroutine.resume(makeCor) end return makeCor == nil end setTimer( loadIPGroupsIsReady, 1000, 1 ) -- Load all IP groups from "conf/IpToCountryCompact.csv" function loadIPGroupsWorker () unrelPosReset() local readFilename = "conf/IpToCountryCompact.csv"; local hReadFile = fileOpen( readFilename, true ) if not hReadFile then outputHere ( "Cannot read " .. readFilename ) return end local buffer = "" local tick = getTickCount() while true do local endpos = string.find(buffer, "\n") if makeCor and ( getTickCount() > tick + 50 ) then -- Execution exceeded 50ms so pause and resume in 50ms setTimer(function() local status = coroutine.status(makeCor) if (status == "suspended") then coroutine.resume(makeCor) elseif (status == "dead") then makeCor = nil end end, 50, 1) coroutine.yield() tick = getTickCount() end -- If can't find CR, try to load more from the file if not endpos then if fileIsEOF( hReadFile ) then break end buffer = buffer .. fileRead( hReadFile, 500 ) end if endpos then -- Process line local line = string.sub(buffer, 1, endpos - 1) buffer = string.sub(buffer, endpos + 1) local parts = split( line, string.byte(',') ) if #parts > 2 then local rstart = tonumber(parts[1]) local rend = tonumber(parts[2]) local rcountry = parts[3] -- Relative to absolute numbers rstart = unrelRange ( rstart ) rend = unrelRange ( rend ) -- Top byte is group local group = math.floor( rstart / 0x1000000 ) -- Remove top byte from ranges rstart = rstart - group * 0x1000000 rend = rend - group * 0x1000000 if not aCountries[group] then aCountries[group] = {} end local count = #aCountries[group] + 1 -- Add country/IP range to aCountries local buffer = ByteBuffer:new() buffer:writeInt24( rstart ) buffer:writeInt24( rend ) buffer:writeBytes( rcountry, 2 ) aCountries[group][count] = buffer.data end end end fileClose(hReadFile) makeCor = nil collectgarbage("collect") -- Update currently connected players for user,info in pairs( aPlayers ) do info["country"] = getPlayerCountry ( user ) -- Send info to all admins for id, admin in ipairs(getElementsByType("player")) do if ( hasObjectPermissionTo ( admin, "general.adminpanel" ) ) then triggerClientEvent ( admin, "aClientPlayerJoin", user, false, false, false, false, false, aPlayers[user]["country"] ) end end end return true end -- For squeezing data together ByteBuffer = { new = function(self, indata) local newItem = { data = indata or "", readPos = 1 } return setmetatable(newItem, { __index = ByteBuffer }) end, Copy = function(self) return ByteBuffer:new(self.data) end, -- Write writeInt24 = function(self,value) local b0 = math.floor(value / 1) % 256 local b1 = math.floor(value / 256) % 256 local b2 = math.floor(value / 65536) % 256 self.data = self.data .. string.char(b0,b1,b2) end, writeBytes = function(self, chars, count) self.data = self.data .. string.sub(chars,1,count) end, -- Read readInt24 = function(self,value) local b0,b1,b2 = string.byte(self.data, self.readPos, self.readPos+2) self.readPos = self.readPos + 3 return b0 + b1 * 256 + b2 * 65536 end, readBytes = function(self, count) self.readPos = self.readPos + count return string.sub(self.data, self.readPos - count, self.readPos - 1) end, } -- Make a stream of absolute numbers relative to each other local relPos = 0 function relPosReset() relPos = 0 end function relRange( v ) local rel = v - relPos relPos = v return rel end -- Make a stream of relative numbers absolute local unrelPos = 0 function unrelPosReset() unrelPos = 0 end function unrelRange( v ) local unrel = v + unrelPos unrelPos = unrel return unrel end -- IP2C logging function outputHere( msg ) --outputServerLog ( msg ) outputChatBox ( msg ) end ---------------------------------------------------------------------------------------- -- -- Set to true to enable commands "makecsv" and "iptest" -- ---------------------------------------------------------------------------------------- local makeAndTestCompactCsv = false if makeAndTestCompactCsv then local makeCor -- Takes a 'IPV4 CSV' file sourced from [url=http://software77.net/geo-ip/]http://software77.net/geo-ip/[/url] -- and makes a smaller one for use by Admin addCommandHandler ( "makecsv", function () local status = makeCor and coroutine.status(makeCor) if (status == "suspended") then outputHere( "Please wait" ) return end makeCor = coroutine.create ( makeCompactCsvWorker ) coroutine.resume ( makeCor ) end ) function makeCompactCsvWorker () outputHere ( "makeCompactCsv started" ) relPosReset() local readFilename = "conf/IpToCountry.csv"; local hReadFile = fileOpen( readFilename, true ) if not hReadFile then outputHere ( "Cannot read " .. readFilename ) return end local writeFilename = "conf/IpToCountryCompact.csv"; local hWriteFile = fileCreate( writeFilename, true ) if not hWriteFile then
  16. so lagg. But why ? It doesn't made on 1.3.1....
  17. But it isn't net lag. It is in one moment FPS 0
  18. Hello, i have ask about this lag. It is doing on version 1.3.2. But why ? When player left server he/she is getting big lag and mta has stopped work.
  19. It is giving me error of admin.
  20. Hello, i need help. I have ask about getting player's country, how can do it please?
  21. Hello, can someone tell me which function i must use for new chat ? When player press "L" he can type to chat for his/her language. And command /join [lang] for join to language. If player is new on server he will be move to his/her own language. How can do it ?
×
×
  • Create New...