Community Forum

FarmManager and Farm

Forum Overview >> Farming Simulator 17

CategoryFarming Simulator 17
Created08.01.2019 18:54

Unknown 08.01.2019 18:54

iam trying to determine if a player is farmanager of his farm in multiplayer or not.

Right now iam getting this error => dataS/scripts/farms/FarmManager.lua(273) : bad argument #1 to 'ipairs' (table expected, got nil)
While calling those functions in an if query => FarmManager:getFarmByUserId(g_currentMission.playerUserId):isUserFarmManager(g_currentMission.playerUserId)

Iam not really sure where i made the mistake.


// Edit should have mentioned that this question is for the FS 19

Espen K. (estyx) 08.01.2019 20:09
Got a function you can look at here:

So basically you just use following:
playerHasPermission(userId, 'manageRights')

'manageRights' is permission string for farm manager

Jos Kuijpers (Unknown) 09.01.2019 10:35
and your mistake was using FarmManager instead of g_farmManager, the instance.


Unknown 09.01.2019 18:08
Thank you both.
Now it works.

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