Graal Forums

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

SkooL 07-06-2001 12:28 PM

Sleeping...
 
NPC Code:
if (strequals(#m(sleep)&&||playersprite=38) {
showimg sleeping,emoticon_Zzz_stay.mng,playerx,playery-2;
}
if (!strequals(#m(sleep)&&||playersprite=38) {
hideimg sleeping;
}


Why do I get the error 'Error: Expected format: if (flag) command;'? It looks like the right format...=\

LiquidIce00 07-06-2001 01:49 PM

Re: Sleeping...
 
Quote:

Originally posted by SkooL
NPC Code:
if (strequals(#m(sleep)&&||playersprite=38) {
showimg sleeping,emoticon_Zzz_stay.mng,playerx,playery-2;
}
if (!strequals(#m(sleep)&&||playersprite=38) {
hideimg sleeping;
}


Why do I get the error 'Error: Expected format: if (flag) command;'? It looks like the right format...=\

'sleeping'
isnt an index
try showimg 300 instead..
index higher then 199 is only shown local..

grim_squeaker_x 07-06-2001 03:02 PM

Re: Sleeping...
 
Quote:

Originally posted by SkooL
NPC Code:
if (strequals(#m(sleep)&&||playersprite=38) {
showimg sleeping,emoticon_Zzz_stay.mng,playerx,playery-2;
}
if (!strequals(#m(sleep)&&||playersprite=38) {
hideimg sleeping;
}


Why do I get the error 'Error: Expected format: if (flag) command;'? It looks like the right format...=\

The second ( in your strequals check should be a , plus &&|| = &&0|| which means the script can never do anything.
Like this:
NPC Code:
if (playerenters||timeout) {
if (strequals(#m,sleep)||playersprite=38) showimg sleeping,emoticon_Zzz_stay.mng,playerx,player-2;
else hideimg sleeping;
timeout=0.05;
}


Although this would be the same as giving it an index of 0; since sleeping is a variable without a defined value it will default to 0.

SkooL 07-06-2001 08:08 PM

Re: Re: Sleeping...
 
Quote:

Originally posted by grim_squeaker_x
The second ( in your strequals check should be a , plus &&|| = &&0|| which means the script can never do anything.
Like this:
NPC Code:
if (playerenters||timeout) {
if (strequals(#m,sleep)||playersprite=38) showimg sleeping,emoticon_Zzz_stay.mng,playerx,player-2;
else hideimg sleeping;
timeout=0.05;
}


Although this would be the same as giving it an index of 0; since sleeping is a variable without a defined value it will default to 0.

Ok, it works now, thanks :)


All times are GMT +2. The time now is 02:27 AM.

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