Graal Forums

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

Saga2001 04-20-2002 12:45 PM

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.

mhermher 04-20-2002 05:30 PM

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)) {

Kadar 04-20-2002 06:13 PM

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:)

Slaktmaster 04-20-2002 07:00 PM

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.

Spanko 04-20-2002 07:04 PM

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.

Goboom 04-20-2002 07:21 PM

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

mhermher 04-20-2002 08:58 PM

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

Neonight 04-21-2002 01:16 AM


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)

jeff335 04-21-2002 10:57 PM

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.

Neonight 04-22-2002 12:23 AM

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 :p

jeff335 04-22-2002 06:34 AM

Jagen:

I did say "we" not "you"


Kai:

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

jeff335 04-22-2002 10:27 AM

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?

Spanko 04-22-2002 05:06 PM

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.

Spanko 04-22-2002 06:19 PM

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.

Spanko 04-22-2002 06:47 PM

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.


All times are GMT +2. The time now is 07:14 AM.

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