How to display

  • 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 comminuty!

    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.

Shroomz

Supporter +
Jun 22, 2017
44
0
6
25
I wanna display my warning message to players that were offline when warning was given. So basically:

1. I give warning to offline player
2. Warned player comes online and gets message that says "you have been warned for: <reason>"
3. player logs out
4. player logs in and cant see this message anymore since he has seen it once already


So how I can do it?
 
Do you have any basic code for this yet?
Yes...

code_language.skript:
command /warning [<text>] [<text>]:
    aliases: warn
    usage: &c/warning <player> <reason>
    trigger:
        if {%player%.gamemaster} is true:
            if arg 1 is set:
                if arg 2 is set:
                    set {_warned} to arg 1
                    broadcast "鐖 &c%arg 1% has been warned by Gamemaster &r鐖"
                    wait 1 tick
                    broadcast "&creason for warning: '&4%arg 2%&c'"
                    add 1 to {%arg 1%.warnings}
                    add 1 to {warning.count}
                    message "&cYou've succesfully warned %arg 1%, They have %{%arg 1%.warnings}% warning(s)!"
                    if {%arg 1%.warnings} is 5:
                        kick {_warned} due to "You got 5 warnings... Oops..."
                    if {_warned} is offline:
                        set {%arg 1%.offlinewarn} to true
                        set {%arg 1%.offline_warning} to arg 2
                if arg 2 is not set:
                    set {_warned} to arg 1
                    broadcast "鐖 &c%arg 1% has been warned by Gamemaster &r鐖"
                    add 1 to {%arg 1%.warnings}
                    add 1 to {warning.count}
                    message "&cYou've succesfully warned %arg 1%, They have %{%arg 1%.warnings}% warning(s)!"
                    wait 2 ticks
                    if {%arg 1%.warnings} is 5:
                        kick {_warned} due to "You got 5 warnings... Oops..."
                    if {_warned} is offline:
                        set {%arg 1%.offlinewarn} to true
                        set {%arg 1%.offline_warning} to arg 2
 
Yes...

code_language.skript:
command /warning [<text>] [<text>]:
    aliases: warn
    usage: &c/warning <player> <reason>
    trigger:
        if {%player%.gamemaster} is true:
            if arg 1 is set:
                if arg 2 is set:
                    set {_warned} to arg 1
                    broadcast "鐖 &c%arg 1% has been warned by Gamemaster &r鐖"
                    wait 1 tick
                    broadcast "&creason for warning: '&4%arg 2%&c'"
                    add 1 to {warnings::%arg-1%}
                    add 1 to {warningcount::%arg-1%}
                    message "&cYou've succesfully warned %arg-1%, They have %{warningcount::%arg-1%}% warning(s)!"
                    if {warningcount::%arg-1%} is 5:
                        kick {_warned} due to "You got 5 warnings... Oops..."
                    if {_warned} is offline:
                        set {%arg 1%.offlinewarn} to true
                        set {%arg 1%.offline_warning} to arg 2
                if arg 2 is not set:
                    set {_warned} to arg 1
                    broadcast "鐖 &c%arg 1% has been warned by Gamemaster &r鐖"
                    add 1 to {%arg 1%.warnings}
                    add 1 to {warning.count}
                    message "&cYou've succesfully warned %arg 1%, They have %{%arg 1%.warnings}% warning(s)!"
                    wait 2 ticks
                    if {%arg 1%.warnings} is 5:
                        kick {_warned} due to "You got 5 warnings... Oops..."
                    if {_warned} is offline:
                        set {%arg 1%.offlinewarn} to true
                        set {%arg 1%.offline_warning} to arg 2

Might not work, but you seem to have a lot of code errors when I ran this
 
Forget him, Uhm, just check if player is not online, then set into variables with Reason for warn, and if the player, who got warned while offline, joined, check if variables set, then display it.
Well I have this but wont work...
code_language.skript:
on join:
   if {%player%.offlinewarn} is true:
        message "鐖&cYou have been warned, reason '%{%player%.offline_warning}%'"
        delete {%player%.offline_warning}
 
Well I have this but wont work...
code_language.skript:
on join:
   if {%player%.offlinewarn} is true:
        message "鐖&cYou have been warned, reason '%{%player%.offline_warning}%'"
        delete {%player%.offline_warning}
oke. first ... you need parsed it as player

code_language.skript:
set {_warned} to arg-1 parsed as player
...
...
if {_warned} is offline:
#OR, remove {_warned}
if ("%arg-1%" parsed as offline player) is offline:
    set {Warned::%arg-1%} to arg-2

on join:
    wait a ticks
    if {Warned::%player%} is set:
        send "You got warned: %{Warned::%player%}%"
        delete {Warned::%player%}
 
oke. first ... you need parsed it as player

code_language.skript:
set {_warned} to arg-1 parsed as player
...
...
if {_warned} is offline:
#OR, remove {_warned}
if ("%arg-1%" parsed as offline player) is offline:
    set {Warned::%arg-1%} to arg-2

on join:
    wait a ticks
    if {Warned::%player%} is set:
        send "You got warned: %{Warned::%player%}%"
        delete {Warned::%player%}
I did this... wont work..
code_language.skript:
command /warning [<text>] [<text>]:
    aliases: warn
    usage: &c/warning <player> <reason>
    trigger:
        if {%player%.gamemaster} is true:
            if arg 1 is set:
                if arg 2 is set:
                    set {_warned} to arg-1 parsed as player
                    broadcast "鐖 &c%arg 1% has been warned by Gamemaster &r鐖"
                    wait 1 tick
                    broadcast "&creason for warning: '&4%arg 2%&c'"
                    add 1 to {%arg 1%.warnings}
                    add 1 to {warning.count}
                    message "&cYou've succesfully warned %arg 1%, They have %{%arg 1%.warnings}% warning(s)!"
                    if {_warned} is offline:
                        set {Warned::%arg-1%} to arg-2
                if arg 2 is not set:
                    set {_warned} to arg-1 parsed as player
                    broadcast "鐖 &c%arg 1% has been warned by Gamemaster &r鐖"
                    add 1 to {%arg 1%.warnings}
                    add 1 to {warning.count}
                    message "&cYou've succesfully warned %arg 1%, They have %{%arg 1%.warnings}% warning(s)!"
                    wait 2 ticks
                    if {_warned} is offline:
                        set {Warned::%arg-1%} to arg-2
                        
on join:
    wait 10 ticks
    if {Warned::%player%} is set:
        send "You got warned: %{Warned::%player%}%"
        delete {Warned::%player%}
 
no any errors? Btw do then debugs. if you get some message, if player is offline.

code_language.skript:
if {_warned} is offline:
    broadcast "Debugs"
 
code_language.skript:
command /warning [<offlineplayer>] [<text>]:
    trigger:
        set {offline.%arg-1%} to "%arg-2%"
 
on join:
    if {offline.%player%} is set:
        send "%{offline.%player%}%"
        delete {offline.%player%}
 
Status
Not open for further replies.