Displayname of Argument 1 [Skript Realname]

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

TheRazorGod

Member
Jun 9, 2018
17
0
0
25
code_language.skript:
command /display [<player>]:
    trigger:
        if arg 1 is not set:
            send "&6Creative-1&8» &a/display (nick)"
            stop
        if arg 1 is set:
            set {_player} to arg 1       
            execute "SELECT nick FROM nickname WHERE playername=%{_player}%" in {sql} and store the result in {_nickname::*}
            execute "SELECT playername FROM nickname WHERE nick=%{_nickname::nick::*}%" in {sql} and store the result in {_playername::*}
            if {_nickname::nick::*} is set:
                send "&6Creative-1&8» &6Mr&a%player% &a%day%/%month%/%year% %hour%:%minute% &6Sr&a%random integer between 1 and 100000%"
                send "&6Creative-1&8» &6Ms&a%{_player}% &6Mn&a%colored {_nickname::nick::*}%"
                stop
            else:
                if {_player} is offline:
                    send "&6Creative-1&8» &6This user is offline."
                    stop
                else:           
                    send "&6Creative-1&8» &6Mr&a%player% &a%day%/%month%/%year% %hour%:%minute% &6Sr&a%random integer between 1 and 100000%"
                    send "&6Creative-1&8» &6Ms&a%{_player}% &6Mn&a%colored {_playername::playername::*}%"
                    stop

The code works if I use [<text>]. But I have to use [<player>] for this code to work:
code_language.skript:
if {_player} is offline:
      send "&6Creative-1&8» &6This user is offline."
      stop

How can do it?
 
Last edited:
code_language.skript:
command /display [<player>]:
    trigger:
        if arg 1 is not set:
            send "&6Creative-1&8» &a/display (nick)"
            stop
        if arg 1 is set:
            set {_player} to arg 1    
            execute "SELECT nick FROM nickname WHERE playername=%{_player}%" in {sql} and store the result in {_nickname::*}
            execute "SELECT playername FROM nickname WHERE nick=%{_nickname::nick::*}%" in {sql} and store the result in {_playername::*}
            if {_nickname::nick::*} is set:
                send "&6Creative-1&8» &6Mr&a%player% &a%day%/%month%/%year% %hour%:%minute% &6Sr&a%random integer between 1 and 100000%"
                send "&6Creative-1&8» &6Ms&a%{_player}% &6Mn&a%colored {_nickname::nick::*}%"
                stop
            else:
                if {_player} is offline:
                    send "&6Creative-1&8» &6This user is offline."
                    stop
                else:        
                    send "&6Creative-1&8» &6Mr&a%player% &a%day%/%month%/%year% %hour%:%minute% &6Sr&a%random integer between 1 and 100000%"
                    send "&6Creative-1&8» &6Ms&a%{_player}% &6Mn&a%colored {_playername::playername::*}%"
                    stop

The code works if I use [<text>]. But I have to use [<player>] for this code to work:
code_language.skript:
if {_player} is offline:
      send "&6Creative-1&8» &6This user is offline."
      stop

How can do it?
Use command /display <player>:
then do set {_player} to argument 1
 
Last edited:
Status
Not open for further replies.