MP script question.

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

MP script question.

Post 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?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yes you can store it but I don't think it's persistant across rounds.
Image
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

ok thats good because i need my script to keep track of who has the 'bomb'.
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post 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:
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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}
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post 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.
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post by The Jackal »

BUMP! Thread is ALIVE!
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

ok, i'm guessing it's working now :D

if not use the
if ((###.origin) && (parm.other.warning == #)) commands :)
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

game

Post by tltrude »

There is an alternative to using "local" or "level". It is "game" and it will hold across rounds, I think.
Tom Trude,

Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Well I personally have had little luck with game. :?
Image
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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
hope this helps, prob not cos it's all foreign 2 me :-/
Post Reply