Pivity

Repair kit in f4 menu when nobody is on the mecanic job

Last read Never
#1

Hi everyone ! All is in the title :p


I d'ont know how to do.

When the job of mecanic is empty i search to set automaticly the possibility to buy a repair kit in the f4 menu

Dumb x 2
#2

Thanks you to read ! :)

#3

customCheck = function() return #team.GetPlayers(TEAM_MECHANICS) == 0 end

replace "TEAM_MECHANICS" with whatever you set your team to

Agree x 1
#4

The solution posted above should work just fine. There is a function specifically for this however, that uses #team.GetPlayers internally:

https://wiki.facepunch.com/gmod/team.NumPlayers

customCheck = function() return (team.NumPlayers(TEAM_MECHANICS) == 0); end;

This function is not any faster performance wise, but it does provide more detail at glance.

#5

Whoops, forgot about that function xD

Users viewing this thread
Nobody