Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-20-2002, 12:45 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
playerisrc...

I am thinking this may be moved to NPC Server, but o well...
I am using this:
NPC Code:

for (i=0; i<allplayerscount; i++; ) {
with(allplayers[i]) {
stfu;
}
}


As we all know with(allplayers[i]) returns even for rcs, hence allplayers...However I need detection to see if the current selection is on rc or not. How would you all go about this? I tried #L thinking it might be null, but fail...It equals the last level.
__________________

!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
Reply With Quote
  #2  
Old 04-20-2002, 05:30 PM
mhermher mhermher is offline
galase galase!
mhermher's Avatar
Join Date: Jun 2001
Location: Sweden, Stockholm.
Posts: 2,012
mhermher is on a distinguished road
Send a message via ICQ to mhermher Send a message via AIM to mhermher Send a message via Yahoo to mhermher
Re: playerisrc...

Quote:
Originally posted by Saga2001
I am thinking this may be moved to NPC Server, but o well...
I am using this:
NPC Code:

for (i=0; i<allplayerscount; i++; ) {
with(allplayers[i]) {
stfu;
}
}


As we all know with(allplayers[i]) returns even for rcs, hence allplayers...However I need detection to see if the current selection is on rc or not. How would you all go about this? I tried #L thinking it might be null, but fail...It equals the last level.
umm try

if (strcontains(#a,"pw name here")||strcontains(#a,RC)) {
__________________
Donate money for my trip to Germany

Adiarde Manager
Reply With Quote
  #3  
Old 04-20-2002, 06:13 PM
Kadar Kadar is offline
Registered User
Join Date: Jan 2002
Posts: 636
Kadar is on a distinguished road
Re: Re: playerisrc...

Quote:
Originally posted by mhermher

umm try

if (strcontains(#a,"pw name here")||strcontains(#a,RC)) {
Lets say there is a server named gagakaria(;P) ok so u could make the account effgagakariaeffff_rcrcrc
__________________
Reply With Quote
  #4  
Old 04-20-2002, 07:00 PM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster
Re: Re: playerisrc...

Quote:
Originally posted by mhermher

umm try

if (strcontains(#a,"pw name here")||strcontains(#a,RC)) {
That doesn't mean they are on-RC. Those accounts work in-game as well.
Reply With Quote
  #5  
Old 04-20-2002, 07:04 PM
Spanko Spanko is offline
Squeaker of Soles
Spanko's Avatar
Join Date: Nov 2001
Location: The Netherworl...lands
Posts: 1,366
Spanko is on a distinguished road
Send a message via ICQ to Spanko Send a message via AIM to Spanko Send a message via Yahoo to Spanko
You could try checking to see if a player just logged on who isn't in a level, since RCs aren't supposed to be in levels.

Also, #L is the NPCs level, #F is the player's level.
__________________

ICQ: 125283920
MSN: [email protected]
AIM: Squeax0r
Squeaker seems unable to access the forum using this account.. tis a sad day.
Now with occasional Asuka flavour! Ooops a bit too much...
Asuka should be king of Dustari!

"Y'know, some days even my lucky rocketship underpants don't even help."
Reply With Quote
  #6  
Old 04-20-2002, 07:21 PM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
if your trying to get a players count you could try....
NPC Code:

if (isweapon){
timeout=0.05;
timereverywhere;}
if (playeronline){
timeout=0.05;
server.playercount++;}else{server.playercount--;}


you could put it in a system npc..and if the rc isnt on the playeraccount it shouldnt get counted
__________________
Reply With Quote
  #7  
Old 04-20-2002, 08:58 PM
mhermher mhermher is offline
galase galase!
mhermher's Avatar
Join Date: Jun 2001
Location: Sweden, Stockholm.
Posts: 2,012
mhermher is on a distinguished road
Send a message via ICQ to mhermher Send a message via AIM to mhermher Send a message via Yahoo to mhermher
Re: Re: Re: playerisrc...

Quote:
Originally posted by Slaktmaster

That doesn't mean they are on-RC. Those accounts work in-game as well.
oh yah i forgot
__________________
Donate money for my trip to Germany

Adiarde Manager
Reply With Quote
  #8  
Old 04-21-2002, 01:16 AM
Neonight Neonight is offline
where da wmdz at
Neonight's Avatar
Join Date: Jun 2001
Location: Windsor, Illinois
Posts: 3,665
Neonight is on a distinguished road
Send a message via AIM to Neonight

Jagen:
If you want this to work ONLY for RCs, use
if (strlen(#F)<=0)
It'll run the script if the player level's length is less than or equal to 0 (which is RC)
Reply With Quote
  #9  
Old 04-21-2002, 10:57 PM
jeff335 jeff335 is offline
Registered User
Join Date: Oct 2001
Posts: 605
jeff335 is on a distinguished road
Quote:
Originally posted by Neonight

Jagen:
If you want this to work ONLY for RCs, use
if (strlen(#F)<=0)
It'll run the script if the player level's length is less than or equal to 0 (which is RC)


You know jagen...you really should give the credit to stefan. we were too bloody thick to think of that until we asked him about how to make the addweapon code quit working on RCs.
__________________

Quote:
Some people like standing around talking to idiots in the real world, and some don't. Neither choice is inherently better than the other.

-Kaimetsu
Reply With Quote
  #10  
Old 04-22-2002, 12:23 AM
Neonight Neonight is offline
where da wmdz at
Neonight's Avatar
Join Date: Jun 2001
Location: Windsor, Illinois
Posts: 3,665
Neonight is on a distinguished road
Send a message via AIM to Neonight
Quote:
Originally posted by jeff335




You know jagen...you really should give the credit to stefan. we were too bloody thick to think of that until we asked him about how to make the addweapon code quit working on RCs.

You couldn't think about using that either
Reply With Quote
  #11  
Old 04-22-2002, 06:34 AM
jeff335 jeff335 is offline
Registered User
Join Date: Oct 2001
Posts: 605
jeff335 is on a distinguished road
Jagen:

I did say "we" not "you"


Kai:

Stefan said <=, and it's not that much harder to type than ==, so..
__________________

Quote:
Some people like standing around talking to idiots in the real world, and some don't. Neither choice is inherently better than the other.

-Kaimetsu
Reply With Quote
  #12  
Old 04-22-2002, 10:27 AM
jeff335 jeff335 is offline
Registered User
Join Date: Oct 2001
Posts: 605
jeff335 is on a distinguished road
Quote:
Originally posted by Kaimetsu


It's not about typing difficulty, it's about maximising how specific the logic is.

<=0 means nothing or absolute nonexistance. Stefan must have reckoned that there might just be a plain nothing when you #F a withed rc. But == and <= work just the same since there can't be -1 characters, so what does it matter?
__________________

Quote:
Some people like standing around talking to idiots in the real world, and some don't. Neither choice is inherently better than the other.

-Kaimetsu
Reply With Quote
  #13  
Old 04-22-2002, 05:06 PM
Spanko Spanko is offline
Squeaker of Soles
Spanko's Avatar
Join Date: Nov 2001
Location: The Netherworl...lands
Posts: 1,366
Spanko is on a distinguished road
Send a message via ICQ to Spanko Send a message via AIM to Spanko Send a message via Yahoo to Spanko
Quote:
Originally posted by Kaimetsu


Specifying the logic, like I said. If you use <= then it's true for zero and anything less than zero. You only actually want zero. Sure, <0 can't happen, but that's not the point. Asking for more than you need and broadening the logic is seen as a Bad Thing. I'll assume Stefan had some reason for it. Perhaps sometimes strlen returns -1.
Actually <0 can easily happen.
Well not for strlen, but that isn't my point.
__________________

ICQ: 125283920
MSN: [email protected]
AIM: Squeax0r
Squeaker seems unable to access the forum using this account.. tis a sad day.
Now with occasional Asuka flavour! Ooops a bit too much...
Asuka should be king of Dustari!

"Y'know, some days even my lucky rocketship underpants don't even help."
Reply With Quote
  #14  
Old 04-22-2002, 06:19 PM
Spanko Spanko is offline
Squeaker of Soles
Spanko's Avatar
Join Date: Nov 2001
Location: The Netherworl...lands
Posts: 1,366
Spanko is on a distinguished road
Send a message via ICQ to Spanko Send a message via AIM to Spanko Send a message via Yahoo to Spanko
Quote:
Originally posted by Kaimetsu


I think it was implicit that I was talking about returns from strlen.
Yes, but I decided to partly rip your post out of context.
__________________

ICQ: 125283920
MSN: [email protected]
AIM: Squeax0r
Squeaker seems unable to access the forum using this account.. tis a sad day.
Now with occasional Asuka flavour! Ooops a bit too much...
Asuka should be king of Dustari!

"Y'know, some days even my lucky rocketship underpants don't even help."
Reply With Quote
  #15  
Old 04-22-2002, 06:47 PM
Spanko Spanko is offline
Squeaker of Soles
Spanko's Avatar
Join Date: Nov 2001
Location: The Netherworl...lands
Posts: 1,366
Spanko is on a distinguished road
Send a message via ICQ to Spanko Send a message via AIM to Spanko Send a message via Yahoo to Spanko
Quote:
Originally posted by Kaimetsu


Maybe I should partly rip your throat out of context.
You could do that, but it'd mean you'd have no one to plot evil schemes with anymore.
__________________

ICQ: 125283920
MSN: [email protected]
AIM: Squeax0r
Squeaker seems unable to access the forum using this account.. tis a sad day.
Now with occasional Asuka flavour! Ooops a bit too much...
Asuka should be king of Dustari!

"Y'know, some days even my lucky rocketship underpants don't even help."
Reply With Quote
Reply


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 04:32 PM.


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