Page 1 of 1

killing axis

Posted: Tue Aug 30, 2005 8:08 pm
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)

Posted: Tue Aug 30, 2005 11:24 pm
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

Posted: Wed Aug 31, 2005 1:27 am
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)

Posted: Wed Aug 31, 2005 3:21 am
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)

Posted: Wed Aug 31, 2005 5:07 am
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. ;)

Posted: Wed Aug 31, 2005 5:35 am
by Kiko
kk, that is a very nice idea!!! I hope you get it working!

message script

Posted: Wed Aug 31, 2005 9:06 am
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!

Posted: Wed Aug 31, 2005 12:42 pm
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.

Posted: Fri Sep 02, 2005 2:30 am
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....)