Solved Reportsystem-Help

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Runakai

Supporter
Apr 27, 2018
496
32
28
code_language.skript:
command /report [<player>] [<text>]:
    trigger:
        if arg 1 is not set:
            message "&8[&cReport&8] &7Bitte gebe einen Namen ein"
            stop
        if arg 2 is not set:
            message "&8[&cReport&8] &7Bitte gebe einen Grund ein"
            stop
        {_command.%player%.lastused} was less than 1 minute ago:
            message "&8[&cReport&8] &7Bitte warte eine Minute, bevor du den Command erneut benutzt"
            stop
        set {_command.%player%.lastused} to now
        if arg 1 is set:
            if arg 2 is set:
                if arg 1 is not player:
                    send "&8[&cReport&8] &7Der Spieler &6%arg 1% &7wurde von dir für &6%arg-2% &7reported"
                #    log  "%sender% hat den Spieler <%arg 1%> für <%arg 2%> reportet"
                    add 1 to {totalreports}
                    set {wurdereportetvon::%player%} to player
                    add player to {reportlist::*}
                    add arg-1 to {wirdreportet::*}
                    set {wirdreportetweil::%arg-1%} to arg-2
                    loop all players:
                        loop-player has permission "sk.report.see"
                        send "&8[&cReport&8] &7Der Spieler &6%player% &7hat &6%arg-1% &7für &6%arg-2% &7reported" to loop-player
                        send "&8[&cReport&8] &7Mache /reports, um die Reports anzusehen"
                        if {totalreports} is more than 2:
                            send "&8[&cReport&8] &7Es sind noch &e&n%{totalreports}% &7Reports offen"
                        if {totalreports} is 1:
                            send "&8[&cReport&8] &7Es ist noch &e&n%{totalreports}% &7Report offen"
                        if {totalreports} is less than 1:
                            send "&8[&cReport&8] &7Es sind keine Reports offen"           
                else:
                    send "&8[&cReport&8] &7Du kannst dich nicht selbst reporten!"
on inventory click:
    if name of player's current inventory is "&cReports":
        set {_p} to player
        set {_friend} to "%uncoloured clicked item's name%"
        set {_f} to "%{_friend}%" parsed as a offline player
        open chest with 1 row named "&cReport-Menue" to {_p}
        wait a tick
        set {_s} to 0
        loop 9 times:
            set slot {_s} of {_p}'s current inventory to black stained glass pane named " "
            add 1 to {_s}
        set slot 0 of {_p}'s current inventory to {_f}'s skull named "&7Übernehme den Report von: &6%{_f}%"
        set slot 2 of {_p}'s current inventory to ender pearl named "&e%{_f}%"
on inventory click:
    if name of player's current inventory is "&cReport-Menue":
        set {_jump} to "%uncoloured clicked item's name%"
        set {_player} to "%{_jump}%" parsed as a offline player
        cancel event 
        clicked slot is 2:
            loop {wirdreportet::*}:
                if {wirdreportet::*} contains {_player}:
                    teleport player to {_player}
                #    remove {_player} from {wurdereportetvon::*}
                    remove {_player} from {reportlist::*}
                    remove {_player} from {wirdreportet::*}
                    delete {wirdreportetweil::%{_player}%}
                    set {totalreports} to {totalreports}-1
                make player execute command "/vanish"
function reportPage(p: player, page: number):
    set {_pageStart} to 45*{_page}
    set {_i} to 1
    set {_a} to 0
    open chest with 6 rows named "&cReports" to {_p}
    wait 2 ticks
    loop {wirdreportet::*}:
        (loop-index parsed as integer) > {_pageStart}
        set {_player} to "%loop-value%" parsed as offline player
        set slot {_a} of {_p}'s current inventory to loop-value's skull named "&7%loop-value%" with lore "&7Von: %{wurdereportetvon::%{_p}%}%||&7wegen: &e%{wirdreportetweil::%loop-value%}%"
        add 1 to {_a}
        if {_a} = ((45*{_i})):
            exit loop
    format slot 49 of {_p} with book named "&cHauptseite" to run [reportPage({_p}, 0)]
    if (amount of {wirdreportet::*}) > {_pageStart} + 45:
        format slot 53 of {_p} with arrow named "&7Nächste Seite" to run [reportPage({_p}, ({_page} + 1))]
    if {_page} > 0:
        format slot 45 of {_p} with arrow named "&8Nächset Seite" to run [reportPage({_p}, ({_page} - 1))]
command /reports:
    permission: sk.reports.see
    trigger:
        reportPage(player, 0)

Hello, me again :emoji_slight_smile:

My Problem is: The Lore of the Skull. Like: I dont know how to set the lore like per skull. When a Player reports an other player it should be like "Was reportet by: %player% for: reason" and it works. But when they report the player again, the skull is added to the GUI and the other skull which was created before the other has the exact same"reason" part how can i fix this?
 
Ugh, I think I know how to fix this, but it would be quite a long one to write.
If im understanding your skript properly, and what you are looking to achieve, you should assign ID's to each report.... because I think the problem is, they are getting overwritten each time a player is reported, so write something that differentiates each report
 
Ugh, I think I know how to fix this, but it would be quite a long one to write.
If im understanding your skript properly, and what you are looking to achieve, you should assign ID's to each report.... because I think the problem is, they are getting overwritten each time a player is reported, so write something that differentiates each report

I tried this:

code_language.skript:
command /report [<player>] [<text>]:
    trigger:
        if arg 1 is not set:
            message "&8[&cReport&8] &7Bitte gebe einen Namen ein"
            stop
        if arg 2 is not set:
            message "&8[&cReport&8] &7Bitte gebe einen Grund ein"
            stop
        {_command.%player%.lastused} was less than 1 minute ago:
            message "&8[&cReport&8] &7Bitte warte eine Minute, bevor du den Command erneut benutzt"
            stop
        set {_command.%player%.lastused} to now
        if arg 1 is set:
            if arg 2 is set:
                if arg 1 is not player:
                    send "&8[&cReport&8] &7Der Spieler &6%arg 1% &7wurde von dir für &6%arg-2% &7reported"
                #    log  "%sender% hat den Spieler <%arg 1%> für <%arg 2%> reportet"
                    add 1 to {totalreports}
                    set {_RID} to "%random integer between 0 and 9%%random 1 char string from `a-zA-Z`%%random integer between 100 and 999%%random 1 char string from `a-zA-Z`%%random integer between 10 and 99%_%random 1 char string from `a-zA-Z0-9`%"
                    set {wurdereportetvon.%{_RID}%::%player%} to player
                    add player to {reportlist::*}
                    add arg-1 to {wirdreportet::*}
                    set {wirdreportetwegen.%{_RID}%::%arg-1%} to arg-2
                    loop all players:
                        loop-player has permission "sk.report.see"
                        send "&8[&cReport&8] &7Der Spieler &6%player% &7hat &6%arg-1% &7für &6%arg-2% &7reported" to loop-player
                        send "&8[&cReport&8] &7Mache /reports, um die Reports anzusehen"
                        if {totalreports} is more than 2:
                            send "&8[&cReport&8] &7Es sind noch &e&n%{totalreports}% &7Reports offen"
                        if {totalreports} is 1:
                            send "&8[&cReport&8] &7Es ist noch &e&n%{totalreports}% &7Report offen"
                        if {totalreports} is less than 1:
                            send "&8[&cReport&8] &7Es sind keine Reports offen"           
                else:
                    send "&8[&cReport&8] &7Du kannst dich nicht selbst reporten!"
on inventory click:
    if name of player's current inventory is "&cReports":
        set {_p} to player
        set {_friend} to "%uncoloured clicked item's name%"
        set {_f} to "%{_friend}%" parsed as a offline player
        open chest with 1 row named "&cReport-Menue" to {_p}
        wait a tick
        set {_s} to 0
        loop 9 times:
            set slot {_s} of {_p}'s current inventory to black stained glass pane named " "
            add 1 to {_s}
        set slot 0 of {_p}'s current inventory to {_f}'s skull named "&7Übernehme den Report von: &6%{_f}%"
        set slot 2 of {_p}'s current inventory to ender pearl named "&e%{_f}%"
on inventory click:
    if name of player's current inventory is "&cReport-Menue":
        set {_jump} to "%uncoloured clicked item's name%"
        set {_player} to "%{_jump}%" parsed as a offline player
        cancel event 
        clicked slot is 2:
            loop {wirdreportet::*}:
                if {wirdreportet::*} contains {_player}:
                    teleport player to {_player}
                #    remove {_player} from {wurdereportetvon::*}
                    remove {_player} from {reportlist::*}
                    remove {_player} from {wirdreportet::*}
                    delete {wirdreportetweil::%{_player}%}
                    set {totalreports} to {totalreports}-1
                make player execute command "/vanish"
function reportPage(p: player, page: number):
    set {_pageStart} to 45*{_page}
    set {_i} to 1
    set {_a} to 0
    open chest with 6 rows named "&cReports" to {_p}
    wait 2 ticks
    loop {wirdreportet::*}:
        (loop-index parsed as integer) > {_pageStart}
        set {_player} to "%loop-value%" parsed as offline player
        set slot {_a} of {_p}'s current inventory to loop-value's skull named "&7%loop-value%" with lore "&7Von: %{wurdereportetvon::%{_p}%}%||&7wegen: &e%{wirdreportetwegen.%{_RID}%::%loop-value%}%"
        add 1 to {_a}
        if {_a} = ((45*{_i})):
            exit loop
    format slot 49 of {_p} with book named "&cHauptseite" to run [reportPage({_p}, 0)]
    if (amount of {wirdreportet::*}) > {_pageStart} + 45:
        format slot 53 of {_p} with arrow named "&7Nächste Seite" to run [reportPage({_p}, ({_page} + 1))]
    if {_page} > 0:
        format slot 45 of {_p} with arrow named "&8Nächset Seite" to run [reportPage({_p}, ({_page} - 1))]
command /reports:
    permission: sk.reports.see
    trigger:
        reportPage(player, 0)

And now the "reason-part" is <none>
 
I feel like your skript is kind of all over the place
But here is what I would do
I would set an id system, like on the first load of the skript set {report.id} to 0, and each time a player reports a player it would add 1 to that variable.
Then on each report do something like this
set {report::%{report.id}%::emoji_stuck_out_tongue:layer} to the player being reported <--- that is NOT supposed to be a smiley, its a colon and a p
set {report::%{report.id}%::reporter} to the person who reported said player
set {report::%{report.id}%::reason} to the reason they were reported

And do that for anything you would want to add to that specific report ID so when you call upon it later in your gui, you can easily pull all the information from the specific ID
 
Last edited by a moderator:
I feel like your skript is kind of all over the place
But here is what I would do
I would set an id system, like on the first load of the skript set {report.id} to 0, and each time a player reports a player it would add 1 to that variable.
Then on each report do something like this
set {report::%{report.id}%::emoji_stuck_out_tongue:layer} to the player being reported
set {report::%{report.id}%::reporter} to the person who reported said player
set {report::%{report.id}%::reason} to the reason they were reported

And do that for anything you would want to add to that specific report ID so when you call upon it later in your gui, you can easily pull all the information from the specific ID
code_language.skript:
command /report [<player>] [<text>]:
    trigger:
        if arg 1 is not set:
            message "&8[&cReport&8] &7Bitte gebe einen Namen ein"
            stop
        if arg 2 is not set:
            message "&8[&cReport&8] &7Bitte gebe einen Grund ein"
            stop
        {_command.%player%.lastused} was less than 1 minute ago:
            message "&8[&cReport&8] &7Bitte warte eine Minute, bevor du den Command erneut benutzt"
            stop
        set {_command.%player%.lastused} to now
        if arg 1 is set:
            if arg 2 is set:
                if arg 1 is not "DASplayer":
                    send "&8[&cReport&8] &7Der Spieler &6%arg 1% &7wurde von dir für &6%arg-2% &7reported"
                #    log  "%sender% hat den Spieler <%arg 1%> für <%arg 2%> reportet"
                    add 1 to {totalreports}
                    if {alreadyreported.%arg-1%} is not set:
                        set {alreadyreported.%arg-1%} to true
                        set {wurdereportetvon::%{RID}%::%player%} to player
                        set {wirdreportetwegen::%{RID}%::%arg-1%} to arg-2                       
                        add player to {reportlist::*}
                        add arg-1 to {wirdreportet::*}
                    else:
                        set {wirdreportetwegen::%{RID}%::%arg-1%} to arg-2
                        set {wurdereportetvon::%{RID}%::%player%} to player
                    loop all players:
                        loop-player has permission "sk.report.see"
                        send "&8[&cReport&8] &7Der Spieler &6%player% &7hat &6%arg-1% &7für &6%arg-2% &7reported" to loop-player
                        send "&8[&cReport&8] &7Mache /reports, um die Reports anzusehen"
                        if {totalreports} is more than 2:
                            send "&8[&cReport&8] &7Es sind noch &e&n%{totalreports}% &7Reports offen"
                        if {totalreports} is 1:
                            send "&8[&cReport&8] &7Es ist noch &e&n%{totalreports}% &7Report offen"
                        if {totalreports} is less than 1:
                            send "&8[&cReport&8] &7Es sind keine Reports offen"           
                else:
                    send "&8[&cReport&8] &7Du kannst dich nicht selbst reporten!"
on inventory click:
    if name of player's current inventory is "&cReports":
        set {_p} to player
        set {_friend} to "%uncoloured clicked item's name%"
        set {_f} to "%{_friend}%" parsed as a offline player
        open chest with 1 row named "&cReport-Menue" to {_p}
        wait a tick
        set {_s} to 0
        loop 9 times:
            set slot {_s} of {_p}'s current inventory to black stained glass pane named " "
            add 1 to {_s}
        set slot 0 of {_p}'s current inventory to {_f}'s skull named "&7Übernehme den Report von: &6%{_f}%"
        set slot 2 of {_p}'s current inventory to ender pearl named "&e%{_f}%"
on inventory click:
    if name of player's current inventory is "&cReport-Menue":
        set {_jump} to "%uncoloured clicked item's name%"
        set {_player} to "%{_jump}%" parsed as a offline player
        cancel event 
        clicked slot is 2:
            loop {wirdreportet::*}:
                if {wirdreportet::*} contains {_player}:
                    teleport player to {_player}
                    delete {alreadyreported.%{_player}%}
                #    remove {_player} from {wurdereportetvon::*}
                    remove {_player} from {reportlist::*}
                    remove {_player} from {wirdreportet::*}
                    delete {wirdreportetweil::%{_player}%}
                    set {totalreports} to {totalreports}-1
                make player execute command "/vanish"
function reportPage(p: player, page: number):
    set {_pageStart} to 45*{_page}
    set {_i} to 1
    set {_a} to 0
    open chest with 6 rows named "&cReports" to {_p}
    wait 2 ticks
    loop {wirdreportet::*}:
        (loop-index parsed as integer) > {_pageStart}
        set {_player} to "%loop-value%" parsed as offline player
        set slot {_a} of {_p}'s current inventory to loop-value's skull named "&7%loop-value%" with lore "&7Von: %{wurdereportetvon::%{RID}%::%loop-value%}%||&7wegen: &e%{wirdreportetwegen::%{RID}%::%loop-value%}%"
        add 1 to {_a}
        if {_a} = ((45*{_i})):
            exit loop
    format slot 49 of {_p} with book named "&cHauptseite" to run [reportPage({_p}, 0)]
    if (amount of {wirdreportet::*}) > {_pageStart} + 45:
        format slot 53 of {_p} with arrow named "&7Nächste Seite" to run [reportPage({_p}, ({_page} + 1))]
    if {_page} > 0:
        format slot 45 of {_p} with arrow named "&8Nächset Seite" to run [reportPage({_p}, ({_page} - 1))]
command /reports:
    permission: sk.reports.see
    trigger:
        reportPage(player, 0)
So i just did ths :emoji_grinning: I had to make it work for today and will do yours for tomorrow. Yours is defenitly better.
 
Status
Not open for further replies.