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

getstorage

ConAn Edujawa

Member
Joined
Feb 23, 2015
Messages
457
Reaction score
17
what the wrong in this code
Lua:
std::string value;
   for (int32_t i = 952610; i <= 952621; i++)
                  player->getStorage(i, value);
                int32_t tmp = (int32_t)atoi(value.c_str());
                if(tmp > 0)
                    ss << " amount: " << tmp << ".";

don't show amount
0.4
 
Last edited:
Solution
try with '{}'
C++:
std::string value;
for (int32_t i = 952610; i <= 952621; i++) {
    player->getStorage(i, value);
    int32_t tmp = (int32_t)atoi(value.c_str());
    //ss << " TESTamount: " << tmp << "."; //test
    if(tmp > 0) {
        ss << " amount: " << tmp << ".";
    }
}
try with '{}'
C++:
std::string value;
for (int32_t i = 952610; i <= 952621; i++) {
    player->getStorage(i, value);
    int32_t tmp = (int32_t)atoi(value.c_str());
    //ss << " TESTamount: " << tmp << "."; //test
    if(tmp > 0) {
        ss << " amount: " << tmp << ".";
    }
}
 
Solution
Back
Top