Der "Euer W.I.P. Stuff" Thread

  • habe die letzte Woche an einer Permission Include gearbeitet, die selbständig in sqllite abspeichert.
    Mit Hilfe Dieser Include habe ich es nun auf meinen Server hinbekommen, dass ich jederzeit neue AdminGruppen erstellen und die Rechte der einzelnen Gruppen ändern kann.
    Später sollen auch einzelne Spieler Permissions erhalten können.
    Die Gruppen und Prmissions können in Gruppen eingeteilt und auch als Gruppen gehandelt werden:


    Beispiel für einige Permissions:

    CreatePermission("admin.main.aduty", "/aduty", "Gehe als Admin onduty");
    CreatePermission("admin.kickban.kick", "/kick [ID/Name]", "Kicke den Spieler vom Server");
    CreatePermission("admin.kickban.ban", "/ban [ID/Name]", "Banne den Spieler vom Server");
    CreatePermission("admin.kickban.tban", "/tban [ID/Name] [Zeit]", "Banne den Spieler für eine festgelegte Zeit vom Server");
    CreatePermission("admin.kickban.unban", "/unban [Name]", "Entbanne den Spieler mit dem Namen vom Server");


    wie man sieht wurden hier die Permissions in Gruppen eingeteilt. dadurch ist es möglich mehrere Permissions auf einmal zu handeln in dem man beispielsweise admin.kickban.* oder admin.* nutzt.
    Auch sieht man, dass direkt an die Permissions Befehle und Beschreibungen drangehangen können.
    Mithilfe dieses Systems kann man direkt alle Commands für einen Spieler anzeigen lassen oder nur Commands ener Spezziellen Permission Gruppe:
    ShowPlayerCommands(playerid,"Kick/Ban Help","admin.kickban.*");


    sollen für eine Permission mehrere commands aufgelistet werden oder soll man eine Hilfe command angezeigt bekommen wenn man irgend eine Permission einer Permission Group hat, so kann man das mit Permissionlinks realisieren, hier ein Beispiel aus meinen DayZ Server:
    // Mithilfe dieses Codes kann jemand mit spec rechten auch direkt specoff.
    CreatePermission("admin.spec", "/spec [Name/ID]", "Beobachte den angegebenen Spieler.");
    CreatePermissionLink("admin.specoff", "admin.spec", "/specoff", "Beende das Beobachten des Spielers.");


    Hier mal ein Auszug aus der Dukomentation innerhalb der Include:

    Inhalt anzeigen
    /*
    native CreatePermission(name[45],cmd[30],Desc[128])

    Inhalt anzeigen

    Inhalt anzeigen
    Registers an Permission, so that you can Use it for Commands and more. Use this in OnGamemodeInit
    Params:
    name: The Permissionname, the Name could get Permission Groups by deviding Groups and Name with an ".".
    cmd: The Command the Permission is needed for. If there is no commad just leave Blank
    desc: An description what the Command is used for. Is usefull if you use ShowCmdList(playerid,premgrp[])

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 1 If Permission got Created and 0 If it wasn't Possbile to Create the Permission
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native CreatePermissionLink(name[45],cmd[30],Desc[128])

    Inhalt anzeigen

    Inhalt anzeigen
    Registers an Permission as Link, so that this Cmd is directly useable for an allready created Permission
    Params:
    name: The Permissionname, the Name could get Permission Groups by deviding Groups and Name with an ".".
    linkname: The Permissionname, you want to link with if you want to check if the player has any Permission of an Group write like this: "admin.*"
    cmd: The Command the Permission is needed for. If there is no commad just leave Blank
    desc: An description what the Command is used for. Is usefull if you use ShowCmdList(playerid,premgrp[])

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 1 If Permission got Created and 0 If it wasn't Possbile to Create the Permission
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native HasPermission(playerid,const name[45])

    Inhalt anzeigen

    Inhalt anzeigen
    Checks if an Player has an Permission
    Params:
    playerid: The playerid, you want to check the Permission for.
    permission: The Premssionname you wants to check, if you want to check if the player has any Permission of an Group write like this: "admin.*"

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 1 If user has the Permission and 0 if the User don't have the Permission.
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native GivePermission(playerid,name[45])

    Inhalt anzeigen

    Inhalt anzeigen
    Gives an Player an Permission with storing it. (For Admin Systems and more)
    Params:
    playerid: The playerid, you want to give the Permission.
    permission: The Premssionname you wants to give to the Player, if you want to give the player all Permission of an Group write like this: "admin.*"

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 0 if it wasn't possible to give the Permission and 1 if the Permission was given.
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native GivePermissionEx(playerid,name[45])

    Inhalt anzeigen

    Inhalt anzeigen
    Gives an Player an Permission without Saving the Data forever
    Params:
    playerid: The playerid, you want to give the Permission.
    permission: The Premssionname you wants to give to the Player, if you want to give the player all Permission of an Group write like this: "admin.*"

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 0 if it wasn't possible to give the Permission and 1 if the Permission was given.
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native AddGroup(gname[60])

    Inhalt anzeigen

    Inhalt anzeigen
    Creates an Group with storing it. (For Admin Systems and more)
    Params:
    gname: The GroupName the Group will get. Give an name like admin.Administrator or admin.ProjectLeader to let an Player only be in one admin. Group.
    It's also Useable to use admin. or similar if you want to Use ShowGroups(playerid,gname[],Callback[])
    ordernum: Used for sorting the Groups when loading

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: GroupId or -1 if not able to Create.
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native RemoveGroup(groupid)

    Inhalt anzeigen

    Inhalt anzeigen
    Deletes an Group with all Data forever
    Params:
    groupid: The Group you want to delete.

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 1 if Group was deleted
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native GiveGroupPermission(groupid,name[45])

    Inhalt anzeigen

    Inhalt anzeigen
    Gives an Group an Permission with storing it. (For Admin Systems and more)
    Params:
    groupid: The groupid, you want to give the Permission. Get the groupid by using GetGroupId(groupname[])
    name: The Premssionname you wants to give to the Player.

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 0 if it wasn't possible to give the Permission and 1 if the Permission was given.
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native RemoveGroupPermission(groupid,name[45])

    Inhalt anzeigen

    Inhalt anzeigen
    Removes an Group an Permission with storing it. (For Admin Systems and more)
    Params:
    groupid: The groupid, you want to give the Permission. Get the groupid by using GetGroupId(groupname[])
    permission: The Premssionname you wants to give to the Player.

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 0 if it wasn't possible to give the Permission and 1 if the Permission was given.
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native GetGroupId(groupname[60])

    Inhalt anzeigen

    Inhalt anzeigen
    Get the GroupId of an GroupName
    Params:
    groupname: The Groupname you want to get the Permission for.

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: -1 if Group wasn't found, returns the Groupid if found
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native GetGroupOrder(groupid)

    Inhalt anzeigen

    Inhalt anzeigen
    Get the Ordernumber of an Group.
    Params:
    groupid: The Groupid you want to get the Ordernumber for. Get the groupid by using GetGroupId(groupname[])

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: -1 if Group wasn't found, returns the Ordernum if found
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native ChangeGroupOrder(groupid,ordernum)

    Inhalt anzeigen

    Inhalt anzeigen
    Change the Ordernumber of an Group.
    Params:
    groupid: The Groupid you want to change the Ordernumber for. Get the groupid by using GetGroupId(groupname[])
    ordernum: The new Ordernumber.

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 0 if Group wasn't found or 1 if sucsessfully changed
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native GetGroupName(groupid,groupname[],length)

    Inhalt anzeigen

    Inhalt anzeigen
    Get the GroupId of an GroupName
    Params:
    groupid: The Groupid you want to get the Name for.
    groupname: The String the Name should be written in.
    lenght: The length of the String. Use sizeof()

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: -1 if Group wasn't found, returns the Ordernum if found
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native PutInGroup(playerid,groupid)

    Inhalt anzeigen

    Inhalt anzeigen
    Put an player in a Group
    Params:
    playerid: The playerid, you want to put in the Group.
    groupid: The groupid, you want to give the Player. Get the groupid by using GetGroupId(groupname[])

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 1 if Player was put sucsessfully into the Group.
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native RemoveFromGroup(playerid,groupid)

    Inhalt anzeigen

    Inhalt anzeigen
    Removes an Player from an Group
    Params:
    playerid: The playerid, you want to remove from the Group.
    groupid: The groupid, you want to remove the Player from. Get the groupid by using GetGroupId(groupname[])

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 1 if Player was removed sucsessfully from the Group.
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native GetPlayerGroup(playerid,groupname[60])

    Inhalt anzeigen

    Inhalt anzeigen
    Get the Group of an player.
    Params:
    playerid: The playerid, you want to get the Group.
    groupname: The name you want to search for an Group. Search for admin.* if you want to get the next admin. Group of the Player

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: -1 if Player has no group.
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native IsInGroup(playerid,groupid)

    Inhalt anzeigen

    Inhalt anzeigen
    Get the GroupId of an GroupName
    Params:
    playerid: The playerid, you want to check.
    groupid: The groupid, you want to check if the player is in. Get the groupid by using GetGroupId(groupname[])

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 1 if the player is in the Group.
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native LoadPlayerPermission(playerid,auth[80])

    Inhalt anzeigen

    Inhalt anzeigen
    Loads all permissions of an Player including Group Permissions and more. If authstring not exist the Input gets Created.
    Can be used when Player Login.
    Params:
    playerid: The Playerid you want to load the data to.
    auth: The string the Player gets identificated by (Leave Blank for PlayerName). Can be used for User-Sqlid of the Gamemode, the Name, a Password or other.

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 1 if Player Permissions loaded.
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native ShowPlayerPermissions(playerid,target)

    Inhalt anzeigen

    Inhalt anzeigen
    Shows an Player all Permissions of an target as an Dialog.
    Params:
    playerid: The playerid that will get shown the Dialog
    target: The playerid of the Player you wnat to get the Permissions.

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 0 if one of the Player is'nt Connected.
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native ShowPlayerCommands(playerid,cap[64]="Commands",const permission[45]="")

    Inhalt anzeigen

    Inhalt anzeigen
    Shows an Player all Commands as an Dialog.
    Params:
    playerid: The playerid that will get all Commands and Descriptions
    cap: The Caption shown in the Dialog
    permission: The Permission you want to show the Command for. Leave Blank for all Permissions or use like amdin.* for all admin. Permissions.

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 0 if the Player is'nt Connected.
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native ShowPlayerGroups(playerid,cap[64]="Groups",const groupname[60]="",callback[60]="",bool:newgroup=false)

    Inhalt anzeigen

    Inhalt anzeigen
    Shows an Player all Permissions of an target as an Dialog.
    Params:
    playerid: The playerid that will get all Groups listed
    cap: The Caption shown in the Dialog
    groupname: The Group you want to show. Leave Blank for all Groups or use like amdin.* for all admin. Groups.
    callback: The Callback that will be called when User selects an Group, Callback will give parameters (playerid,groupname[60],groupid,bool:newgroup)
    newgroup: If set to True at the End of the Dialog will be an List named (New Group) when clicking on it, player can put an new Groupname inside.

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 0 if the Player is'nt Connected.
    */

    Inhalt anzeigen

    Inhalt anzeigen
    /*
    native ShowPlayerGroupPermission(playerid,groupid,cap[64]="Group-Permissions",const permission[60]="",callback[60]="",bool:allprem=false)

    Inhalt anzeigen

    Inhalt anzeigen
    Shows an Player all Permissions of an target as an Dialog.
    Params:
    playerid: The playerid that will get all Group Permission Listed
    groupid: The Group you want to get the Permissions from.
    cap: The Caption shown in the Dialog
    permission: The Permissions you want to show. Leave Blank for all Permissions or use like amdin.* for all admin. Permissions.
    callback: The Callback that will be called when User selects an Group, Callback will give parameters (playerid,groupid,permission[45],bool:haspermission)
    allprem: If set to True The Dialog will also show the Permissions the Group don't has in red.

    Inhalt anzeigen

    Inhalt anzeigen
    Returns: 0 if the Player is'nt Connected.
    */


    Ich würde gerne wissen, ob sowas auch für andere Scripter Interessant ist, die vl. sogar so wie ich generft davon sind beim hinzufügen eines neuen Admin rnaks oder ähnliches wiedermal alle Admincmds durchgehen zu müssen...


    //Goldkiller: Premission, ernsthaft ? Es heißt permission :wacko: .
    Goldkiller: Danke dir dafür dass du mich auf diesen Groben fehler aufmerksam gemacht hast habe nun alles geändert.

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen