This commit is contained in:
cpdef 2017-08-31 19:31:35 +02:00
commit 0d14a5e929
6 changed files with 32 additions and 0 deletions

32
init.lua Normal file
View File

@ -0,0 +1,32 @@
minetest.register_privilege("teamskin", {
description = "Player can set the team-skin.",
give_to_singleplayer= false,
})
minetest.register_chatcommand("setskin", {
params = "<player> <team>",
description = "set the skin of the player given",
privs = { teamskin=true },
func = function(name, param)
local first_param_end, second_param_start = param:find(" +")
if second_param_start == nil then
minetest.chat_send_player(name, "invalid Usage of /setskin!")
return
end
second_param_start = second_param_start+1
playername = param:sub(0, first_param_end-1)
team = param:sub(second_param_start, #param)
minetest.chat_send_player(name, "set the team_"..team..
" skin for player "..playername)
local player = minetest.get_player_by_name(playername)
if player == nil then
minetest.chat_send_player(name, "don't know player "..playername)
return
end
player:set_properties({
textures = {"team_"..team..".png"},
})
end,
})

BIN
textures/team_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
textures/team_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
textures/team_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
textures/team_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
textures/team_admin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB