Code: Show/Hide // Inside your command already. _listnode <Player> *parse = playerlist->head; //set to first link of the player linked list while (parse) //parse will be NULL when we reach the last link { Player *p = parse->item; //item is the actual data stored in the link // do functionality here // Example 1: sendPrivate(p,"*watchdamage"); // turns on all pilot's watchdamage // Example 2: if (p->safety != 0) sendPrivate(p,"*spec"); // spec all pilots in safe zone sendPrivate(p, "*warpto %s %s", xcoord, ycoord); // Might work? parse = parse->next; //set parse to the next link } |
Code: Show/Hide string xcoord; string ycoord; . . . xcoord, ycoord = c->final.split(":"); // Completely guessing here. |
Code: Show/Hide // Inside your command already. _listnode <Player> *parse = playerlist->head; while (parse) { Player *p = parse->item; sendPrivate(p, "*warpto "+(String)xcoord+" "+(String)ycoord); // Will work if xcoord and ycoord are decleared as variables parse = parse->next; } |
Code: Show/Hide String xcoord, ycoord; ycoord = c->final; xcoord = ycoord.split(":"); // Leave the right part besides : in ycoord and put the part infront of : in xcoord |