SetPickupVisibleForPlayers

From Onset Developer Wiki
Revision as of 21:43, 13 November 2019 by Kuzkay (talk | contribs) (Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|Set pickup visible only for a certain array of players}} {{FuncSyntax|StartPackage(PackageName)}} {{FuncParameters}} {{FuncPa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
SetPickupVisibleForPlayers

Type: Function
Context: Server
Introduced: v1.0

Description

Set pickup visible only for a certain array of players

Syntax

StartPackage(PackageName)

Parameters

  • Pickup
    ID of the pickup
  • Players
    Player list in a form of an array

Return Value

  • Returns true on success.

Example

function OnPackageStart()
   local pickup = CreatePickup(2, 1000, 5330, 1503)

   local players = {}
   for _, v in pairs(GetAllPlayers()) do
      if GetPlayerPropertyValue(v, 'team') == "zombie" then
         table.insert(players, v)
      end
   end
   
   SetPickupVisibleForPlayers(pickup, players)   

end
AddEvent('OnPackageStart', OnPackageStart)


See also

__EDIT_ME__