[gui] names compass

[gui] names compass

Postby bonifarz » 04 Aug 2013, 18:23

This is just a tiny snippet of cubescript, I almost feel bad about opening a new topic for this. But i have the feeling it could be useful (until there's tab-completion for player names).

The idea is to quickly insert the name of a player in a saycommand using a compass - a rather trivial thing. If you use a custom chat colour, you can set it accordingly. It should be straight forward to add other actions based on @cn, but I think that would be just as useless as my old moderate gui.

{l Code}: {l Select All Code}

// players compass by Bonifarz

// suggested key binding:
// bind "P" [showcompass players]

cnstart = 0
chatcolour = ""
// or define a custom colour here:
// chatcolour = "^f[0xffffff]"
// or use your profile colour:
// chatcolour = (concatword "^f[" $playercolour "]")

newcompass players "textures/player" [
    loop i 8 [
        cn = (+ $cnstart $i)
        if (&& (isconnected $cn) (! (isai $cn))) [
             compass (getclientname $cn) $i [
                 saycommand $chatcolour (getclientname @cn)
             ]
        ]
    ]
    compass "more players" "p" [
        cnstart = (+ $cnstart 8)
        if  (> $cnstart $serverclients ) [
            cnstart = 0
        ]
        sleep 10 [
            showcompass players
        ]
    ]
]


EDIT: Some clean up.
User avatar
bonifarz
 
Posts: 379
Joined: 09 Apr 2012, 12:16
Location: switzerland

Who is online

Users browsing this forum: No registered users and 1 guest