• 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!

[help] getStorageValue use in C++

GSMaster

Why? for money
Joined
Oct 26, 2008
Messages
169
Solutions
1
Reaction score
10
Location
HKS <3
Hi, I need help he wants to do to a player who has ( getStorageValu 12345 = 1 ) not get skull after the attack another player

I try (I have no idea how to use the c++)

Code:
	if(targetPlayer->getStorageValue(12345, 1))
	   return;


errors:
Code:
player.cpp In member function `virtual void Player::onAttackedCreature(Creature*)': 
3525 player.cpp no matching function for call to `Player::getStorageValue(int, int)' 
note player.cpp:828 candidates are: bool Player::getStorageValue(uint32_t, std::string&) const
 
uses 0.3.5 so there is getStorageValue

try :

Code:
uint32_t keySTR = 78451;
std::string valueSTR = "2";
getPlayer()->getStorageValue(keySTR, valueSTR)

Now the player detects the attacker has the storageValue (keySTR) but no longer sees whether it has 1,2,3,4 .. (valueSTR) it is still true
 
try:
Code:
std::string valueSTR;
if(getPlayer()->getStorageValue(keySTR, valueSTR) && atoi(valueSTR.c_str()) == 2) {..}
 
Code:
	if(targetPlayer->getStorageValue(12345, 1))
	   return;
You forgot add | " |
Code:
	if(targetPlayer->getStorageValue(12345, [COLOR="red"]"1"[/COLOR]))
	   return;
...no bullshit like
Code:
std::string valueSTR;
if(getPlayer()->getStorageValue(keySTR, valueSTR) && atoi(valueSTR.c_str()) == 2) {..}
 
Back
Top