Code: Show/Hide local void lock_work(const Target *target, int nval, int notify, int spec, int timeout)
{ LinkedList set = LL_INITIALIZER; Link *l; pd->TargetToSet(target, &set); for (l = LLGetHead(&set); l; l = l->next) { Player *p = l->data; pdata *pdata = PPDATA(p, pdkey); if (spec && p->arena && p->p_ship != SHIP_SPEC) SetFreqAndShip(p, SHIP_SPEC, p->arena->specfreq); if (notify && pdata->lockship != nval && chat) chat->SendMessage(p, nval ? (p->p_ship == SHIP_SPEC ? "You have been locked to spectator mode." : "You have been locked to your ship.") : "Your ship has been unlocked."); pdata->lockship = nval; pdata->expires = (nval == FALSE || timeout == 0) ? 0 : time(NULL) + timeout; } LLEmpty(&set); } |
Dr Brain wrote: |
Make a freq manager that allows people to change ships but not frequencies. |
Samapico wrote: |
[..]
Isn't that like telling your <any sport> team: "hey, try to score goals" ? |
Code: Show/Hide #define KEY_SHIPLOCK 46
// #include "packets/shipchange.h" // typedef struct { // /* some flags */ byte lockship, rgnnoanti, rgnnoweapons, pad2; // } pdata; typedef struct { // int initlockship, initspec; // } adata; |
Code: Show/Hide struct ShipChangePacket
{ u8 type; i8 shiptype; i16 pnum; i16 freq; }; |
Dr Brain wrote: |
I'm not sure what you mean about Grel eventually adding freq managers... they've been in ASSS since the first release. Look at fm_normal and fm_lockspec.
The simplest solution is to have the manager always lock teams, and then to lock them you just attach the module to the arena. If you want mods to be able to use the command, then you'll have to set up the module to work normally until a command is activated (I suggest starting with fm_normal). the KEY_SHIPLOCK is a unique key for the persist data. 46 is a number no other module is using. |