Help with skript commands on offline players

  • 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.

martinn112

Member
Jan 21, 2018
23
0
1
Hello, i am trying to make my own kick, mute and ban system with skript. I would like to have it show a player's prefix, name and suffix. It works fine when they are online but when offline it says none with all 3. but the player does get banned if it is ban.

Here is the skript i currently have
code_language.skript:
on join:
    if {muted.%player%} is not set:
        set {muted.%player%} to false

command /vban [<OfflinePlayer>] [<Text>] [<Text>]:
    permission: c.officer
    permission message: &cDu har ikke permission
    trigger:
        if offlineplayer-argument is "martinn112" or "a1b2c3lou":
            execute console command "kick %player% '&4Det kan du godt glemme!'"
            stop
        if offlineplayer-argument or arg-2 or arg-3 is not set:
            send "&1&l[&9&lMartinixy&1&l] &4>> &c/vban 'Spiller' 'Tid' 'Grund'" to player
            stop
        if offlineplayer-argument, arg-2 and arg-3 is set:
            execute console command "tempban %arg-1% %arg-2% %arg-3%"
            broadcast "&1&l[&9&lMartinixy&1&l] &4>> %colored offlineplayer-argument's prefix%%offlineplayer-argument's name%%colored offlineplayer-argument's suffix% &cer blevet banned af    %colored player's prefix%%player's name%%colored player's suffix% &ci &4%arg-2% &cmed grunden &4%arg-3%"

command /vunban [<OfflinePlayer>]:
    permission: c.officer
    permission message: &cDu har ikke permission
    trigger:
        if offlineplayer-argument is not set:
            send "&1&l[&9&lMartinixy&1&l] &4>> &c/vunban 'Spiller'" to player
            stop
        if offlineplayer-argument is set:
            execute console command "unban %arg-1%"
            broadcast "&1&l[&9&lMartinixy&1&l] &4>> %colored offlineplayer-argument's prefix%%offlineplayer-argument's name%%colored offlineplayer-argument's suffix% &cer blevet unbanned af    %colored player's prefix%%player's name%%colored player's suffix%"

command /vkick [<OfflinePlayer>] [<Text>]:
    permission: c.officer
    permission message: &cDu har ikke permission
    trigger:
        if offlineplayer-argument is "martinn112" or "a1b2c3lou":
            execute console command "kick %player% '&4Det kan du godt glemme!'"
            stop
        if offlineplayer-argument or arg-2 is not set:
            send "&1&l[&9&lMartinixy&1&l] &4>> &c/vkick 'Spiller' 'Grund'" to player
            stop
        if offlineplayer-argument and arg-2 is set:
            execute console command "kick %offlineplayer-argument% %arg-2%"
            broadcast "&1&l[&9&lMartinixy&1&l] &4>> %colored offlineplayer-argument's prefix%%offlineplayer-argument's name%%colored offlineplayer-argument's suffix% &cer blevet kicked af    %colored player's prefix%%player's name%%colored player's suffix% &cmed grunden &4%arg-2%"
        
command /vmute [<OfflinePlayer>] [<Text>] [<Text>]:
    permission: c.officer
    permission message: &cDu har ikke permission
    trigger:
        if offlineplayer-argument is "martinn112" or "a1b2c3lou":
            execute console command "kick %player% '&4Det kan du godt glemme!'"
            stop
        if offlineplayer-argument or arg-2 or arg-3 is not set:
            send "&1&l[&9&lMartinixy&1&l] &4>> &c/vmute 'Spiller' 'Tid' 'Grund'" to player
            stop
            stop
        if offlineplayer-argument, arg-2 and arg-3 is set:
            execute console command "mute %offlineplayer-argument% %arg-2% %arg-3%"
            broadcast "&1&l[&9&lMartinixy&1&l] &4>> %colored offlineplayer-argument's prefix%%offlineplayer-argument's name%%colored offlineplayer-argument's suffix% &cer blevet muted af    %colored player's prefix%%player's name%%colored player's suffix% &ci &4%arg-2% &cmed grunden &4%arg-3%"
        
command /vunmute [<OfflinePlayer>]:
    permission: c.officer
    permission message: &cDu har ikke permission
    trigger:
        if offlineplayer-argument is not set:
            send "&1&l[&9&lMartinixy&1&l] &4>> &c/vunmute 'Spiller'" to player
            stop
        if offlineplayer-argument is set:
            execute console command "mute %offlineplayer-argument% 1s"
            broadcast "&1&l[&9&lMartinixy&1&l] &4>> %colored offlineplayer-argument's prefix%%offlineplayer-argument's name%%colored offlineplayer-argument's suffix% &cer blevet unmuted af    %colored player's prefix%%player's name%%colored player's suffix%"
            stop
 
Last edited:
first off.... Please use codetag. No one wont read/help you.

Where its codetag? Just click on there "+" button and then click code tags.

#edit:

I don't think, there its a way to get player's prefix/suffix while player is offline, You can store his Prefix/Suffix just into variables before banning.
 
using variables?

set {Prefix::%player%} to player's prefix

btw use next time maybe List Variables, its much easier and recommend.
 
Thank you, it worked. I just had to add colored to make it use colors, anyway i have one more skript i would ike to get help with. It's like a jail skript for my prison server, is it possible to apply variables to offline players like hwne i jail them and they are offline, whenever they come online, they will be teleport to the jail ?
 
Yes sure.

code_language.skript:
command /jail [<offline player>]:
    trigger:
        set {Jail::%arg-1%} to true
        send "He is jailed!"

command /setJailLocation:
    trigger:
        set {Jaillocation} to location of player

on join:
    if {Jail::%player%} is true:
        send "Oh no! Youre still in jail!"
        teleport player to {JailLocation}

on command:
    if {Jail::%player%} is set:
        send "Nah, you can't use any commands while youre jailed!"
        stop


This is a example
 
Status
Not open for further replies.