ID:1898799
 
(See the best response by Nadrew.)
Code:
Team
var
list/members = list()
client/leader = null
name = null

proc

add_member(client/C) if(C)
if(C.mob.has_team)
members += C
leader = C
else members += C


remove_member(client/C) if(C)
if(leader == C) leader=null
members -= C
if(leader==null) disband()

disband()
for(var/client/C in members)
remove_member(C)
C.mob.in_team = 0
C.mob.has_team = 0
C.mob.team_name = ""
C.mob.team = null

teams -= src
del src
mob/proc
distribute_exp(_exp, _killname, mob/killer)
if(killer)
for(var/Team/a in teams) if(a.name == killer.team_id)
killer.exp += round(a.members.len == 1 ? _exp : a.members.len == 2 ? _exp * 0.75 : _exp * 0.5)
spawn() killer.Levelup()
_exp *= (a.members.len == 1 ? 1 : a.members.len == 2 ? 0.25 : 0.5)
for(var/client/M in a.members) if(M&&killer&&M != killer.client)
if(_killname=="Special"||_killname=="None") M << "You've gained [round(_exp / (a.members.len - 1))] experience from [killer.name]!"
else M << "You've gained [round(_exp / (a.members.len - 1))] experience from [killer.name] killing [_killname]!"
M.mob.exp += round(_exp / (a.members.len - 1))
spawn() M.mob.Levelup()
break
var/list/teams = list()

mob/var/tmp
has_team = 0
in_team = 0
team_id
team_name=""
Team/team

mob/standard/verb/createteam()
set hidden=1
if(usr.level<=99)
usr<<"Level 100+ to be able to start a team."
return
if(in_team||has_team) src << "You're already in a team."
else
src << "You've formed a team."
has_team = 1
in_team = 1
team_name="[src.name]"
team_id=ckey
team = new()
teams += team
team.name = ckey
team.add_member(src.client)

mob/standard/verb/removefromteam()
set hidden=1
if(src.has_team)
var/client/M=input(usr,"Select who to remove from team","Team Removal") in team.members + list("Cancel")
if(!M||M=="Cancel"||M==usr.client||!M.mob.in_team) return
M << "You've been booted from [name]'s team."
src << "You've booted [M.mob.name] from your team."
team.remove_member(M)
M.mob.in_team=0
M.mob.team_name=""
M.mob.has_team = 0
M.mob.team_id=null

mob/standard/verb/leaveteam()
set hidden=1
if(src.has_team)
team.disband()
if(src.in_team)
src << "You've left [src.team_name]'s team."
for(var/Team/a in teams) if(a.name == src.team_id) for(var/client/M in a.members) if(M==src.client) team.remove_member(M)
src.has_team = 0
src.in_team = 0
src.team_id=null
src.team_name=""

mob/standard/verb/invitetoteam()
set hidden=1
if(src.has_team&&!usr.popupteam)
var/mob/M=input(usr,"Select who to invite.","Team Invite") in players + list("Cancel")
if(!M||M=="Cancel"||M==usr) return
if(M.in_team||M.has_team)
usr<<"[M] is already in a team."
return
if(M.level<=99)
usr<<"They are too low levelled, they need to be 100+."
return
usr.popupteam=1
switch(input(M,"Join [name]'s team?","Team Join") in list("Yes","No"))
if("Yes")
if(length(team.members)>=5)
src << "Your team is full already."
M<<"Their team is full."
else
var/level_difference=0
if(M.level>=src.level) level_difference = M.level - src.level
else level_difference = src.level - M.level
if(level_difference > 250)
src<<"[M.name] is not within 250 levels."
M<<"You need to be within 250 levels of [src.name]'s level."
usr.popupteam=0
return
src<<"[M.name] has joined your team."
team.add_member(M.client)
M<<"You've joined [src.name]'s team."
M.has_team=0
M.in_team=1
M.team_id=src.ckey
M.team_name="[src.name]"
if("No")
src<<"[M.name] declines your invite."
usr.popupteam=0

mob/standard/verb/teamclose()
set hidden=1
if(!usr.login)
usr<<"Must be logged in for this feature."
return
winshow(usr,"teammanage",0)

mob/Squad/verb/teammanage()
set category="Squad"
set name="Manage Squad"
winshow(usr,"teammanage",2)
if(usr.in_team||usr.has_team)
usr<<output("<center>[usr.team_name]'s Team","teammanage.teamname")
for(var/Team/a in teams) if(a.name == src.team_id) for(var/client/M in a.members)
var/stampercent=M.mob.health*100/M.mob.maxhealth
var/reiryokupercent=M.mob.chakra*100/M.mob.maxchakra
var/staminapercent=M.mob.stamina*100/M.mob.maxstamina
src<<output("<font size=1><font face=tahoma>(\icon[M.mob.mouse_over_pointer]|<u><b>[M.mob.name]</u></b> the <u><b>[M.mob.Clan]</u></b>, level <u><b>[M.mob.level]</u></b>. <u><b><font color=red>|[stampercent]%|<font color=#1e90ff>|[reiryokupercent]%|<font color=green>|[staminapercent]%|</u></b>)<br>","teammanage.teamoutput")

mob
Logout()
if(team) del team
..()


Problem description:
when i try setting the marco as a button of on the teammanage window it keeps telling me its unresconizable please help
Best response
Is your player mob of the type /mob/Squad? If not you'll need to manually add the verb to the player's verbs list, or make their mob the proper type.

Verbs not belonging to the exact type of mob the player is set to will not automatically be added as valid commands.
so oyur saying i should changed all the /mob/standard to /mob/Squad?
No. I'm saying you need to make the verb belong to the same type of mob as the one you're using, or manually add it to the player's verbs list and remove it as needed.