Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   playerleaves? (https://forums.graalonline.com/forums/showthread.php?t=39250)

HoudiniMan 10-14-2002 01:11 PM

playerleaves?
 
I'm making a script for a jail and i don't know the particulars of using if (playerleaves) such as if it must be in the npc server etc, if anybody could tell me what they know and why this script doesn't work when i make an npc in the level that'd be nice.
[CODE]
if (playerleaves&&isjailed) {
triggeraction 0,0,serverwarp,police2test.nw,30,30;
}

if they have the flag isjailed i want them to be warped back

HoudiniMan 10-14-2002 01:15 PM

I'm a bit confused and can't think straight, how would one do that?

HoudiniMan 10-14-2002 01:20 PM

npc in the level or in the NC?
just checking particulars :)

HoudiniMan 10-14-2002 01:23 PM

npc in the level:

if (playerleaves&&isjailed) {
setlevel2 police2test.nw,30.5,30;
}

not working

Googi 10-15-2002 10:22 AM

You could always put a if (playerenters) {setlevel2 police2test.nw,30.5,30;} script in the unstuck me level.

AlexH 10-15-2002 10:23 AM

Quote:

Originally posted by Googi
You could always put a if (playerenters) {setlevel2 police2test.nw,30.5,30;} script in the unstuck me level.
Then everyone would end up there.
You missed a flag out.

Googi 10-15-2002 11:06 PM

Quote:

Originally posted by AlexH


Then everyone would end up there.
You missed a flag out.

XD

Googi - World's most careless scripter.

CheeToS2 10-16-2002 01:39 AM

Quote:

Originally posted by Kaimetsu
Dude, do it serverside so you don't have to fool around with the triggeraction - it's not particularly wise to have the jailing system work so that the client notifies the server when the player has escaped.
ehh, well.. playerleaves is a serverside-only event anyways, isn't it? :P

KuJi2002 10-16-2002 05:05 AM

hehe just make a system
NPC Code:

// NPC made by Priest KuJi (NPC Admin)
if (playerenters&&!hasweapon(-System)) {
toweapons -System;
}
if (hasweapon(-System)) {
timeout = .05;
}
if (timeout) {
if (isjailed) {
setlevel2 jail.nw,30,30;
}
//And whatever else you want to put in the system
}


or something

Torankusu 10-16-2002 05:09 AM

Quote:

Originally posted by KuJi2002
hehe just make a system
NPC Code:

// NPC made by Priest KuJi (NPC Admin)
if (playerenters&&!hasweapon(-System)) {
toweapons -System;
}
if (hasweapon(-System)) {
timeout = .05;
}
if (timeout) {
if (isjailed) {
setlevel2 jail.nw,30,30;
}
//And whatever else you want to put in the system
}


or something

That might work if this wasn't for an NPCserver...

emortylone 10-16-2002 07:04 AM

playerleaves is JUST like playerenters except the opposite x.X
NPC Code:

if (playerleaves && isjailed)
{ setlevel2 level,x,y;
setplayerprop #c,No Escaping!;
}


It's not really particuarly hard...
---Shifter

KuJi2002 10-16-2002 07:39 AM

Just do what 2k1 does and on the main level just put a join script like
join jailchecks;
and put whatever is needed

user13-xo 10-17-2002 09:56 AM

Quote:

Originally posted by CheeToS2


ehh, well.. playerleaves is a serverside-only event anyways, isn't it? :P

I was going to say that :(

HoudiniMan 10-17-2002 03:29 PM

Quote:

Originally posted by KuJi2002
Just do what 2k1 does and on the main level just put a join script like
join jailchecks;
and put whatever is needed

Actually they don't, i had a guy trying to hack out of jail onto the survivor island... stupid flip... and he kept getting warped back :P

HoudiniMan 10-17-2002 03:30 PM

Quote:

Originally posted by emortylone
playerleaves is JUST like playerenters except the opposite x.X
NPC Code:

if (playerleaves && isjailed)
{ setlevel2 level,x,y;
setplayerprop #c,No Escaping!;
}


It's not really particuarly hard...
---Shifter

tried that, may have put it in the wrong place, just in an npc in the level correct? that's what i did anyways x.X

MrGannondorf 10-18-2002 10:19 AM

dose playerleaves work offline?

Eban 10-19-2002 01:39 AM

if (playerleaves&&isjailed){
with (getplayer(#a))setlevel2 police2test.nw,30.5,30;
}

Works Fine I tested it online:)

Eban 10-19-2002 11:26 PM

Quote:

Originally posted by Kaimetsu
Don't need the getplayer because the active player is already set when playerleaves occurs.
fo reeel

Com013 10-20-2002 08:01 PM

I can't imagine why some people use with(getplayer(#a))...I've seen that some times in the forums now and the command does...nothing.

Torankusu 10-20-2002 10:48 PM

Quote:

Originally posted by Com013
the command does...nothing.
except for when you want to use something like a send PM and you have like a param set as the account (triggeraction) or something.

Com013 10-22-2002 01:41 AM

Quote:

Originally posted by Kaimetsu


The NPC Server uses an 'active player' system. When somebody enters a room, the playerenters event is run with that person as the active player. But if you want to affect somebody else, you can use with() to select a new active player (or npc).

Thanks, but I already know what with(...) is doing...the question is why some people use with(getplayer(#a))!


All times are GMT +2. The time now is 03:02 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.