logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
lifeless hackers are back - nwn highly vulnerable
Goto page Previous  1, 2
 
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
GAC



Joined: 01 Mar 2011
Posts: 7

PostPosted: Thu Mar 03, 2011 2:00    Post subject: Reply with quote

Sorry, but it won't compile, but then again it's been years since Abraxsis wrote this . . .

Abraxsis wrote:

Code:

1   // Added by Abraxsis Aug 04, 2008
2  // Is the speaker a DM?
3   object oPC = GetPCSpeaker( );
4   if( GetIsDM(oPC ) != TRUE ) {
5      object oPCTest = GetFirstPC( );
6      string sTestPCName = GetPCPlayerName( oPC);
7      int nFound = FALSE;
8      while( GetIsObjectValid( oPCTest) && ( ! nFound)) {
9         if( GetPCPlayerName( oPCTest) == sTestPCName) {
10           if( GetIsDM( oPCTest)) {
11             nFound = TRUE;
12          } else {
13             SendMessageToPC( oPC,"This is too much power for mere mortals!");
14              return FALSE;
15           }
16       }
17       oPCTest=GetNextPC( );
18    }
19  }
20  // End Is the speaker a DM?



Script1.nss (4): ERROR: INVALID DECLARATION TYPE
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Wed Mar 09, 2011 15:15    Post subject: Reply with quote

try this

Code:


1   // Added by Abraxsis Aug 04, 2008
2  // Is the speaker a DM?
3   object oPC = GetPCSpeaker( );
4   if(!GetIsDM(oPC)) {
5      object oPCTest = GetFirstPC( );
6      string sTestPCName = GetPCPlayerName( oPC);
7      int nFound = FALSE;
8      while( GetIsObjectValid( oPCTest) && ( ! nFound)) {
9         if( GetPCPlayerName( oPCTest) == sTestPCName) {
10           if( GetIsDM( oPCTest)) {
11             nFound = TRUE;
12          } else {
13             SendMessageToPC( oPC,"This is too much power for mere mortals!");
14              return FALSE;
15           }
16       }
17       oPCTest=GetNextPC( );
18    }
19  }
20  // End Is the speaker a DM?




Not entirely sure why it would be throwing up an error.

but for IF Statements where it is returning a true or false statement, you are able to shorten the statement by using the ! operator.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion All times are GMT + 2 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group