PDA

View Full Version : Anyone able to help


Criimson
07-05-2011, 12:19 PM
So I have been having a bitch of a time with a conversion.
Tried everything I could think of and no luck.
Anyone able to help with this?

//Criimson added Bot follow distance - SetFollowDistance
if(!strcasecmp(sep->arg[1], "setfollowdistance")) {
if((c->GetTarget() == NULL) || (c->GetTarget() == c) || (!c->GetTarget()->IsBot()) ) {
c->Message(15, "You must target a bot!");
}
else {
//string strConvert = (sep->arg[2]);
//c->Message(15, strConvert);
//int32 BotFollowDistance = atoi(strConvert.c_str());
//int32 BotFollowDistance = atoi(strConvert);
//int32 BotFollowDistance = atoi(sep->arg[2]);
//int32 BotFollowDistance = Convert::ToInt32((sep->arg[2]), 16);
//SetFollowDistance(BotFollowDistance);
}

return;
}


LEft all the things Ive tried in comments so I could look it over as I scratched me head.
Thank you
Criimson

Derision
07-05-2011, 01:00 PM
Seems like

int32 BotFollowDistance = atoi(sep->arg[2]);

which you have already tried, should work, however you will also want to use

c->GetTarget()->SetFollowDistance(BotFollowDistance);

rather than just

SetFollowDistance(BotFollowDistance);

Criimson
07-05-2011, 01:46 PM
I love you.

Works like a charm. Now I can set all of my bots at different distances. Melees close and casters far, with none of them standing on the other.

Thank you

Criimson

revloc02c
07-06-2011, 10:06 AM
I love you.
ROFL

I know exactly how you feel--pullin your hair out for hours and then some kind soul finally shows you the way.