Any idea whats wrong with my setteam function?

[LUA]
function setteam( Player, args )
playa = player.GetByID( args[1] )
playa:SetTeam( args[2] )
end
concommand.Add(“giveflag”, giveflag )
[/LUA]
Heres the error it keeps returning

gamemodes\shitscript\gamemode\init.lua:12: attempt to call method ‘SetTeam’ (a nil value)

shouldnt it be
[lua]local playa = player.GetByID( args[1] )
playa:SetTeam( args[2] )[/lua]

just taking a guess, new at lua

Cast args[1] to a number first, because chances are it is trying to find a player with the id “1” instead of 1 (for example).

Example:

[lua]
function setteam( Player, args )
playa = player.GetByID( tonumber(args[1]) )
if playa and playa:IsPlayer() then
playa:SetTeam( tonumber(args[2]) )
end
end
[/lua]