Fix /team join player team

This commit is contained in:
rubenwardy 2014-03-13 09:11:36 +00:00
parent ef630e9f02
commit 448f7f25a7

View File

@ -81,14 +81,14 @@ minetest.register_chatcommand("team", {
minetest.chat_send_player(name,"joining '"..tplayer.."' to team '"..tteam.."'",false) minetest.chat_send_player(name,"joining '"..tplayer.."' to team '"..tteam.."'",false)
local privs = minetest.get_player_privs(name) local privs = minetest.get_player_privs(name)
if privs and privs.team == true then if privs and privs.team == true then
local player = cf.player(name) local player = cf.player(tplayer)
if not player then if not player then
player = {name=name} player = {name=tplayer}
end end
if cf.add_user(param,player) == true then if cf.add_user(tteam,tplayer) == true then
minetest.chat_send_all(name.." has joined team "..param) minetest.chat_send_all(tplayer.." has joined team "..tteam)
end end
else else
minetest.chat_send_player(name, "You can not do this!") minetest.chat_send_player(name, "You can not do this!")
@ -283,4 +283,4 @@ if chatplus then
return (fromp.team == top.team) return (fromp.team == top.team)
end) end)
end end