AR/logOut

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

هذه الوظيفة تقوم بتسجيل خروج لاعب معين من حسابه الحالي

Syntax

bool logOut ( player thePlayer )

العناصر المطلوبة

  • thePlayer: اللاعب الذي تريد تسجيله الخروج من حسابه الحالي

Returns

Returns true if the player was successfully logged out, false or nil if it failed for some reason, ie. the player was never logged in.

مثال

هذا المثال يقوم بتسجيل خروج جميع اللاعبين في السيرفر من حساباتهم

function logoutAll()
   local players = getElementsByType("player") -- جلب جميع اللاعبين
   for i, player in ipairs(players) do -- المرور على جميع اللاعبين
      local account = getPlayerAccount(player) -- الحصول على جميع حسابات اللاعبين
      if not(isGuestAccount(account)) then -- التأكد من أن اللاعب مسجل دخول
         logOut(player) -- تسجيل خروج اللاعب من حسابه.
      end
   end
end
addEventHandler("onResourceStart", resourceRoot, logoutAll) -- تسجيل خروج جميع اللاعبين عند تشغيل المود

انظر ايضاً