Need a little help on system

Im making a Take-Over point, and ive stumped myself. Ive gotten it all set except for one part…Slashing the point to recover its HP and deciding weather or not you are the owner or not. That decides if it goes down, or up. Say you own it, someone comes along and slashes it down to 50HP, you kill him, then you start slashing it back up to 100, but where im stuck , no matter who slashes it still goes UP, ANDDDD it keep going over the max of 100.

// NPC made by Stowen
if (created) {
  timeout = 0.05;
}
if (washit) {
  if (strtofloat(#a(server.fowner_haven))=strtofloat(#a(#a))){
    setstring server.flag_haven,#v(strtofloat(#s(server.flag_haven))+1);
  }else setstring server.flag_haven,#v(strtofloat(#s(server.flag_haven))-1)
      }

if (timeout){
  message #s(server.flag_haven)/100 owned by: #s(server.fowner_haven);
  timeout = 0.05;
}
if (timeout) {
  if (strtofloat(#s(server.flag_haven))=0){
    setstring server.flag_haven,100;
    setstring server.fowner_haven,#a;
  }

rethink this line:

if (strtofloat(#a(server.fowner_haven))=strtofloat(#a(#a))){

I know thats where the problem is, but I just can’t figure it out x.x[COLOR=“Silver”]

---------- Post added at 05:32 PM ---------- Previous post was at 05:31 PM ----------

[/COLOR]I even tried this:

if (strtofloat(#s(server.fowner_haven))=strtofloat(#a(#a))) {

wtf does this do:
strtofloat(#a (#a))

also learn the difference between == and the = operator.

strtofloat(#a) … would that work? wtf im asking for help, could you possibly explain what i should try?

or should i use #s(#a) ?

ok so I’ll point out your problematic area in the script.
[script]

if (washit) {
if (strtofloat(#a(server.fowner_haven))=strtofloat(#a(#a))){
setstring server.flag_haven,#v(strtofloat(#s(server.flag_haven))+1);
}else setstring server.flag_haven,#v(strtofloat(#s(server.flag_haven))-1)
[/script]
1)Your missing a semicolon on the last line
2)strtofloat converts a string to a floating point
–for this reason it’s not needed
–your comparing an account to an account, not a string to an account
----instead use strequals
------setstring server.flag_haven,(strequals(#a,#s(server.fowner_haven)))?1:-1;

wow, dont know why i was using strtofloat, i switched to this and it works:
if (strequals(#a,strtofloat(#s(server.fowned_haven)))){

but either way it still goes down even if you are the account…wtf?

yer soz, there was a typo in my code
setstring server.flag_haven,#v(strtofloat(#s(server.fowner_haven))+(strequals(#a,#s(server.fowner_haven)))?1:-1);

Fixed now

edit:the forums is fucking shit up, but you get the jist…

You don’t need to do strtofloat(#s(string)) for #a. >:O

yeah i dont understand why you are converting account names into numbers