I am trying to make a 'potion' that the first time you use it, it sets that place as a warp, then subsequent uses causes you to warp there (up to 15 charges)
The problem is, it doesn't exactly warp you where you first used it...
NPC Code:
if (placeset) {
// i-- and set i to charges
setlevel2 #s(filename),strtofloat(#s(oldx)),strtofloat(#s(ol dy));
}
if (havntplaceset) {
setstring filename,#L;
setstring oldx,#v(x));
setstring oldy,#v(y));
set placeset;
unset havntplaceset;
} // And yes, i am using flags, cause i don't care. :P
Example:
oldx=10.1875
oldy=33.09375
x before use = 9.5
y before use = 32
x after use = 10.1875
y after use = 33.09375
adding int to the bolded parts above doesn't help either.
Have tried everything...but now i'm going to ask another mind to help me out.
Thanks,
Gohan