Code: Show/Hide chatnet->AddHandler("GETSQUAD", myhandler);
myhandler(p, line) { t = getplayerbyname(line) sendmessage(p, t->squad) } |
| NightHawk wrote: |
| obviously you could do something like that, but this is a suggestion for the official version. |
| Mine GO BOOM wrote: |
| [..]
In that case, I'd rather see squads listed in the ENTERING packet. Since you know your own name, you can figure out your own squad from them (how Subspace does it). |
Code: Show/Hide local helptext_t squad_help =
"Targets: none or player\n" "Args: none\n" "Displays your or a target player's current squad.\n"; local void Csquad(const char *params, Player *p, const Target *target) { Player *t = (target->type) == T_PLAYER ? target->u.p : p; chat->SendMessage(p, "Squad for %s: %s", t->name, t->squad[0] ? t->squad : ":none:"); } |