Guild Tower

In case anybody cares…

//NPC by Alex
if(created){
  setstring server.flag1health,50;
  timereverywhere;
}
if(playerenters){
  timeout = 0.05;
}
if(washit){
  if(strequals(#g,#s(server.flag1guild)) && strtofloat(#s(server.flag1health))<50){
    setstring server.flag1health,#v(strtofloat(#s(server.flag1health))+1);
  }
  else if(!strequals(#g,#s(server.flag1guild))){
    if(!strequals(#g,)){
      setstring server.flag1health,#v(strtofloat(#s(server.flag1health))-1);
    }
    else if(strequals(#g,)){
      setplayerprop #c,I need a guild tag!;
    }
  }
}
if(strtofloat(#s(server.flag1health))==0){
  setstring server.flag1guild,#g;
  setstring server.flag1health,50;
}
if(timeout){
  message #s(server.flag1guild) #s(server.flag1health)/50;
  timeout = 0.05;
}

If you like it, PM me

And, an image…[ATTACH=CONFIG]2193[/ATTACH]

That’s all well and good. But why is it that everyone comes here and makes the traditional UN Tower. :expressionless:

Oh, because I was making a script for crossfire and he wanted it like this xP And I didn’t want to make it seem like I was scripting for exotic, so I decided to post it :slight_smile:

Him helping you doesn’t make him a great scripter.

That script is AWESOME

Hmmm, in case anybody wants it, and can’t figure out how to make the showtext move correctly depending on the length of the string, here is a weapon that will show who has the tower…

if(playerenters){
  toweapons -flagshower;
  timeout = 0.05;
}
if(timeout){
  this.number=600+playerindex;
  showtext this.number,screenwidth-(12.5*strlen(#s(server.flag1guild))+220),screenheight-35,arial,b,Namehere Tower Owner: #s(server.flag1guild);
  changeimgvis this.number,4;
  timeout = 0.05;
}

Replace “Namehere” with your tower name x.x

For it to warp you to somewhere when you die…

if(playerhearts==0){
   setlevel2 LEVELNAME.NW,X,Y;
}

This one will warp everyone except for the guild who has the tower on death…

if(playerhearts==0 && !strequals(#g,#s(server.flag1guild))){
   setlevel2 LEVELNAME.NW,X,Y;
}

You can also easily modify the tower script so it “kills” you when somebody else takes the flag, and heals the person who took the flag…

EDIT: Also added a check so now you can’t hurt the flag if you don’t have a guild tag…

So you want to centre it I assume?
In this case you add c to the style. So you can have :cb which is centred and bold or just: c

showtext this.number,screenwidth,screenheight-35,arial,bc,Namehere Tower Owner: #s(server.flag1guild);

I dont think style order matters though lol.

What Im looking for is when you press H it shows how long your guild has taken towers. (Hours, Minutes, Seconds.)

Something like this?
http://forums.graal.in/forums/showthread.php?5165-Server-Time

Just start on castle take and with a keydown, check for “H” and display the time strings.

I dont get it…

sheesh, just add a section that if(taken==1) or something, then put
server.guildseconds++; or something.

Presto, then they just need a weapon on the player that divides the seconds into minutes, and the minutes into hours. And makes the ‘H’ key when pressed show the time.
Ezpz.

Oh, ok!

Ugh, you want me to script that? I won’t probably x.x

You’d need…

if(keydown2(keycode(h),true)){

and you’ll want a loop showing things, and…god, ok, I might make it…

And tric, you can try out the script on exotic…

It shows the words the correct length from the side…

Also, I was just pulling that last bit out of my ass. I don’t even know if that’s all, or if the stuff in there would be correct.

Best scripting thread :smiley:

Best Necro thread ever?

There’s been better.

The code sucks. This thread sucks.

Oh, like that recent record setter that started in 2007?