All pastes #980238 Raw Edit

Untitled

public text v1 · immutable
·published 2008-04-10 21:30 UTC
rendered paste body
if (chat[0] == '/') {
		char* next_token;
		char command[90] = "";
		if(chatsize>2)
			strcpy_s(command, 90, strtok_s(chat+1, " ", &next_token));
		if(strcmp(command, "find") == 0){
			char *name = strtok_s(NULL, " ",&next_token);
			if (strlen(name) > 0) {
				for (hash_map <int, Player*>::iterator iter = Players::players.begin(); iter != Players::players.end(); iter++) {
					if (strcmp(iter->second->getName(), name) == 0) {
                        char text[50];
						sprintf_s(text, 50, "%d is located at %d", player->getName(), player->getMap());
						PlayersPacket::showMassageOne(text, 5, player);
					}
				}
			}
		}
		if(strcmp(command, "server") == 0) {
			PlayersPacket::showMassage(next_token, 5);
		}
		return;
}