Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   #l, #f ???? (https://forums.graalonline.com/forums/showthread.php?t=44091)

Ethic_Sern 04-07-2003 08:46 PM

#l, #f ????
 
Ok clientside
if(strcontains(#L,.nw))
Serverside
if(strcontains(#F,.nw))

Both dont work ......

Jeff 04-07-2003 08:58 PM

Strcontains can be a bit finnicky sometimes. Use an indexof.

Ethic_Sern 04-07-2003 09:22 PM

SO just indexof(#F.nw)

adam 04-07-2003 10:44 PM

Quote:

Originally posted by Ethic_Sern
SO just indexof(#F.nw)
"indexof( partstr, str ) position of where partstr appears in str (-1 -> not in str)"

judging from this it should be.

"if (indexof(.nw,#L) != -1)message It is in the string.;"

But this is graal so try, try, and try again.

"strcontains( str, partstr ) str contains partstr"

judging from this your previous scripts should have worked fine....
But this is graal?

from commands.rtf

Ethic_Sern 04-07-2003 11:52 PM

Quote:

Originally posted by adam


"indexof( partstr, str ) position of where partstr appears in str (-1 -> not in str)"

judging from this it should be.

"if (indexof(.nw,#L) != -1)message It is in the string.;"


See that works but it doesnt check all the time only when i log on and offline

osrs 04-07-2003 11:54 PM

Quote:

Originally posted by Ethic_Sern

See that works but it doesnt check all the time only when i log on and offline

hmm..timeout? :|

Ethic_Sern 04-08-2003 02:10 AM

Quote:

Originally posted by osrs


hmm..timeout? :|

hmmmm NO
PS suggested
if (playerenters){
this.len = strlen(#F);
setstring this.level,#e(this.len-3,this.len,#F);
if (strequals(#s(this.level),.graal)){
graal();
}
if (strequals(#s(this.level),.nw)){
nw();
}
}

function graal(){
}
function nw(){

}
but this dont work

Tseng 04-08-2003 02:18 AM

It's:

if (strcontains(partstr,str)) {
//Stuff
}

Python523 04-08-2003 02:21 AM

you want to check for the level extention?

i=indexof(.,#L);
setstring this.levelextention,#e(i,-1,#L);
i believe

Knuckles 04-08-2003 02:30 AM

...dude...

NPC Code:

if(indexof(.nw,#L) > -1) setplayerprop #c,This level's extension is '.nw'.;
else setplayerprop #c,This level's extension is '.graal'.;



I belive #L is for player level, and #F is for the NPC's level.

Ethic_Sern 04-08-2003 02:34 AM

NvM i got it to work the problem issss finding out where to put in. In the weapon it dont work, in the control NPC it dont work it only works in if the npc is in the level it dont work for all levels .
ex i warpto 30 30 bob.graal (where the NPC is ) and it works
i reset the flags and warpto 30 30 bob2.graal and it dont work.

Any ideas????

Python523 04-08-2003 08:27 AM

Quote:

Originally posted by Knuckles
...dude...

NPC Code:

if(indexof(.nw,#L) > -1) setplayerprop #c,This level's extension is '.nw'.;
else setplayerprop #c,This level's extension is '.graal'.;



I belive #L is for player level, and #F is for the NPC's level.

#F is used in with statements, if i had an npc

with(getplayer(Knuckles)) sendtorc #L;
it would send the NPCs level to rc, but if I did
with(getplayer(Knuckles)) sendtorc #F;
it would send the level that the account knuckles is in to rc

Knuckles 04-08-2003 08:43 AM

Ahh, I see..

Loriel 04-08-2003 06:33 PM

I wonder what that original poster was trying to do.

HoudiniMan 04-08-2003 07:42 PM

Quote:

Originally posted by Loriel
I wonder what that original poster was trying to do.
They seem to be full of solutions to a question i didn't see... maybe he edited it?

Knuckles 04-08-2003 09:33 PM

...We all interpret some things diffrently =o.

Ethic_Sern 04-08-2003 10:30 PM

ITS MY B-DAY!!!!!

I am tring to get this to work EVERY time you enter a level.
if (playerenters){
this.len = strlen(#F);
setstring this.level,#e(this.len-3,this.len,#F);
if (strequals(#s(this.level),aal)){
addweapon -GUI;
removeweapon *GUI;
}
if (strequals(#s(this.level),.nw)){
addweapon *GUI;
removeweapon -GUI;
}
}

Right now its in the control NPC but it only works when i log on and off and i tried timeout loops in the System Weapon but it still doesnt work.
Any Ideas?

Ethic_Sern 04-08-2003 10:53 PM

NVM i fixed it
if(created||timeout){
for(i=0;i<allplayerscount;i++) {
with(allplayers[i]) {
this.len = strlen(#F);
setstring this.level,#e(this.len-3,this.len,#F);
if (strequals(#s(this.level),aal)){
addweapon -GUI;
removeweapon *GUI;
}
if (strequals(#s(this.level),.nw)){
addweapon *GUI;
removeweapon -GUI;
}
}
}
timeout=1;
}

And i added it as an NPC then reset it and BAM it works

Python523 04-08-2003 11:21 PM

use code brackets x.x and that's completelly useless, plus if the player is on a gmap his level shows up as the gmap's serverside, what's so different about the levels that you need to use two different GUIs?

Ethic_Sern 04-09-2003 02:14 AM

Its for Bravo ....... we made 2 servers on 1. Gold and Classic.

HoudiniMan 04-09-2003 06:11 AM

Quote:

Originally posted by Ethic_Sern
Its for Bravo ....... we made 2 servers on 1. Gold and Classic.
That will never work

Ethic_Sern 04-09-2003 10:36 PM

Quote:

Originally posted by HoudiniMan


That will never work

.... Hmm TOO BAD it already has 0_o

Jeff 04-09-2003 11:06 PM

The problem with many of you playerworld types is that you count your chickens before they hatch.

Python523 04-09-2003 11:14 PM

Quote:

Originally posted by Ethic_Sern

.... Hmm TOO BAD it already has 0_o

why bother with two weapons, your serverside checks are inefficent and it would be much better if all of this was done clientside (the guis not working if you are in a .graal level or so)

Ethic_Sern 04-11-2003 01:27 AM

Quote:

Originally posted by Python523

why bother with two weapons, your serverside checks are inefficent and it would be much better if all of this was done clientside (the guis not working if you are in a .graal level or so)

wts are you talking about .... go on Bravo Online and see for your self .....


All times are GMT +2. The time now is 12:43 AM.

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