AR/getAccountPlayer

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

ملاحظة :

لا تصلح الوظيفة اذا لاعبين دخلوا في نفس الحساب

Syntax

player getAccountPlayer ( account theAccount )

Required Arguments

  • theAccount: الحساب الذي تريد ان تتحقق من الاعب منه

Returns

Returns a player element if the account is currently in use, false otherwise.

مثال

هذا المثال يتحقق اذا كان الاعب مرتبط بهذا الحساب

function isAccountUserAlive ( theAccount )
    local thePlayer = getAccountPlayer ( theAccount )       --s يتحقق من الاعب الذي يرتبط بالحساب
    if ( getElementType ( thePlayer ) == "player" ) then    --s يتحقق من الاعب الذي يرتبط بهذا الحساب , اذا كان لاعب
        return not isPedDead(thePlayer)             --s يتحقق من ان صحة الاعب اكثر من 0
    end
    return false
end

انظر أيضاً