AR/isGuestAccount: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Server function}} This function checks to see if an account is a guest account. A guest account is an account automatically created for a user when they join the ser...") |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
هذه الوظيفة تتحقق من حساب الاعب إذا كان مسجل الدخول أو لا | |||
guest account | |||
هو حساب يُنشئ اوتوماتيكياً عند دخول الاعب ويُمسح اوتوماتيكياً الا اذا كان الاعب مسجل في السيرفر من قبل | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> |
Revision as of 14:52, 30 August 2012
هذه الوظيفة تتحقق من حساب الاعب إذا كان مسجل الدخول أو لا
guest account
هو حساب يُنشئ اوتوماتيكياً عند دخول الاعب ويُمسح اوتوماتيكياً الا اذا كان الاعب مسجل في السيرفر من قبل
Syntax
bool isGuestAccount ( account theAccount )
Required Arguments
- theAccount: The account you want to check to see if it is a guest account.
Returns
Returns true if the account is a guest account, false otherwise.
Example
This example shows how you could create a call_admin function that only could be run by registered users.
function callAdmin ( playerSource ) -- get the account of the user trying to use this function first sourceAccount = getPlayerAccount ( playerSource ) -- if they're a guest if isGuestAccount ( sourceAccount ) then -- tell them to register outputConsole ( "Please register to use this function!", playerSource ) else -- your code to call the admin would go here end end -- attach the function 'callAdmin' as a handler to the command "call_admin" addCommandHandler ( "call_admin", callAdmin )