From script, can you tell if mod is single player or running on server?
FinalStand
Member Posts: 87
From my scripts it would be helpful if I could determine if the module is running as single player or if it's multiplayer/server. Is there any way to determine that ?
If not with native script call, could this be done though 2da files? Maybe have 2da file on server? For single player it won't exist, but multiplayer you could have 'server, 1' or something? Does NWN let you have custom .2da files?
If not with native script call, could this be done though 2da files? Maybe have 2da file on server? For single player it won't exist, but multiplayer you could have 'server, 1' or something? Does NWN let you have custom .2da files?
0
Comments
// Get the public part of the CD Key that oPlayer used when logging in.
// - nSinglePlayerCDKey: If set to TRUE, the player's public CD Key will
// be returned when the player is playing in single player mode
// (otherwise returns an empty string in single player mode).
string GetPCPublicCDKey(object oPlayer, int nSinglePlayerCDKey=FALSE);
So, try:
int IsSinlgePlayer() { return GetPCPublicCDKey(GetFirstPC(), FALSE) == ""; }