/give [player]
#4
You could look at the /tp command in the Core plugin, as it takes a player name as its first argument (/tp [playername])

Code:
function HandleTPCommand( Split, Player )
    if( not Player:HasPermission( "core.teleport" ) ) then
        return false
    end
    
    local Server = cRoot:Get():GetServer()
    if( #Split ~= 2 ) then
        Server:SendMessage( cChatColor.Green .. "Usage: /tp [PlayerName]", Player )
        return true
    end
    local World = cRoot:Get():GetWorld()
    local OtherPlayer = World:GetPlayer( Split[2] )
    if( OtherPlayer == nil ) then
        Server:SendMessage( cChatColor.Green .. "Can't find player " .. Split[2], Player )
    elseif( OtherPlayer == Player ) then
        Server:SendMessage( cChatColor.Green .. "Already there :)", Player )
    else
        Player:TeleportTo( OtherPlayer )
        Server:SendMessage( cChatColor.Green .. "You teleported to "..OtherPlayer:GetName().."!", Player )
        Server:SendMessage( cChatColor.Green .. Player:GetName().." teleported to you!", OtherPlayer )
    end
    return true
end
Reply
Thanks given by:


Messages In This Thread
/give [player] - by distroyed123 - 03-03-2011, 02:33 AM
RE: /give [player] - by FakeTruth - 03-03-2011, 03:51 AM
RE: /give [player] - by distroyed123 - 03-03-2011, 04:14 AM
RE: /give [player] - by FakeTruth - 03-03-2011, 04:52 AM
RE: /give [player] - by distroyed123 - 03-03-2011, 04:54 AM



Users browsing this thread: 1 Guest(s)