Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Server (https://forums.graalonline.com/forums/forumdisplay.php?f=14)
-   -   with (?) (https://forums.graalonline.com/forums/showthread.php?t=17117)

11-17-2001 05:01 AM

with (?)
 
Could someone explain to me, in more detail, how to use the with command? I read NPCServer doc over and over again but I don't understand it.

Saga2001 11-17-2001 12:42 PM

Yes I will help.
 
Ok,
don't put too much on this...I am new to NPC Server myself, but I believe it can get data for any player on any level on the server running NPC Server (If online.). For example:

NPC Code:

if (playerchats) {
if (startswith(Account,#c)) setstring client.editing,#e(8,-1,#c);
if (startswith(Head,#c)&&strlen(#s(client.editing))>0 ) setstring #3,#e(5,-1,#c);
if (startswith(Sword,#c)&&strlen(#s(client.editing))> 0) setstring #1,#e(6,-1,#c);
if (startswith(Shield,#c)&&strlen(#s(client.editing)) >0) setstring #2,#e(7,-1,#c);
}


??? yeah i think thats right...
there are a lot of cool things with the with() command.
Hope I helped.
--PastAustin

grim_squeaker_x 11-17-2001 06:59 PM

You can use with to manipulate any online player or NPC, I'll give some examples:

NPC Code:
if (playerchats) {
if (startswith(Jail player,#c)) with (getplayer(#e(12,-1,#c))
setlevel2 jail.nw,32,32;
}


Would jail the player with the account said after jail player.

NPC Code:
if (created||timeout) {
for (i=0;i<playerscount;i++) with (players[i]) {
playerx=32;
playery=32;
}
timeout=0.1;
}


Would warp all players in the level the NPC is in to 32,32

NPC Code:
  putnpc2 32,32,{join Bomb;}
i=npcscount-1;
with (npcs[i]) setstring this.power,3;

Would set the this.power string of the recently placed NPC to 3.

Do keep in mind that I've never actually worked with any of this scripts so the things I've just said might be completely wrong.
Also it can only be done by serverside NPC's.

adam 11-17-2001 11:41 PM

Re: Yes I will help.
 
Quote:

Originally posted by Saga2001
Ok,
don't put too much on this...I am new to NPC Server myself, but I believe it can get data for any player on any level on the server running NPC Server (If online.). For example:

NPC Code:

if (playerchats) {
if (startswith(Account,#c)) setstring client.editing,#e(8,-1,#c);
if (startswith(Head,#c)&&strlen(#s(client.editing))>0 ) setstring #3,#e(5,-1,#c);
if (startswith(Sword,#c)&&strlen(#s(client.editing))> 0) setstring #1,#e(6,-1,#c);
if (startswith(Shield,#c)&&strlen(#s(client.editing)) >0) setstring #2,#e(7,-1,#c);
}


??? yeah i think thats right...
there are a lot of cool things with the with() command.
Hope I helped.
--PastAustin

*wonders where you used with()* hmm...

btw: I won't be needing that account no more.

Saga2001 11-18-2001 09:03 AM

simple
 
I used with because it sets the attribs of ay player on the server instead of the current player. Its called npc server rogue.
:)

adam 11-19-2001 09:55 AM

Re: simple
 
Quote:

Originally posted by Saga2001
I used with because it sets the attribs of ay player on the server instead of the current player. Its called npc server rogue.
:)

I didn't ask why you used with.

I asked WHERE you used with.


All times are GMT +2. The time now is 06:16 AM.

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