Author Topic: Question about stat-gun  (Read 792 times)

0 Members and 1 Guest are viewing this topic.

Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Question about stat-gun
« on: June 28, 2008, 09:58:50 am »
Kinda noobish question but:

I have a script, that spawns a statgun
Well... i tried to make it so, that it spawns it by typing " /statgun spawn"
It was easy though

Now i just have problem: i cant do command ( " /statgun remove " ) (which obviously would remove it)
How the hell i could do that?

E.
I already tried with killobject, but couldn't do it :S
Also Known As REIMA


Lol Happles (happy apples)

Offline sai`ke

  • Camper
  • ***
  • Posts: 318
  • Can't be arsed to remove christmas avatar
Re: Question about stat-gun
« Reply #1 on: June 28, 2008, 12:41:08 pm »
When you do spawnobject, you get an ID back from the procedure. You need to store this if you want to remove it later because you need it for killObject.

Take a look at the example for killObject in the EnEsCe help. If you want to have multiple stationary guns, you will need an array (a list) to store all the ID's of the placed ones.

If you need to detect that you are near a statgun, then you also need to store the position where it was placed. The neatest way to do this is to set up a structure to store all the information needed for the stationary gun and then make an array of this structure.
#soldat.ttw #ttw.gather --- Quakenet!
http://ttwforums.com

Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: Question about stat-gun
« Reply #2 on: June 29, 2008, 05:55:56 am »
Eww... kinda thanks!
I already tried the " I := spawnshit blablabla " thing, and it didn't work...
Though, this, second time, i got it working with (almost) exactly the same code o.O'
Also Known As REIMA


Lol Happles (happy apples)