What's new

Skrypty & Kody Sprawdzanie storage

Status
Not open for further replies.

#NOOB

Senior User
Joined
May 25, 2014
Messages
901
Reaction score
89
Tak to znowu ja i moje problemy XD
[CPP]std::string value;
if(player->getStorage(5000, value))
{
if(atoi(value.c_str()) == 1)
{
type = MSG_CHANNEL_RA;
}
}[/CPP]
by [MENTION=4185]fabian766[/MENTION]

Niech chce mi skomplikowa?* tego fragmentu, wywala:
[CPP]In member function `bool ChatChannel::talk(Player*, MessageClasses, const std::string&, uint32_t)':
invalid conversion from `int' to `const char*'
initializing argument 1 of `std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]'
[Build Error] [../o/chat.o] Error 1
[/CPP]

Dodam, ?e w TFS 0.3 kompiluje bez jakiejkolwiek zmiany, a w 0.4 ju? sobie nie radzi. Ma kto? jaki? pomys??

---------- Tre?? dodana o 14:44 ----------

Kto? ma jaki? pomys??
 

#NOOB

Senior User
Joined
May 25, 2014
Messages
901
Reaction score
89
Odp: Sprawdzanie storage

Alu?

/Rozwi?zane! Mo?na zamkn?? temat!
[CPP]
std::string value;
player->getStorage("17027", value);

int32_t tmp = atoi(value.c_str());
if(tmp == 1){
type = MSG_CHANNEL_RA;
}[/CPP]
 
Last edited:

Baabuseek

Advanced User
Joined
Aug 17, 2008
Messages
449
Reaction score
45
Odp: Sprawdzanie storage

Dla XML:
[cpp]long value;
if(player->getStorageValue(5000, value))
{
if(value == 1)
type = MSG_CHANNEL_RA;
}[/cpp]
 

#NOOB

Senior User
Joined
May 25, 2014
Messages
901
Reaction score
89
Odp: Sprawdzanie storage

To jest SQL, a twoje rozwi?zanie nie dzia?a w tym przypadku ale dzi?ki za ch?? pomocy, w moim po?cie wy?ej jest rozwi?zanie :p
 
Last edited:

Baabuseek

Advanced User
Joined
Aug 17, 2008
Messages
449
Reaction score
45
Odp: Sprawdzanie storage

samo
[cpp]std::string value;
player->getStorage("17027", value);
if(value == "1")
type = MSG_CHANNEL_RA;
[/cpp]
nie wystarczy?
 

#NOOB

Senior User
Joined
May 25, 2014
Messages
901
Reaction score
89
Odp: Sprawdzanie storage

samo
[cpp]std::string value;
player->getStorage("17027", value);
if(value == "1")
type = MSG_CHANNEL_RA;
[/cpp]
nie wystarczy?
A w?a?nie, ?e wystarczy :)
Dzi?ki.
 
Status
Not open for further replies.
Top