• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Zmiana barw outfitów bez butów

Status
Not open for further replies.

Kurczok

Newbie
Joined
Oct 22, 2009
Messages
497
Reaction score
4
Witam. Mam do was pytanie czy może ktoś wie jak zablokować zmianę barwy butów jednak bez blokowania reszty outfitu?

Jeśli ktoś ma jakieś pomysły proszę pisać.

TFS 0.3.5pl1
 
Mam pomysl, ale powiedz jak rozpoznajesz teamy na servie, accounty czy jak, czy tylko buty, a all na tym samym accouncie? ;d
 
Po storage które ustawia się przy tworzeniu postaci. Postacie na osobnych acc.

Pewnie nie o tym myślałeś :D

Edit.

Kolor butów raczej ma zapewnić że gracze z 1 teamu nie będą się ranili wzajemnie.
 
Code:
bool Player::changeOutfit(Outfit_t outfit, bool checkList)
{
	int32_t team = getStorage(1234);
	if (team == 1)
		outfit.lookFeet = numerek kolorku butów pierwszego teamu;
	else
		outfit.lookFeet = numerek kolorku butów drugiego teamu;

	uint32_t outfitId = Outfits::getInstance()->getOutfitId(outfit.lookType);
	if(checkList && (!canWearOutfit(outfitId, outfit.lookAddons) || !requestedOutfit))
		return false;

	requestedOutfit = false;
	if(outfitAttributes)
	{
		uint32_t oldId = Outfits::getInstance()->getOutfitId(defaultOutfit.lookType);
		outfitAttributes = !Outfits::getInstance()->removeAttributes(getID(), oldId, sex);
	}

	defaultOutfit = outfit;
	outfitAttributes = Outfits::getInstance()->addAttributes(getID(), outfitId, sex, defaultOutfit.lookAddons);
	return true;
}

player.cpp (:
 
Code:
bool Player::changeOutfit(Outfit_t outfit, bool checkList)
{
	int32_t storage = getStorage(1234);
	if (team == 1)
		outfit.lookFeet = numerek kolorku butów pierwszego teamu;
	else
		outfit.lookFeet = numerek kolorku butów drugiego teamu;

	uint32_t outfitId = Outfits::getInstance()->getOutfitId(outfit.lookType);
	if(checkList && (!canWearOutfit(outfitId, outfit.lookAddons) || !requestedOutfit))
		return false;

	requestedOutfit = false;
	if(outfitAttributes)
	{
		uint32_t oldId = Outfits::getInstance()->getOutfitId(defaultOutfit.lookType);
		outfitAttributes = !Outfits::getInstance()->removeAttributes(getID(), oldId, sex);
	}

	defaultOutfit = outfit;
	outfitAttributes = Outfits::getInstance()->addAttributes(getID(), outfitId, sex, defaultOutfit.lookAddons);
	return true;
}

player.cpp (:

skad zmienna team? :confused:
 
Tfu, chodzilo o zmienną storage, juz poprawiam :d

@Edit:
lol i zmienilem 'storage' na 'team', wazne, ze teraz jest dobrze :D
 
int32_t team = getStorage(1234); // w storage trzymasz id feet tym samym uznajac ten id za team
outfit.lookFeet = team;

Zaproponowałbym coś takiego, gdyż można stworzyć więcej niż 2 teamy ;]
 
int32_t team = getStorage(1234);
outfit.lookFeet = team;

Zaproponowałbym coś takiego, gdyż można stworzyć więcej niż 2 teamy ;]

To jeszcze napisz informacje dla autora tematu, ze w takim przypadku bedzie bralo kolor buta ze storage, zeby wiedzial o co chodzi, heh.
 
Rozumiem co tam jest napisane :D wielkie dzięki za szybką pomoc i drobna dyskusje.
 
Nie ma za co, polecamy sie na przyszlosc, pomozemy w miare mozliwosci.
Nie chce repka.
 
No niestety nie mogę dać :/ Ale i tak już masz dużo :D
 
podczas kompilacji wywala error ;(

Code:
`getStorage' was not declared in this scope
 
zamien getStorage na getStorageValue, pomyleczka :>
 
Dzięki, to raczej mój brak doświadczenia z C++.

i nadal errory

Code:
no matching function for call to `Player::getStorageValue(int)' 

candidates are: bool Player::getStorageValue(uint32_t, std::string&) const
 
Last edited:
Code:
bool Player::changeOutfit(Outfit_t outfit, bool checkList)
{
	[b]std::string zmienna;
	this->getStorageValue(1234, &zmienna);
	outfit.lookFeet = atoi(zmienna.c_str());[/b]

	uint32_t outfitId = Outfits::getInstance()->getOutfitId(outfit.lookType);
	if(checkList && (!canWearOutfit(outfitId, outfit.lookAddons) || !requestedOutfit))
		return false;

	requestedOutfit = false;
	if(outfitAttributes)
	{
		uint32_t oldId = Outfits::getInstance()->getOutfitId(defaultOutfit.lookType);
		outfitAttributes = !Outfits::getInstance()->removeAttributes(getID(), oldId, sex);
	}

	defaultOutfit = outfit;
	outfitAttributes = Outfits::getInstance()->addAttributes(getID(), outfitId, sex, defaultOutfit.lookAddons);
	return true;
}
 
Status
Not open for further replies.
Back
Top