Community Forum

Local mode Single- or Multiplayer State

Forum Overview >> Scripting

CategoryScripting
Created21.08.2012 05:51


Dirk Buck (Unknown) 21.08.2012 05:55
Hello,

i need to know the way how i could get if the game is in a singlegame or the host or client in a multiplayer game.

I have tried something but it seems wrong.

This are some variables i have found

if not connection:getIsServer() then
print("Server Aktiv");
else
print("Client Aktiv");
end;

if self.isServer then print("Server Aktiv"); end;
if self.isClient then print("Server Aktiv"); end;


But there comes no output or some errors. Only with the g_server i have get some results, this is a very big array.


D. Ecker (Decker_MMIV) 23.08.2012 14:01
I'm not sure, but there are these variables, which is probably of use for you - they are located in the object: g_currentMission.missionDynamicInfo

autoAccept = false (boolean)
autoSave = false (boolean)
capacity = 2 (number)
isClient = false (boolean)
isMultiplayer = true (boolean)

So I guess what you're looking for, would be:

g_currentMission.missionDynamicInfo.isMultiplayer
g_currentMission.missionDynamicInfo.isClient

[edit 2012-08-23 16:11 CET]

http://forum.farming-simulator.com/viewtopic.php?f=448&t=36676&p=295867&hilit=isMultiplayer&sid=b7bb60c1563eee45b8a623a6f024b0a9#p295867

Dirk Buck (Unknown) 23.08.2012 23:21
One Big Thank to you.

This is the info i have searched for.

Fox


Note: Log in to post. Create a new account here.