Search the Community
Showing results for tags 'الاسلحة والفلوس'.
-
السلام عليكم ورحمة الله وبركاتة عندي مشكلة غريبه انا عندي اكواد حفظ فلوس واسلحة ما فيهم خطأ على داتا اكاونت وعلى السيرفر ساد بس يحفظ وانا بسيرفر يعني لو اموت تبقى الاسلحة والفلوس اما اذا اسكر واخش تروح وييجيني 50الف مع العلم انو ما في اي مود يعطي 50 الف اول ما تسجل -------- save money -------------------- addEventHandler ( 'onPlayerLogin', getRootElement ( ), function (_,acc) local Money = getAccountData ( acc, "Money" ) or "0" if ( Money ) then setPlayerMoney(source,Money) end end ) addEventHandler ( 'onPlayerQuit', getRootElement ( ), function () local Acc = getPlayerAccount ( source ) if ( Acc ) and not isGuestAccount ( Acc ) then local CurrMoney = getPlayerMoney ( source ) setAccountData ( Acc, "Money", tonumber(CurrMoney) ) end end ) ----------------------------------- -------- save weapon ------------------ local playerWeapons = { } addEventHandler("onPlayerQuit", root, function() local account = getPlayerAccount(source) if account and not isGuestAccount(account) then for slot = 1, 12 do setAccountData(account, "WeaponID"..slot, getPedWeapon(source, slot)) setAccountData(account, "Ammo"..slot, getPedTotalAmmo(source, slot)) end local LauncherAmount = getElementData(source, "Launcher") or 0 setAccountData(account, "Launcher", LauncherAmount) end end) addEventHandler("onPlayerLogin", root, function(_, account) local LauncherAmount = getAccountData(account, "Launcher") or 0 setElementData(source, "Launcher", LauncherAmount) for slot = 1, 12 do local wep = getAccountData(account, "WeaponID"..slot) local ammo = getAccountData(account, "Ammo"..slot) if wep and ammo then giveWeapon(source, wep, ammo) end end end) local playerWeapons = { } addEventHandler ( "onPlayerWasted", root, function ( ) if ( not playerWeapons [ source ] ) then playerWeapons [ source ] = { } end for slot = 0, 12 do local weapon = getPedWeapon ( source, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo ( source, slot ) if ( ammo > 0 ) then playerWeapons [ source ] [ weapon ] = ammo end end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) if ( playerWeapons [ source ] ) then for weapon, ammo in pairs ( playerWeapons [ source ] ) do giveWeapon ( source, tonumber ( weapon ), tonumber ( ammo ) ) end end playerWeapons [ source ] = nil end ) -----------------------