LPMuds.net
Lib Discussion => Dead Souls Support => Topic started by: SonyUSA on April 29, 2008, 05:59:39 pm
-
Hello, I tried to modify
if(this_player()->GetSleeping() > 0) {
if(verb != "wake") {
this_player()->eventPrint("You are asleep.");
return 1;
}
}
so that it was
if(this_player()->GetSleeping() > 0) {
if(verb != "wake", "sc", "status") {
this_player()->eventPrint("You are asleep.");
return 1;
}
}
but it didnt seem to like that... do i need to use the 'and' syntax or... ?
-
do i need to use the 'and' syntax
correct.
-Crat
-
Heh,
While Cratylus is correct, I think an example of the correct code would be useful. There are two ways that I know of that this can be done. First:
if(this_player()->GetSleeping() > 0) {
if( verb != "wake" && verb != "sc" && verb != "status") {
this_player()->eventPrint("You are asleep.");
return 1;
}
}
The second way I actually like better but it's personal preference, really.
if(this_player()->GetSleeping() > 0) {
if( member_array( verb, ({ "wake", "sc", "status" }) ) == -1 ) {
this_player()->eventPrint("You are asleep.");
return 1;
}
}
Both have the same results.
Daelas
-
Awesome, thanks :)