Join/Invite CommandHelper Script

Home Forums General Join/Invite CommandHelper Script

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #2354

    Someone requested that I post this.

    This is placed in the config.txt file, where all command aliases are placed.
    [sourcecode language=”plain”]
    *:/join $player = >>>
    try(assign(@player, pinfo($player)[0]), @ex, die('Failed.')) #check if the player exists and assign it to @player
    import(@requests) #bring up the current list of requests
    tmsg(@player, color(b), player(), ' has requested to join you. /accept')
    msg(color(b), 'Request to join sent to ', @player, '.')
    array_set(@requests, @player, array('join', player())) #add this request to the request list array
    export(@requests) #save it so other scripts can access it

    *:/invite $player = >>>
    try(assign(@player, pinfo($player)[0]), @ex, die('Failed.'))
    tmsg(@player, color(b), player(), ' has requested that you join them. /accept')
    msg(color(b), 'Invitation sent to ', @player, '.')
    array_set(@requests, @player, array('invite', player()))

    *:/accept = >>>
    if(!array_index_exists(@requests, player()), die('There is nothing to accept.')) #if no requests for player, stop
    if(@requests[player()][0] == 'invite') { #if there's an invite request
    msg(color(b), 'Teleporting to '.@requests[player()][1].' in 3 seconds…')
    tmsg(@requests[player()][1], color(b), 'Teleporting '.player().' in 3 seconds…')
    _warmuptp(3, player(), ploc(@requests[player()][1])) #run the warmuptp procedure
    } else { #if there's a join request
    msg(color(b), 'Teleporting '.@requests[player()][1].' in 3 seconds…')
    tmsg(@requests[player()][1], color(b), 'Teleporting to '.player().' in 3 seconds…')
    _warmuptp(3, @requests[player()][1], ploc())
    array_remove(@requests, player()) #remove this request from the list

    Put this in the file, where all global procedures are kept.
    [sourcecode language=”plain”]
    # Warm-up a TP with potion and sound effects
    proc(_warmuptp, @length, @player, @loc,
    set_peffect(@player, 9, 1, 6) #screen warping effect
    set_timeout(@length * 1000, closure( #delay for the @length specified in seconds
    make_effect(ploc(@player), 'GHAST_SHOOT', 20) #teleport sound
    set_ploc(@player, @loc) #move the player to @loc, an array of coordinates and world
    set_peffect(@player, 15, 1, 2) #make them blind just for a second while the world loads
    make_effect(@loc, 'GHAST_SHOOT', 20)


    I haven’t been able to test it out yet. I have been busy with activities with my family. Ill have my friend add the script to our server tomorrow. Also, how do you prevent uninvited guests from playing on a server? we just had an experience with griefing and are flabbergasted that someone got ahold of our IP address.


    You can use the built-in whitelisting feature. Set white-list in the file to true. Then add player names in white-list.txt, one per line.

    Or, if you want more permissions flexibility going forward, install a permissions plugin like permissionsbukkit, permissionsex, or bpermissions. Then, for instance, in permissionsbukkit you could set the default group’s to false. They can join the server, but won’t be able to do anything until added to a group with true. This is how we do it on FSMC, but it can be overkill for a server with just a few people. It’s called greylisting.


    BTW, you should use these builds usually:
    The builds are olllld.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.