Skrypty & Kody c++

erazma

Active User
Zarejestrowany
Dołączył
Wrzesień 3, 2012
Posty
61
Liczba reakcji
6
Pomo?e kto? z c++, pr?buje ale nie ogarniam, kod poni?ej chcia?bym przerobi? co? w tym stylu.

Kod:
		if(speaker && type != SPEAK_RVR_ANSWER && !speaker->isAccountManager() && !speaker->hasCustomFlag(PlayerCustomFlag_HideLevel) && (pg == NULL || pg != NULL && !pg->getIsCast()))
			msg->put<uint16_t>(speaker->getPlayerInfo(PLAYERINFO_LEVEL));
		else
			msg->put<uint16_t>(0x00);


Kod:
		std::string vocation;
		switch (speaker->getVocationId())
		{
			case 0:
			vocation = "Rookie";
			break;

			case 1:
			vocation = "Sorcerer";
			break;

			case 2:
			vocation = "Druid";
			break;

			case 3:
			vocation = "Paladin";
			break;

			case 4:
			vocation = "Knight";
			break;

			case 5:
			vocation = "Master Sorcerer";
			break;
			
			case 6:
			vocation = "Elder Druid";
			break;
			
			case 7:
			vocation = "Royal Paladin";
			break;
			
			case 8:
			vocation = "Elite Knight";
			break;
			
			default:
			vocation = "...";

		}

		std::stringstream ss;
		ss << "profesja id" << vocation.str() << std::endl;
		msg->putString(ss.str());

sprawdzaj?c w ten spos?b dzia?a pokazuje profesj? id np 8 czyli jest mo?liwe wczytanie profki
Kod:
msg->put<uint16_t>(speaker->getVocationId());

ale np. w ten spos?b msg->putString("eloszka"); ju? nie dzia?a wywala silnik
 
Back
Do góry