Jump to content

مشكله في حفظ النجوم/ تم الافاده ذأ كيل


Recommended Posts

بسـم ألله الرحمن الرحيم

ألـسلام عليكم

اخـوأني لـدي مشكلـه فـي حفظ النجـوم ابلشـتني

جـربت كذا كود مـوو رأضي

جربت سيف سستم و كذالكك ذا الموضوع جربت كل الاكواد تبع الأخ عنـأد

viewtopic.php?f=160&t=62278

ولأ ادري وش الحل :idea:

Edited by Guest
Link to comment
  
function onLeave (thePlayer) 
local level = getPlayerWantedLevel(thePlayer) 
if isGuestAccount then return end 
 local account = getPlayerAccount(thePlayer) 
setAccountData(account,"wanted",level) 
end 
addEventHandler("onPlayerQuit",root,onLeave) 
  
  
  
function onLogin (thePlayer) 
local account = getPlayerAccount 
local level = getAccountData(account,"wanted") 
setPlayerWantedLevel(thePlayer,level) 
end 
addEventHandler("onPlayerLogin",root,onLogin) 
  

Link to comment

^ خرابيط

Edit #

جرب ذا

function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) 
  if  not (isGuestAccount (getPlayerAccount (source))) then 
    local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel") 
    setTimer (setPlayerWantedLevel, 50, 1, source, playerWanted) 
    end 
   end 
 addEventHandler("onPlayerLogin",root,playerLogin) 
  
  
  function onQuit (quitType, reason, responsibleElement) 
    if not (isGuestAccount (getPlayerAccount (source))) then 
        account = getPlayerAccount (source) 
         if (account) then 
          setAccountData (account, "funmodev2-wantedlevel", getPlayerWantedLevel (source)) 
         end 
      end 
   end 
 addEventHandler("onPlayerQuit",root,onQuit) 
Edited by Guest
Link to comment
  
function onLeave (thePlayer) 
local level = getPlayerWantedLevel(thePlayer) 
if isGuestAccount then return end 
 local account = getPlayerAccount(thePlayer) 
setAccountData(account,"wanted",level) 
end 
addEventHandler("onPlayerQuit",root,onLeave) 
  
  
  
function onLogin (thePlayer) 
local account = getPlayerAccount 
local level = getAccountData(account,"wanted") 
setPlayerWantedLevel(thePlayer,level) 
end 
addEventHandler("onPlayerLogin",root,onLogin) 
  

حطيته سيرفر م ضبط

Link to comment
^ خرابيط

Edit #

جرب ذا

function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) 
  if  not (isGuestAccount (getPlayerAccount (source))) then 
    local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel") 
    setTimer (setPlayerWantedLevel, 50, 1, source, playerWanted) 
    end 
   end 
 addEventHandler("onPlayerLogin",root,playerLogin) 
  
  
  function onQuit (quitType, reason, responsibleElement) 
    if not (isGuestAccount (getPlayerAccount (source))) then 
        account = getPlayerAccount (source) 
         if (account) then 
          setAccountData (account, "funmodev2-wantedlevel", getPlayerWantedLevel (source)) 
         end 
      end 
   end 
 addEventHandler("onPlayerQuit",root,onQuit) 

م ضبط طبعـأ م اتوقع المشكله من كودكك لين جربت اكواد واجد ما ضبط

بس بسالك م ينفع تسوي تايمر يعني بعد موت الاعب ب كم ثانيه ترجع النجوم لين يمقن فيه شي يمسحها قبل الكود يرجعها وكذا :)

Link to comment

طيب جرب

    function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) 
      if  not (isGuestAccount (getPlayerAccount (source))) then 
        local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel") 
        setTimer (setPlayerWantedLevel, 1000, 1, source, playerWanted) 
        end 
       end 
     addEventHandler("onPlayerLogin",root,playerLogin) 
      
      
      function onQuit (quitType, reason, responsibleElement) 
        if not (isGuestAccount (getPlayerAccount (source))) then 
            account = getPlayerAccount (source) 
             if (account) then 
              setAccountData (account, "funmodev2-wantedlevel", getPlayerWantedLevel (source)) 
             end 
          end 
       end 
     addEventHandler("onPlayerQuit",root,onQuit) 
  
addEventHandler("onPlayerSpawn", root, 
    function () 
        local playerWanted = getAccountData (source, "funmodev2-wantedlevel") 
          if (playerWanted) then 
         setTimer (setPlayerWantedLevel, 1000, 1, source, playerWanted) 
        end 
    end 
) 
Link to comment
طيب جرب

    function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) 
      if  not (isGuestAccount (getPlayerAccount (source))) then 
        local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel") 
        setTimer (setPlayerWantedLevel, 1000, 1, source, playerWanted) 
        end 
       end 
     addEventHandler("onPlayerLogin",root,playerLogin) 
      
      
      function onQuit (quitType, reason, responsibleElement) 
        if not (isGuestAccount (getPlayerAccount (source))) then 
            account = getPlayerAccount (source) 
             if (account) then 
              setAccountData (account, "funmodev2-wantedlevel", getPlayerWantedLevel (source)) 
             end 
          end 
       end 
     addEventHandler("onPlayerQuit",root,onQuit) 
  
addEventHandler("onPlayerSpawn", root, 
    function () 
        local playerWanted = getAccountData (source, "funmodev2-wantedlevel") 
          if (playerWanted) then 
         setTimer (setPlayerWantedLevel, 1000, 1, source, playerWanted) 
        end 
    end 
) 

نفس الششي

Link to comment
والله مدري وش مسوي انت

ولا شكلك مسوي مود ثاني

لاأن الكود شغال معي

خلاص عرفته بجربه الحين في سيرفر مافيه ولا مود بشوف المشكله مو المودات تبعي يمقن

Link to comment
طيب جرب

    function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) 
      if  not (isGuestAccount (getPlayerAccount (source))) then 
        local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel") 
        setTimer (setPlayerWantedLevel, 1000, 1, source, playerWanted) 
        end 
       end 
     addEventHandler("onPlayerLogin",root,playerLogin) 
      
      
      function onQuit (quitType, reason, responsibleElement) 
        if not (isGuestAccount (getPlayerAccount (source))) then 
            account = getPlayerAccount (source) 
             if (account) then 
              setAccountData (account, "funmodev2-wantedlevel", getPlayerWantedLevel (source)) 
             end 
          end 
       end 
     addEventHandler("onPlayerQuit",root,onQuit) 
  
addEventHandler("onPlayerSpawn", root, 
    function () 
        local playerWanted = getAccountData (source, "funmodev2-wantedlevel") 
          if (playerWanted) then 
         setTimer (setPlayerWantedLevel, 1000, 1, source, playerWanted) 
        end 
    end 
) 

كودك زائد

isGuestAccountليش الحاجة لـ onPlayerLogin Eventاذا كان الـ

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...