killing axis

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
kkcahdcakcyt
Sergeant
Posts: 71
Joined: Wed Aug 03, 2005 11:16 pm

killing axis

Post by kkcahdcakcyt »

I'm trying to make a switch that would kill all of the axis team. Any ideas on how to do this (i'm a newb scripter)
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

put a trigger_use around your switch, and give it a

$targetname/switchTrig
setthread/killAxis

in your script past the first thread...

Code: Select all

killAxis:
// kills all the Axis players

for(local.z = $player.size; local.z > 0; local.z--)
{
     if($player[local.z].dmteam == "axis")
     {
           $player[local.z] kill
      }
}

end
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
kkcahdcakcyt
Sergeant
Posts: 71
Joined: Wed Aug 03, 2005 11:16 pm

Post by kkcahdcakcyt »

thanks i'll try it...

don't want to be annoying but i would like to understand wut i'm putting in lol.

so the "$player.size" is the number of players?
and so local.z =$player.size
and so and then players who are axis are killed and the command to kill players is just $player kill and [local.z] specifies which player (is that part of an array?)

Wut is the purpose for the local.z--

(sorry for being such a newb)
kkcahdcakcyt
Sergeant
Posts: 71
Joined: Wed Aug 03, 2005 11:16 pm

Post by kkcahdcakcyt »

also i'm trying to make the words "switch activated" on all screens

I've been trying to add the line "locprint 30, 100, "switch activated" "
except when ever i try it, it doesn't show and it also makes the whole script not work.

so far i only have two scripts
one is the trigger_mulitple (sets up the trigger for the killaxis)
and it runs the killaxis method

Am i using the right command? and where do i put it? (i couldn't get it to work)
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

"locprint" is not a command ;) it's "loctionprint"

every for loop executes for a set number of times, local.z is how many times it loops. as long as local.z is above 0 then it'll go again. if you had 16 players in your server it'd execute 16 times, check for the Axis, and kill them all.

It's better form to put your entire script in a Notepad file saved as .scr, with all the threads and such in there for easy editing, as opposed to "hardcoding" it into your triggers and such. ;)
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Kiko
Major
Posts: 303
Joined: Mon Aug 29, 2005 8:58 pm
Location: US
Contact:

Post by Kiko »

kk, that is a very nice idea!!! I hope you get it working!

(\_/)
(O.o)
This is Bunny. Copy Bunny
(> <)
to help him achieve world domination.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

message script

Post by tltrude »

There is a handy little global script just for printing messages. You can use it in your script like this.

exec global/message.scr::message "Switch Activated!" NIL 5

The NIL keeps the word "hint" from being added, and the number is how long the message stays in the center of the screen.


Hope I got it right!
Tom Trude,

Image
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

lizardkid wrote:"locprint" is not a command ;) it's "loctionprint"

every for loop executes for a set number of times, local.z is how many times it loops. as long as local.z is above 0 then it'll go again. if you had 16 players in your server it'd execute 16 times, check for the Axis, and kill them all.

It's better form to put your entire script in a Notepad file saved as .scr, with all the threads and such in there for easy editing, as opposed to "hardcoding" it into your triggers and such. ;)
actualy locprint is a cmd. i dont know if it works though. location print is a console cmd, that i know does work.
kkcahdcakcyt
Sergeant
Posts: 71
Joined: Wed Aug 03, 2005 11:16 pm

Post by kkcahdcakcyt »

tltrude, thanks for your help
I don't have anyfriend to play test it right now
so I would liek to know does this message.scr
show the message to all players?
I was hoping this message would be seen by all players
or even better force it to come from the activating players mouth

I had tried copying the stufftext from the post where they guy was making a teleporter that killed people for trying to shark in Destroyed village. (I didn't get that one to work either....)
Post Reply