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

Solved Cancel onAdvance Message

Dantarrix

Member
Joined
Aug 27, 2010
Messages
546
Reaction score
18
Location
Stgo, Chile
Well, normally, when you advance level, skill or mag level, there appear a message that says:

Code:
You have advanced from 25 to 26 shielding.

Or something like that depending on skill....

However, I want to know if it's possible to cancel (or replace) it when player has 'x' storage...


Thanks in advance,
Dantarrix
 
Last edited:
in Player::addSkillAdvance (i guess you use OTX)

if you want to remove it, erase this part:
[cpp]s << "You advanced to " << getSkillName(skill) << " level " << skills[skill][SKILL_LEVEL] << ".";
sendTextMessage(MSG_EVENT_ADVANCE, s.str().c_str());[/cpp]

for storage should be something like this:
[cpp]std::string strValue;
if(getStorage("62666", strValue))
{
s << "You advanced to " << getSkillName(skill) << " level " << skills[skill][SKILL_LEVEL] << ".";
sendTextMessage(MSG_EVENT_ADVANCE, s.str().c_str());
}[/cpp]
 
I thought it was obvious that I was talking about an initialize funcion like onUse, onStepIn, etc.... I was thinking in one that should be onSendMessage or something like that...

@Jetro: Not working... Error on compiling:

Code:
C:\Users\Diego\Desktop\Servers\OTX\2.4\sources\player.cpp:641: error: 'strValue' was not declared in this scope
 
Last edited:
Lo siento, si funciona... jajajaja

Lo que pasó fue exactamente eso... Y no me di la lata de leer el error... Después lo leí y vi que no estaba definido strValue, volví a ver tu mensaje y ahí estaba....

Así que lo copié y ya, todo bien....

A todo esto, cambié el if por:

Code:
if (!(getStorage("66626", strValue))) {

:p

Ahora, eso no puedo cambiarlo para que sea un valor exacto como:

Code:
if (!(getStorage("66626", strValue) == "1")) {

O

Code:
if (getStorage("66626", strValue) != "1") {

Es que lo que quiero es que cuando el storage sea distinto de 1, siga mandando el mensaje... Y cuando sea 1, no se envíe...
 
well, it's time to write in english xD, use this:
[cpp]std::string strValue;
getStorage("62666", strValue);

if (atoi(strValue.c_str()) != 1)
{
s << "You advanced to " << getSkillName(skill) << " level " << skills[skill][SKILL_LEVEL] << ".";
sendTextMessage(MSG_EVENT_ADVANCE, s.str().c_str());
}[/cpp]
 
Back
Top