delete a spawned model in map

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Altusi
Lance Corporal
Posts: 13
Joined: Sat Mar 24, 2007 5:08 pm

delete a spawned model in map

Post by Altusi »

Hello,

I just want to know what is the command in a script for delete a model (a model that i spawn in the script). Example:
The map is launch, and after 5 sec a model is spawn on the map.
-->

Code: Select all

main:
wait 5
 local.panzer = spawn models/human/allied_oss_man_m1.tik
 local.panzer.origin = ( -1886 -65 271 )
 local.panzer.angle = 272
 local.panzer solid
 local.panzer immune bullet
 local.panzer immune fast_bullet
 local.panzer immune bash
 local.panzer immune mg
 local.panzer immune explosion
 local.panzer nodamage
...
I want to delete it after some times (i will add some wait command after). So what is the command that i have to write on my script for delete/remove (or hide if i have no choice) it.
Thanks

Al

ps: sorry if my english is not correct :(
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Normally I don't pick the easy ones :P , but:

local.panzer delete

would do :)
Image
Altusi
Lance Corporal
Posts: 13
Joined: Sat Mar 24, 2007 5:08 pm

Post by Altusi »

jv_map wrote:Normally I don't pick the easy ones :P , but:

local.panzer delete

would do :)
Oh! I put this in my script and it doesn't work! I don't see the model.
I put the delete command like this:

Code: Select all

main:
wait 5
 local.panzer = spawn models/static/allied_oss_man_m1.tik
 local.panzer.origin = ( -82.91 201.41 -43.35 )
 local.panzer.angle = 272
 local.panzer solid
 local.panzer immune bullet
 local.panzer immune fast_bullet
 local.panzer immune bash
 local.panzer immune mg
 local.panzer immune explosion
 local.panzer nodamage
wait 15
 local.panzer delete
...
Why he doesn't work for me? Is my script correct?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Your script looks good.
Altusi wrote:I don't see the model.
Do you see it without the delete line?
Image
Altusi
Lance Corporal
Posts: 13
Joined: Sat Mar 24, 2007 5:08 pm

Post by Altusi »

hmm, it work today! Something strange!
But now it work, thank you!

I think about something, i try to spawn a model on my map (original moh model, like models/static/flowerpainting.tik) and i don't spawn at the good co-ordinates. Is it possible that some model (like model/static) can't be spawn at co-ordinates by the script? Because i try to spawn a human model, and it's work; after that i try with an other (model/static) and it don't spawn at the same co-ordinates. I am sure to have not modified another thing in the script. I don't understand.
If someone can my light... :D



Ps: sorry for my questions, i never script and i try to understand how it work. And be reassured, i checked the tuto before ask question.
Post Reply