Leaderboard
Popular Content
Showing content with the highest reputation on 07/01/17 in all areas
-
Hello everyone Today I was thinking of a pro idea in the "meta.xml" file. <file src = "images/*" /> The "*" represents all archives. (Loop) When I do this, everything in the resource, in the folder "images" will be imported automatically, avoiding to write each file.2 points
-
اسمع على فكرة انت اول ما دخلت كنت تطلب كذا اشياء فش داعي تتكلم معاه كذا واذا ما بدك تساعده فش داعي تزود مشاركات2 points
-
استضافه مجتمع العرب ترحب بكم .. وتقدم لكم 5 سيرفرات هديه حصريا فقط في مجتمع ام تي اي العرب .. الشروط بسيطه وسهله جدا . 1- لازم يكون عندك فوق 10 مشاركات 2- يكون عندك خلفيه مسبقا للسيرفر وطريقه تحكمه 3- الرد في موضوع مجتمع العرب - ارخص استضافه عربيه طيب وفي شي ثاني هديه نعطيك سيرفر ثاني مع سيرفرك الاول اذا جبت 5 اعضاء يسجلون بالموقع . وبس شاكرين لكم حسن استماعكم لمزيد من المعلومات : http://www.mtaarabs.com/vb/showthread.php?p=9402#post9402 شرح التسجيل وشروحات المنتدى كافة http://www.mtaarabs.com http://www.mtaarabs.com/vb/showthread.php?t=12631 point
-
The names of the servers that buy positions should be colored to make a difference! Please colorize the names will be much more attractive!1 point
-
1 point
-
1 point
-
1 point
-
I wouldn't be hugely surprised if it was taken down, though. There have been a few multiplayer projects of which all were taken down by lawyers, not because of lack of interest to continue project.1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
It was even slightly higher: New record: 28476 players - 2017 Jan Fri 6th 17:301 point
-
هو صراحة من رأيي ماظنيت تحصل نجاح لان شوف اصدار لعبة جراند Sa هو افضل اصدار خرج كيف افضل اصدار ؟ انا اقولك كيف افضل اصدار من ناحيه الحجم اللعبة حجم اللعبة قليل وبنفس الوقت فيها ميزات اللعبة واشياء كويسة تقدر تخلي اللاعب يستمتع وهو يلعب مقارنة بحجمها الصغير وامكانياتها الكبيرة فهي لعبة ممتازه اللحين نجي للإصدارات الثانية Sa عندك الي اقل من والي اعلى منها Gta 5 Gta 4 / IV •—•—•—•—•—•—• Gta sa •—•—•—•—•—•—• Gta vc gta 3 - Gta sa الي اقل من الجرافكس حقها طايح حظه وناهيك عن الامكانيات الضعيفة باللعبة مثل يوم تطيح بالماي تموت وغيرها من الامكانيات الي ماكانت متطوره يضيفوها في ذلك الوقت ______ Gta sa اما بالنسبة للأعلى من فهي اصدارات خورافية ومتطورة وجرافكس عالي وإضافات رائعة لكن المشكلة تكمن بالحجم عيبها الحجم الكبير وبعض الاجهزة ما تتحملها ف من رأيي لو صار وسوو اصدار اون لاين للإصدارات الي اقل من gta sa ماظنيت رح يجيها إقبال MTA sa ف الي سوو هذا البرنامج Gta sa كان قرارهم موفق انهم اختارو يسووه على لانها هي اوسطهم وهي الي تجمع بين متعة اللعب والتطويرات والحجم القليل وشكراً1 point
-
Thanks all! @ChrisM, No, but I took some time and implemented it for you. I'll release an update tomorrow which will include that + something else I'll let you know when you can download it.1 point
-
addEventHandler("onPlayerQuit", root, function() local account = getPlayerAccount(source) if account and not isGuestAccount(account) then local t = {} for i=0, 12 do local weapon = getPedWeapon(source, i) local ammo = getPedTotalAmmo(source, i) table.insert(t, weapon..", "..ammo) end setAccountData(account, "playerweapons", toJSON(t)) end end ) addEventHandler("onPlayerLogin", root, function() local account = getPlayerAccount(source) local t = fromJSON(getAccountData(account, "playerweapons")) for i=0, 12 do local wp = split(t[i+1][1], ", ") giveWeapon(source, wp[1], wp[2], true) setAccountData(account, "playerweapons", false) end end )1 point
-
As you said 2 tables with primary and foreign key would be the best performance wise imo. Remember that SQL was made to handle such queries, just make sure you have index on the right column(s) and be smart with your queries. If you already know what's the next map going to be, you can get the result before the map actually ends and cache it. You can also normalise your data structure a bit more so that for example you won't have the map creator name for every map but a foreign key to a creators table, so whenever you're querying, it wouldn't need to look through all that useless data. And of course, relational database like SQL should not have duplicate data anyway.1 point
-
Yes, I followed those instructions. No matter what I do, I still get this error: Microsoft.CppCommon.targets(133,5): error MSB3073 . And there's no meaningful explanation how to fix it anywhere around the internet. So, today Microsoft dickheads won I'll try again tomorrow1 point
-
-------Server Kills_ = {} addEventHandler('onResourceStart',resourceRoot,function () exports.NGSQL:db_exec("CREATE TABLE IF NOT EXISTS `group_kills` ( Serial VARCHAR(20), Name VARCHAR(20), Kills VARCHAR(40) )") end ) addEventHandler("onPlayerWasted",root,function ( _,Killer ) if ( Killer and Killer ~= source and getElementType(Killer) == "player" ) then local playerSerial = getPlayerSerial( Killer ) local playerName = exports.SAEGGroups:getPlayerGroup( Killer ) if not Kills_[Killer] then Kills_[Killer] = 0; end Kills_[Killer] = Kills_[Killer] + 1 local Sel = exports.NGSQL:db_exec("SELECT * FROM `group_kills` WHERE Serial=?", playerSerial) if ( type ( Sel ) == "table" and #Sel == 0 or not Sel ) then exports.NGSQL:db_exec(" INSERT INTO `group_kills` (Serial, Name, Kills) VALUES(?,?,?)",playerSerial,playerName,Kills_[Killer]) else exports.NGSQL:db_exec(" UPDATE `group_kills` WHERE Name =?, Kills =? WHERE Serial=?",playerName,Kills_[Killer],playerSerial) end end end) addEvent ( 'getData', true) addEventHandler ( 'getData', root, function() local db = exports.NGSQL:db_exec("SELECT * FROM `group_kills`") if (type(db) ~= "table" or (type(db)=="table" and #db==0) or not db) then return end triggerClientEvent ( source, 'setData', source, db ) end ) --------Clinet function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end bindKey('f4','down', function() if isEventHandlerAdded ("onClientRender", root,dx) then removeEventHandler("onClientRender", root,dx) else triggerServerEvent( 'getData', localPlayer ) addEventHandler("onClientRender", root,dx) end end) addEvent( 'setData', true ) addEventHandler ( 'setData', root, function(data) guiGridListClear ( killgrid ) table.sort ( data, function (a,b) return ( tonumber(a.Kills) or 0 ) > ( tonumber(b.Kills) or 0 )end) for k,v in ipairs ( data ) do local Row = guiGridListAddRow(killgrid) guiGridListSetItemText(killgrid,Row,1,v.name,false,false) guiGridListSetItemText(killgrid,Row,2,v.kills,false,false) if k == 10 then break end end end) got : NGSQL/sql.lua , Line 25 dbExec failed; (1064) yo uhave an error in your sql syntax; check the manual that corrsponds to your mariaDB server version for the right syntax to use 'Where Name='Test, Kills=5 Where Serial'D8F20A.......' and this NGSql : if ( tostring ( get ( "CONNECTION_TYPE" ) ):lower() == "mysql" ) then outputConsole ( "Attempting to connect as MySQL... Please wait") db = dbConnect( "mysql", "dbname="..tostring(get("DATABASE_NAME"))..";host="..tostring(get("MYSQL_HOST"))..";port="..tostring(get("MYSQL_PORT"))..";unix_socket=/opt/lampp/var/mysql/mysql.sock", tostring(get("MYSQL_USER")), tostring(get("MYSQL_PASS")), "share=1;autoreconnect=1" ); elseif ( tostring ( get ( "CONNECTION_TYPE" ) ):lower() == "sqlite" ) then db = dbConnect ( "sqlite", tostring(get("DATABASE_NAME")) .. ".sql" ); else error ( tostring(get("CONNECTION_TYPE")) .. " is an invalid SQL connection -- valid: mysql, sqlite" ); end if not db then print ( "The database has failed to connect") return else print ( "Database has been connected") end function db_query ( ... ) local data = { ... } return dbPoll ( dbQuery ( db, ... ), - 1 ) end function db_exec ( ... ) return dbExec ( db, ... ); end --[[ Columns: Username TEXT, Money TEXT, Armour TEXT, Health TEXT, x TEXT, y TEXT, z TEXT, Skin INT, Interior INT, Dimension INT, Team TEXT Job TEXT, Playtime_mins INT, JailTime INT, WL INT, Weapons TEXT, JobRank TEXT, GroupName TEXT, GroupRank TEXT, LasterOnline DATE, LastSerial TEXT, LastIP TEXT, Kills INT, Deaths INT, weapstats TEXT, items TEXT, unemployedskin INT, vip TEXT, vipexp DATE, plrtosrvrsettings TEXT ]] db_exec ( [[CREATE TABLE IF NOT EXISTS accountdata ( Username VARCHAR(200), Money INT, Armour INT, Health INT, x VARCHAR(20), y VARCHAR(20), z VARCHAR(20), Skin INT, Interior INT, Dimension INT, Team VARCHAR(70), Job VARCHAR(70), Playtime_mins INT, JailTime INT, WL INT, Weapons TEXT, JobRank VARCHAR(20), GroupName VARCHAR(100), GroupRank VARCHAR(100), LastOnline DATE, LastSerial VARCHAR(50), LastIP VARCHAR(20), Kills INT, Deaths INT, weapstats TEXT, items TEXT, unemployedskin INT, vip VARCHAR(100), vipexp DATE, plrtosrvrsettings TEXT )]] ); local weapStats_ = { ['9mm'] = 0, ['silenced'] = 0, ['deagle'] = 0, ['shotgun'] = 0, ['combat_shotgun'] = 0, ['micro_smg'] = 0, ['mp5'] = 0, ['ak47'] = 0, ['m4'] = 0, ['tec-9'] = 0, ['sniper_rifle'] = 0 } function createAccount ( account ) if ( account and type ( account ) == 'string' ) then local plr = getPlayerFromAccount ( account ) local autoIP = "unknown" local autoSerial = "unknown" local weapStats = toJSON ( weapStats_ ) if plr and isElement ( plr ) then autoSerial = getPlayerSerial ( plr ) autoIP = getPlayerIP ( plr ) outputDebugString ( "NGSQL: Creating account "..account.." for player "..getPlayerName ( plr ).." (Serial: "..autoSerial.." || IP: "..autoIP..")" ) else outputDebugString ( "NGSQL: Creating account "..account.." for player N/A (Serial: None || IP: None)" ); end local today = exports['SAEGPlayerFunctions']:getToday ( ) return db_exec ( [[INSERT INTO `accountdata` (`Username`, `Money`, `Armour`, `Health`, `x`, `y`, `z`, `Skin`, `Interior`, `Dimension`, `Team`, `Job`, `Playtime_mins`, `JailTime`, `WL`, `Weapons`, `JobRank`, `GroupName`, `GroupRank`, `LastOnline`, `LastSerial`, `LastIP`, `Kills`, `Deaths`, `weapstats`, `items`, `unemployedskin`, `vip`, `vipexp`, `plrtosrvrsettings` ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? );]], account, '0', '0', '100', '0', '0', '0', '0', '0', '0', 'UnEmployed', 'UnEmployed', '0', '0', '0', '[ [ ] ]', 'None', 'None', 'None', today, autoSerial, autoIP, '0', '0', weapStats, toJSON ( { } ), '28', 'None', nil, toJSON ( { } ) ) end return false end function getPlayerFromAccount ( accnt ) if accnt and type ( accnt ) == 'string' then for i, v in ipairs ( getElementsByType ( 'player' ) ) do if ( getAccountName ( getPlayerAccount ( v ) ) == accnt ) then return v; end end end return false end function savePlayerData ( p, loadMsg, deleteTime ) if ( p and getElementType ( p ) == 'player' ) then if ( not isGuestAccount ( getPlayerAccount ( p ) ) ) then if ( loadMessage == nil ) then loadMessage = true end if ( deleteTime == nil ) then deleteTime = false end local account = getAccountName ( getPlayerAccount ( p ) ) local x, y, z = getElementPosition ( p ) local money, health = getPlayerMoney ( p ), getElementHealth ( p ) local armor, skin = getPedArmor ( p ), getElementModel ( p ) local int, dim = getElementInterior ( p ), getElementDimension ( p ) local job = getElementData ( p, "Job" ) local pt = exports['SAEGPlayerFunctions']:getPlayerPlaytime ( p ) local team = "UnEmployed" local wl = getElementData ( p, "WantedPoints" ) or 0 local rank = tostring ( getElementData ( p, "Job Rank" ) ) local group = tostring ( getElementData ( p, "Group" ) ) local gRank = tostring ( getElementData ( p, "Group Rank" ) ) local jt = exports['SAEGPolice']:isPlayerJailed ( p ) or 0 local weapons = { } local today = exports['SAEGPlayerFunctions']:getToday ( ) local kills = tonumber ( getElementData ( p, "NGSQL:Kills" ) ) or 0 local deaths = tonumber ( getElementData ( p, "NGSQL:Deaths" ) ) or 0 local weapstats = toJSON ( getElementData ( p, "NGSQL:WeaponStats" ) or weapStats_ ) local items = tostring ( toJSON ( getElementData ( p, "SAEGUser:Items" ) or { } ) ) local unemloyedSkin = tostring ( getElementData ( p, "SAEGUser.UnemployedSkin" ) ) or 28 local vip = tostring ( getElementData ( p, "VIP" ) ) local vipexp = tostring ( getElementData ( p, "SAEGVIP.expDate" ) ) local plrtosrvrsettings = tostring ( toJSON ( getElementData ( p, "PlayerServerSettings" ) or { } ) ) if ( getElementData ( p, "SAEGEvents:IsPlayerInEvent" ) ) then health = 0 dim = 0 end if ( getPlayerTeam ( p ) ) then team = getTeamName ( getPlayerTeam ( p ) ) end if not armor then armor = 0 end if ( not jt ) then jt = 0 end for i=1,12 do weapons[i] = { getPedWeapon ( p, i ), getPedTotalAmmo ( p, i ) } end local weapons = toJSON ( weapons ) local ip = getPlayerIP ( p ) local serial = getPlayerSerial ( p ) if loadMsg then outputDebugString ( "NGSQL: Attempting to save account "..account.." (Player: "..getPlayerName ( p )..") userdata." ) end if ( deleteTime ) then exports['SAEGPlayerFunctions']:deletePlayerPlaytime ( p ) end return db_exec ( "UPDATE accountdata SET Money=?, Armour=?, Health=?, x=?, y=?, z=?, Skin=?, Interior=?, Dimension=?, Team=?, Job=?, Playtime_mins=?, JailTime=?, WL=?, Weapons=?, JobRank=?, GroupName=?, GroupRank=?, LastOnline=?, LastSerial=?, lastIP=?, Kills=?, Deaths=?, weapstats=?, items=?, unemployedskin=?, vip=?, vipexp=?, plrtosrvrsettings=? WHERE Username=?", money, armor, health, x, y, z, skin, int, dim, team, job, pt, jt, wl, weapons, rank, group, gRank, today, serial, ip, kills, deaths, weapstats, items, unemloyedSkin, vip, vipexp, plrtosrvrsettings, account ) end end end function loadPlayerData ( p, loadMsg ) local acc = getAccountName ( getPlayerAccount ( p ) ) local data = account_exist ( acc ) if ( data and type ( data ) == 'table' ) then for i, v in ipairs ( data ) do if ( v['Username'] == acc ) then if ( loadMsg == nil ) then loadMesg = true end local money = tonumber ( v['Money'] ) or 0 local armor = tonumber ( v['Armour'] ) or 0 local health = tonumber ( v['Health'] ) or 0 local x = tonumber ( v['x'] ) or 0 local y = tonumber ( v['y'] ) or 0 local z = tonumber ( v['z'] ) or 3 local skin = tonumber ( v['Skin'] ) or 28 local interior = tonumber ( v['Interior'] ) or 0 local dimension = tonumber ( v['Dimension'] ) or 0 local team = tostring ( v['Team'] ) or "None" local job = tostring ( v['Job'] ) or "None" local pt = tonumber ( v["Playtime_mins"] ) or 0 local jt = tonumber ( v['JailTime'] or 0 ) local wl = tonumber ( v['WL'] or 0 ) local weapons = fromJSON ( v['Weapons'] or toJSON ( { } ) ) local rank = tostring ( v['JobRank'] or "None" ) local group = tostring ( v['GroupName'] or "None" ) local gRank = tostring ( v['GroupRank'] or "None" ) local kills = tonumber ( v['Kills'] ) local deaths = tonumber ( v['Deaths'] ) local weapstats = fromJSON ( tostring ( v['weapstats'] ) ) local items = fromJSON ( tostring ( v['items'] ) ) local unemployedSkin=tonumber( v['unemployedskin'] ) or 28 local vip = tostring ( v['vip'] ) local vipexp = tostring ( v['vipexp'] ) local group = tostring ( v['GroupName'] or "None" ) local groupRank = tostring ( v['GroupRank'] or "None" ) local srvrsettings =fromJSON ( tostring ( v['plrtosrvrsettings'] or tosJSON ( { } ) ) ) if ( not exports.saeggroups:doesGroupExist ( group ) ) then group = "None" else if ( not exports.saeggroups:isRankInGroup ( group, groupRank ) ) then groupRank = "None" end end if ( group:lower ( ) == "none" ) then groupRank = "None" end spawnPlayer ( p, x, y, z, 0, skin, interior, dimension ) setElementData ( p, "Job Rank", rank ) if ( jt > 0 ) then exports['SAEGPolice']:jailPlayer ( p, jt, false ) end setElementData ( p, "NGSQL:Kills", kills ) setElementData ( p, "NGSQL:Deaths", deaths ) setElementData ( p, "Job", job ) setPedArmor ( p, armor ) givePlayerMoney ( p, money ) exports['SAEGPlayerFunctions']:setPlayerPlaytime ( p,pt ) setElementData ( p, "WantedPoints", wl ) setElementData ( p, "Group", group ) setElementData ( p, "Group Rank", gRank ) setElementData ( p, "NGSQL:WeaponStats", weapstats ) setElementData ( p, "SAEGUser:Items", items ) setElementData ( p, "SAEGUser.UnemployedSkin", unemployedSkin ) setElementData ( p, "VIP", vip ) setElementData ( p, "SAEGVIP.expDate", vipexp ) setElementHealth ( p, health ) setElementData ( p, "PlayerServerSettings", srvrsettings ) if ( srvrsettings.walkStyle ) then setPedWalkingStyle ( p, srvrsettings.walkStyle) end exports.SAEGVIP:checkPlayerVipTime ( p ) for i, v in ipairs ( weapons ) do giveWeapon ( p, v[1], v[2] ) end if ( team and getTeamFromName ( team ) ) then setPlayerTeam ( p, getTeamFromName ( team ) ) end if ( loadMsg ) then outputDebugString ( "NGSQL: Loading "..acc.." account data (Player: "..getPlayerName ( p )..")" ) end return true end end end return false end function account_exist ( acc ) if ( acc ) then local q = db_query ( "SELECT * FROM accountdata WHERE Username='"..acc.."' LIMIT 1" ) if ( type ( q ) == 'table' ) then if ( #q > 0 ) then return q end return false end end return nil end function saveAllData ( useTime ) if ( useTime == nil ) then useTime = true end if ( useTime ) then if ( getResourceState ( getResourceFromName ( 'SAEGMessages' ) ) == 'running' ) then exports['SAEGMessages']:sendClientMessage ( "Please expect some lag, saving server data in 5 seconds.", root, 255, 0, 0 ) end setTimer ( function ( ) for i, v in ipairs ( getElementsByType ( 'player' ) ) do savePlayerData ( v, false, false ) end if ( isTimer ( saveAllTimer ) ) then resetTimer ( saveAllTimer ) else saveAllTimer = setTimer ( saveAllData, 3600000, 1, true ) end if ( getResourceState ( getResourceFromName ( "SAEGBank" ) ) == 'running' ) then exports['SAEGBank']:saveBankAccounts ( ) end if ( getResourceState ( getResourceFromName ( 'SAEGMessages' ) ) == 'running' ) then exports['SAEGMessages']:sendClientMessage ( "Server data has been saved!", root, 0, 255, 0 ) end if ( getResourceState ( getResourceFromName ( "SAEGBans" ) ) == "running" ) then exports.SAEGBans:saveBans ( ) end if ( getResourceState ( getResourceFromName ( "SAEGTurf" ) ) == "running" ) then exports.SAEGTurf:saveTurfs ( ) end end, 5000, 1 ) else if ( getResourceState ( getResourceFromName ( 'SAEGMessages' ) ) == 'running' ) then exports['SAEGMessages']:sendClientMessage ( "Saving server data! Please expect some lag.", root, 255, 0, 0 ) end if ( getResourceState ( getResourceFromName ( 'SAEGBank' ) ) == 'running' ) then exports['SAEGBank']:saveBankAccounts ( ) end if ( getResourceState ( getResourceFromName ( "SAEGBans" ) ) == "running" ) then exports.SAEGBans:saveBans ( ) end if ( getResourceState ( getResourceFromName ( "SAEGTurf" ) ) == "running" ) then exports.SAEGTurf:saveTurfs ( ) end for i, v in ipairs ( getElementsByType ( 'player' ) ) do savePlayerData ( v, false, false ) end if ( isTimer ( saveAllTimer ) ) then resetTimer ( saveAllTimer ) else saveAllTimer = setTimer ( saveAllData, 3600000, 1, true ) end end end saveAllTimer = setTimer ( saveAllData, 3600000, 1, true ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isGuestAccount ( getPlayerAccount ( source ) ) ) then return end savePlayerData ( source, false, true ) end ) addEventHandler ( "onPlayerLogin", root, function ( ) loadPlayerData ( source, true ) end ) addEventHandler ( "onResourceStop", resourceRoot, function ( ) saveAllData ( false ) end ) -- For development purposes --[[ addCommandHandler ( "makeaccnt", function ( p, cmd, accnt ) if ( getPlayerName ( p ) == "Console" or getAccountName ( getPlayerAccount ( p ) ) == "xXMADEXx" ) then outputChatBox ( "Executing command: Account Creation", root, 255, 255, 255 ) results = nil if ( accnt ) then if ( createAccount ( accnt ) ) then print ( "The account "..accnt.." has been created!" ) results = "Account "..accnt.." has been created" else print ( "Failed to create account." ) results = "Account "..accnt.." has failed to create!!" end else print ( "Format: /"..cmd.." [account name]" ) results = "none" end outputChatBox ( "Command Execution Results: "..tostring ( results ), root, 255, 255, 255 ) end end ) addCommandHandler ( "delaccnt", function ( p, cmd, accnt ) if ( getPlayerName ( p ) == "Console" ) then if ( account_exist ( accnt ) ) then print ( "Removing account "..accnt.." from database......" ) if ( db_exec ( "DELETE FROM accountdata WHERE Username='"..accnt.."'" ) ) then print ( "Account has been removed!" ) else print ( "Account has failed to have been removed." ) end else print ( "The account "..accnt.." doesn't exist in the mysql database." ) end end end ) addCommandHandler ( 'saveall', function ( p, cmd ) if ( ( getPlayerName ( p ) == 'Console' ) or ( getAccountName ( getPlayerAccount ( p ) ) == 'xXMADEXx' ) ) then saveAllData ( true ) end end ) ]]1 point
-
جرب function saveWeaponStats(player) if (not player or not isElement(player)) then return end local account = getPlayerAccount(player) if (account and not isGuestAccount(account)) then local stats = "" for stat=69, 81 do local value = getPedStat(player, stat) stats = stats ..",".. stat ..";".. value end setAccountData(account, "weaponStats", stats) end end addEventHandler("onPlayerQuit",root,function () saveWeaponStats(source) end) function loadWeaponStats(player) if (not player or not isElement(player)) then return end local account = getPlayerAccount(player) if (account and not isGuestAccount(account)) then local statsData = getAccountData(account,"weaponStats") local stats = split(statsData, ",") for k, v in ipairs(stats) do local stat = split(v, ";") setPedStat(player, tonumber(stat[1]), tonumber(stat[2])) end end end addEventHandler("onPlayerLogin",root,function () loadWeaponStats(source) end)1 point