Graal Forums

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

a1tjm 09-27-2003 04:59 AM

Door -.-
 
I know its simple but

//#CLIENTSIDE
if(playerchats && strequals(#c,open) && strequals(#a,a1tjm)){
hidelocal;
}
if(playerchats && strequals(#c,close) && strequals(#a,a1tjm)){
showlocal;
}
if(playerchats && strequals(#c,open) && strequals(#a,papajchris)){
hidelocal;
}
if(playerchats && strequals(#c,close) && strequals(#a,papajchris)){
showlocal;
}

If I use it it would only work for my account and it would not block or open for other users who try to enter =o

I am not a great scripter :(

Kaimetsu 09-27-2003 05:05 AM

http://forums.graal2001.com/forums/s...threadid=46557

a1tjm 09-27-2003 05:07 AM

:(
 
I still don't get it x.x

Dach 09-27-2003 08:24 AM

*claps* (not bad for a beginner really)
*points to KSI link*
you should have nested the chat checks in a playerchats event block, and you could just group the account checks together, but that'd be ugly

osrs 09-27-2003 05:19 PM

Quote:

Originally posted by a1tjm
If I use it it would only work for my account and it would not block or open for other users who try to enter =o

showlocal will show an hidden NPC only for the current player.

faenix 09-27-2003 05:41 PM

If you want it to block for all the players, take out the //#CLIENTSIDE and use the commands hide and show rather than hidelocal and showlocal

Goboom 09-27-2003 06:25 PM

Re: Door -.-
 
Quote:

Originally posted by a1tjm
I know its simple but

//#CLIENTSIDE
if(playerchats && strequals(#c,open) && strequals(#a,a1tjm)){
hidelocal;
}
if(playerchats && strequals(#c,close) && strequals(#a,a1tjm)){
showlocal;
}
if(playerchats && strequals(#c,open) && strequals(#a,papajchris)){
hidelocal;
}
if(playerchats && strequals(#c,close) && strequals(#a,papajchris)){
showlocal;
}

If I use it it would only work for my account and it would not block or open for other users who try to enter =o

I am not a great scripter :(

Kai means dont do this crap you have right now.
NPC Code:

if(playerchats && strequals(#c,open) && strequals(#a,a1tjm)){
hidelocal;
}


Do something like this.
NPC Code:

if (playerchats){
if (strequals(#c,open)){
if (strequals(#a,a1tjm)){
//stuff goes here
}
}
}


Ningnong 09-27-2003 09:02 PM

You have to use triggeraction to get from clientside to serverside.

-The playerchat is checked clientside, aswell as the account name. Then use triggeraction, and the hide part goes serverside.

Riot-Starter 09-27-2003 09:42 PM

Quote:

Originally posted by Ningnong
You have to use triggeraction to get from clientside to serverside.

-The playerchat is checked clientside, aswell as the account name. Then use triggeraction, and the hide part goes serverside.

Ew why?
Check serverside, perform serverside.

Ningnong 09-27-2003 09:59 PM

check playerchats serverside....uh huh?

Riot-Starter 09-27-2003 10:08 PM

Yep. Something wrong with me doing playerchat checks serverside?

Ningnong 09-27-2003 10:15 PM

no, no, nothing... appart from the fact it won't work.

Riot-Starter 09-27-2003 10:17 PM

Yes it does work, just fine.....

Ever even attempt it?

Ningnong 09-27-2003 10:26 PM

so your saying this will work?

NPC Code:

if (playerchats){
if (strequals(#c,/test)) sendtorc testing!;
}



?

Sorry but it doesn't.

Riot-Starter 09-27-2003 10:30 PM

It works fine for me.

Ningnong 09-27-2003 10:33 PM

im talking "without the clientside part"

look:

Correct:
NPC Code:

if (actionserverside){
if (strequals(#p(0),test)) sendtorc test worked;
}
//#CLIENTSIDE
if (playerchats){
if (strequals(#c,/test))
triggeraction 0,0,serverside,npc_name,test;
}



Incorrect:

(posted in last post)

Where are you testing this?

Riot-Starter 09-27-2003 10:35 PM

Lenoxion Online,

Python523 09-27-2003 10:35 PM

Quote:

Originally posted by Ningnong
no, no, nothing... appart from the fact it won't work.
...o.O you're a scripter, right? since when does playerchats not work serverside

Ningnong 09-27-2003 10:36 PM

yea I am. I just tested it... Unless theres something really weird going on...

Python523 09-27-2003 10:38 PM

DB NPC or local level npc?

Ningnong 09-27-2003 10:40 PM

DB NPC.


Thats probably where we are getting confused.

I've never actually tried if (playerchats) serverside on a local levels npc.

*trys it*

Python523 09-27-2003 10:42 PM

Quote:

Originally posted by Ningnong
DB NPC.


Thats probably where we are getting confused.

I've never actually tried if (playerchats) serverside on a local levels npc.

*trys it*

It should work 100% fine if it's on a DB npc, from your example of a working version using triggeraction it looked like you were using a weapon, you sure you weren't using a weapon before? And the only way it'll work (I think) on a local npc is if the server doesn't optimize it, the npcserver is usually 'ignoring' npcs that don't have any flags or strings on them so it doesn't 'see' them, so technically the npc will be clientside only

Ningnong 09-27-2003 10:44 PM

yes, I tested on a weapon and It wasn't working....but I see now that it works on a level npc, also a level-db npc.

Lance 09-28-2003 12:02 AM

Serverside playerchats checks should be working on everything except weapons, as the serverside code there can only be called with a triggeraction.

Skyld 09-28-2003 09:21 PM

What happened to the door?
 
What happened to the conversation about the door?

Idrox0 10-17-2003 11:17 AM

ok, heres a (non-clientside) shortened version of the door you had if you wanted others to get in after you say open...
NPC Code:

if (playerchats) {
if (strequals(#a,a1tjm)||strequals(#a,papajchris) {
if (strequals(#c,open)) hide;
if (strequals(#c,close)) show;
}
}



Note to Kaimetsu: Does it follow the KSI-GS?

Kaimetsu 10-17-2003 12:37 PM

Quote:

Originally posted by Idrox0
Note to Kaimetsu: Does it follow the KSI-GS?
Not quite. Rule eight.

Idrox0 10-17-2003 09:32 PM

Okay Kai...(is it ok if i call you that?) here's the code with KSI-GS Standards...
NPC Code:

if (playerchats) {
if (strequals(#a,a1tjm)||strequals(#a,papajchris) {
if (strequals(#c,open)) hide;
else if (strequals(#c,close)) show;
}
}


Lance 10-18-2003 02:17 AM

Quote:

Originally posted by Idrox0
Okay Kai...(is it ok if i call you that?) here's the code with KSI-GS Standards...
NPC Code:

if (playerchats) {
if (strequals(#a,a1tjm)||strequals(#a,papajchris) {
if (strequals(#c,open)) hide;
else if (strequals(#c,close)) show;
}
}


You are missing no less than one ) in your second line.

Kaimetsu 10-18-2003 08:22 AM

Quote:

Originally posted by Idrox0
Okay Kai...(is it ok if i call you that?) here's the code with KSI-GS Standards...
Yeah, everybody calls me Kai. And, aside from the little bracket problem, the code looks much nicer now :)

Idrox0 10-18-2003 11:44 PM

It must be perfect now.

NPC Code:

if (playerchats) {
if (strequals(#a,a1tjm)||strequals(#a,papajchris)) {
if (strequals(#c,open)) hide;
else if (strequals(#c,close)) show;
}
}



Proplem solved! ^_^


All times are GMT +2. The time now is 06:05 PM.

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