gms_self_admin_rights

Usage: gms_self_admin_rights ( )

Description

Returns what the player is allowed to do.

The following flags can be returned:

ar_kick: Allowed to kick
ar_ban: Allowed to ban
ar_owner: The player owns the game

Example

//Note the notation: & instead of =
if(gms_self_admin_rights() & ar_ban)
{
    //Player is allowed to ban
}else if(gms_self_admin_rights() & ar_kick)
{
    //Player allowed to kick
}

Replies (12)

Last message on 17 Dec 2022

xcj233 on 2 Nov 2022, 03:17:45
Size43,Why do I get this error with this command:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Create Event
for object Player:

local variable ar_owner(100003, -2147483648) not set before reading it.
at gml_Script_gms_draw_name
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_gms_draw_name (line -1)
gml_Object_Player_Create_0
called from - gml_Room_room_init_Create (line -1) - <unknown source line>
Size43 (Administrator) on 17 Dec 2022, 20:14:41
Apologies for the delay. Did the extension get imported successfully? It sounds like some constants that should be there, somehow aren't.
CrotyXeno on 17 Nov 2022, 14:09:40
Nesesito ayuda ya van 5 veses que me sale esto al intentar jugar :(
xcj233 on 17 Nov 2022, 14:25:51
??????
Gamewolf10 on 26 Jun 2015, 22:39:39
Can you use just gms_self_admin_rights instead of the notation mark?
JamSnack on 26 Nov 2017, 16:39:06
The if statement is looking to prove if the player has the ability to do one of the three initially stated flags that may be returned (gms_self_admin_right()) and if the player is able to ban people. If gms_self_admin_rights() does not return with ar_ban than the player may not ban people, thus activating the else if statement in which it checks the player's permission to kick.

Correct me if I am wrong. This is only what I believe this code is stating.
Size43 (Administrator) on 27 Jun 2015, 12:33:30
I don't think I fully understand what you're asking. You'll have to use & because the value returned can contain multiple permissions, not just one.
metacoderz on 20 Nov 2022, 07:56:32
Why has my df title sealed t3 and not been unlocked yet?
@Size43
Size43 (Administrator) on 17 Dec 2022, 20:21:53
Please contact the developer or moderators of the game instead.
metacoderz on 20 Nov 2022, 08:02:20
Wrong.
metacoderz on 20 Nov 2022, 08:04:02
What I'm trying to say is
Why has my DF game title sealed T3 and still hasn't been unlocked yet?
metacoderz on 20 Nov 2022, 08:04:33
Forget it, don't say it.