Page 1 of 1

MP script question.

Posted: Sat Jun 28, 2003 2:30 am
by Alcoholic
can you store keys in individual players? for example, local.player.coolness = 5 ? would that work? and would it stay persistanct across rounds?

Posted: Sat Jun 28, 2003 6:28 am
by jv_map
Yes you can store it but I don't think it's persistant across rounds.

Posted: Sat Jun 28, 2003 7:01 pm
by Alcoholic
ok thats good because i need my script to keep track of who has the 'bomb'.

Posted: Wed Sep 24, 2003 5:38 am
by The Jackal
OK this thread comes the closest to what I am looking for.

Setup the question:

OK I am makin a "No Cross" script. It kills the player that tries to cross. But this just mean that a suicidal player can continue killing himself and ruining the score. I saw that you can add a key to a player.

The Question:

Can I change that key and refer to it ( like I would a CVAR) each time the player crosses?

The Script:

Code: Select all

_border:

while(1)
{
$player[local.p].warn = ""
for(local.p = 1; local.p < $player.size+1;local.p++)
	{
	if($player[local.p].origin[1] <= 1200 && $player[local.p].warn == "")
		{
		 $player[local.p] hurt 200
		 $player[local.p].warn = "1"
		 $player[local.p] iprintln "This is your first warning...."
		}
	if($player[local.p].origin[1] <= 1200 && $player[local.p].warn == "1")
		{
		 $player[local.p] hurt 200
		 $player[local.p].warn = "2"
		 $player[local.p] iprintln "This is your FINAL warning...."
		}
	if($player[local.p].origin[1] <= 1200 && $player[local.p].warn == "2")
		{
		 $player[local.p] hurt 200
		 wait .5
		 $player[local.p] stufftext ("say I cannot follow rules. Goodbye!")
		 wait 1
		 $player[local.p] stufftext ("disconnect")
		}

		else
		{
		 // Just in case
		}

	}

wait (.1)
}
end
Am I on the right road? Because this sure do not work! :cry:

Posted: Thu Sep 25, 2003 12:25 am
by nuggets
you need no for loop as you know who's crossing the line by the co-ordinates, so just have a trigger_multiple instead of if .origin[1] > 1200

if ((parm.other.warning == "NIL") || (parm.other.warning == 0)) // the trigger hasn't been here yet
{parm.other.warning = 1
parm.other hurt 200
wait 2} //gives him time to leave

if (parm.other.warning == 1)
{parm.other.warning = 2
parm.other hurt 200
wait 2}

if (parm.other.warning == 2)
{parm.other.warning = 3
parm.other hurt 200
wait 2}

if (parm.other.warning == 3)
{parm.other.warning = 0
parm.other stufftext "disconnect"
wait .1}

Posted: Thu Sep 25, 2003 1:30 am
by The Jackal
OK Nuggets thanks. But last time I checked trigger_multiple require a brush and ALL my mods are 100% scripted. Hence the use of origins.

Posted: Fri Sep 26, 2003 5:29 am
by The Jackal
BUMP! Thread is ALIVE!

Posted: Sat Sep 27, 2003 5:39 pm
by nuggets
ok, i'm guessing it's working now :D

if not use the
if ((###.origin) && (parm.other.warning == #)) commands :)

game

Posted: Sun Sep 28, 2003 5:34 am
by tltrude
There is an alternative to using "local" or "level". It is "game" and it will hold across rounds, I think.

Posted: Sun Sep 28, 2003 7:25 am
by jv_map
Well I personally have had little luck with game. :?

Posted: Sun Sep 28, 2003 1:27 pm
by nuggets
i've noticed that with game it only carries variables stored if the current map has a next map to load,

if it didn't there'd be god knows how many variables floating about in the game,

i'm not sure aobut roundbased games though, it seems logical to have it available to use there but never tried it myself