1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help with skript commands on offline players

Discussion in 'Skript' started by martinn112, Jan 21, 2018.

Thread Status:
Not open for further replies.
  1. martinn112

    martinn112 Member

    Joined:
    Jan 21, 2018
    Messages:
    23
    Likes Received:
    0
    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 (Skript):
    1. on join:
    2.     if {muted.%player%} is not set:
    3.         set {muted.%player%} to false
    4.  
    5. command /vban [<OfflinePlayer>] [<Text>] [<Text>]:
    6.     permission: c.officer
    7.     permission message: &cDu har ikke permission
    8.     trigger:
    9.         if offlineplayer-argument is "martinn112" or "a1b2c3lou":
    10.             execute console command "kick %player% '&4Det kan du godt glemme!'"
    11.             stop
    12.         if offlineplayer-argument or arg-2 or arg-3 is not set:
    13.             send "&1&l[&9&lMartinixy&1&l] &4>> &c/vban 'Spiller' 'Tid' 'Grund'" to player
    14.             stop
    15.         if offlineplayer-argument, arg-2 and arg-3 is set:
    16.             execute console command "tempban %arg-1% %arg-2% %arg-3%"
    17.             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%"
    18.  
    19. command /vunban [<OfflinePlayer>]:
    20.     permission: c.officer
    21.     permission message: &cDu har ikke permission
    22.     trigger:
    23.         if offlineplayer-argument is not set:
    24.             send "&1&l[&9&lMartinixy&1&l] &4>> &c/vunban 'Spiller'" to player
    25.             stop
    26.         if offlineplayer-argument is set:
    27.             execute console command "unban %arg-1%"
    28.             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%"
    29.  
    30. command /vkick [<OfflinePlayer>] [<Text>]:
    31.     permission: c.officer
    32.     permission message: &cDu har ikke permission
    33.     trigger:
    34.         if offlineplayer-argument is "martinn112" or "a1b2c3lou":
    35.             execute console command "kick %player% '&4Det kan du godt glemme!'"
    36.             stop
    37.         if offlineplayer-argument or arg-2 is not set:
    38.             send "&1&l[&9&lMartinixy&1&l] &4>> &c/vkick 'Spiller' 'Grund'" to player
    39.             stop
    40.         if offlineplayer-argument and arg-2 is set:
    41.             execute console command "kick %offlineplayer-argument% %arg-2%"
    42.             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%"
    43.        
    44. command /vmute [<OfflinePlayer>] [<Text>] [<Text>]:
    45.     permission: c.officer
    46.     permission message: &cDu har ikke permission
    47.     trigger:
    48.         if offlineplayer-argument is "martinn112" or "a1b2c3lou":
    49.             execute console command "kick %player% '&4Det kan du godt glemme!'"
    50.             stop
    51.         if offlineplayer-argument or arg-2 or arg-3 is not set:
    52.             send "&1&l[&9&lMartinixy&1&l] &4>> &c/vmute 'Spiller' 'Tid' 'Grund'" to player
    53.             stop
    54.             stop
    55.         if offlineplayer-argument, arg-2 and arg-3 is set:
    56.             execute console command "mute %offlineplayer-argument% %arg-2% %arg-3%"
    57.             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%"
    58.        
    59. command /vunmute [<OfflinePlayer>]:
    60.     permission: c.officer
    61.     permission message: &cDu har ikke permission
    62.     trigger:
    63.         if offlineplayer-argument is not set:
    64.             send "&1&l[&9&lMartinixy&1&l] &4>> &c/vunmute 'Spiller'" to player
    65.             stop
    66.         if offlineplayer-argument is set:
    67.             execute console command "mute %offlineplayer-argument% 1s"
    68.             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%"
    69.             stop
     
    #1 martinn112, Jan 21, 2018
    Last edited: Jan 21, 2018
  2. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    60
    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.
     
  3. martinn112

    martinn112 Member

    Joined:
    Jan 21, 2018
    Messages:
    23
    Likes Received:
    0
    Sorry, first time using this forum, and how do i store their prefix/suffix?
     
  4. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    60
    using variables?

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

    btw use next time maybe List Variables, its much easier and recommend.
     
  5. martinn112

    martinn112 Member

    Joined:
    Jan 21, 2018
    Messages:
    23
    Likes Received:
    0
    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 ?
     
  6. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    60
    Yes sure.

    Code (Skript):
    1. command /jail [<offline player>]:
    2.     trigger:
    3.         set {Jail::%arg-1%} to true
    4.         send "He is jailed!"
    5.  
    6. command /setJailLocation:
    7.     trigger:
    8.         set {Jaillocation} to location of player
    9.  
    10. on join:
    11.     if {Jail::%player%} is true:
    12.         send "Oh no! Youre still in jail!"
    13.         teleport player to {JailLocation}
    14.  
    15. on command:
    16.     if {Jail::%player%} is set:
    17.         send "Nah, you can't use any commands while youre jailed!"
    18.         stop
    19.  

    This is a example
     
  7. martinn112

    martinn112 Member

    Joined:
    Jan 21, 2018
    Messages:
    23
    Likes Received:
    0
    Thank you, got it to work now :emoji_grinning:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...