Maverick wrote: |
No its more fun to PM everyone *super.... aaand much easier too ! ![]() |
Quote: |
Can anyone HELP me on this one? Even a small 3 word tip would be a help.. |
Purge+ wrote: |
... or they'll get kicked. |
Bak wrote: |
use a boolean variable to keep track if the game is on or not, and then prize based on the value of that variable |
Code: Show/Hide class botInfo
{ // Skipping a few lines to improve readability... bool give_supers; // <-- Add the variable to this class! Do NOT make another botInfo class. public: botInfo(CALL_HANDLE given) { |
Code: Show/Hide class botInfo
{ // Skipping a few lines to improve readability... bool give_supers; public: botInfo(CALL_HANDLE given) { give_supers = true; // <-- This will enable our feature by default. |
Code: Show/Hide if (c->check("supers"))
{ if (c->checkParam("on")) { if (give_supers) sendPrivate(p, "Prizing super was enabled already."); else { give_supers = true; sendPrivate(p, "Prizing super is now enabled."); } } else if (c->checkParam("off")) { if (give_supers) { give_supers = false; sendPrivate(p, "Prizing super is now disabled."); } else sendPrivate(p, "Prizing super was disabled already."); } else { // No parameter for the supers command was used, we could make the plugin // give the current status of the prizing. String s = "Prizing super is currently "; if (give_supers) s += "enabled."; else s += "disabled."; sendPrivate(p, s); // You could, of course, show the command syntax help. //sendPrivate(, "Please specify a parameter for the !supers command: !supers [on|off]."); } } |
Code: Show/Hide if (c->check("supers"))
{ if (c->checkParam("on")) { if (give_supers) sendPrivate(p, "Prizing super was enabled already."); else { give_supers = true; sendPrivate(p, "Prizing super is now enabled.."); } } else if (c->checkParam("off")) { if (give_supers) { give_supers = false; sendPrivate(p, "Prizing super is now disabled."); } else sendPrivate(p, "Prizing super was disabled already."); } else if (c->checkParam("status")) { // Show status of super prizing. String s = "Prizing super is currently "; if (give_supers) s += "enabled."; else s += "disabled."; sendPrivate(p, s); } else { sendPrivate(p, "Please specify a parameter for the !supers command: !supers [on|off|status]."); } } |
Code: Show/Hide case EVENT_PlayerShip:
{ Player *p = (Player*)event.p[0]; Uint16 oldship = (Uint16)(Uint32)event.p[1]; Uint16 oldteam = (Uint16)(Uint32)event.p[2]; // Are we giving super? If so, send a *prize #17 (super). if (give_supers) sendPrivate(p, "*prize #17"); } break; |
Code: Show/Hide // Iterate through the playerlist and remove everyone's super (*prize #-17).
_listnode <Player> *parse = playerlist->head; while (parse) { Player *p = parse->item; if (p->ship != SHIP_Spectator) sendPrivate(p, "*prize #-17"); parse = parse->next; } |
Dr Brain wrote: |
6 posts in a row. Some kind of a record? |
Solo Ace wrote: |
Also, I had it split up because multiple code boxes were messing my posts up. |