Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > NPC Server
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 11-17-2001, 05:01 AM
Guest
Posts: n/a
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.
  #2  
Old 11-17-2001, 12:42 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Cool 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
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
  #3  
Old 11-17-2001, 06:59 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
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.
__________________

  #4  
Old 11-17-2001, 11:41 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
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.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
  #5  
Old 11-18-2001, 09:03 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
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.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
  #6  
Old 11-19-2001, 09:55 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
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.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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