GetNPCCount: Difference between revisions

From Onset Developer Wiki
No edit summary
28days (talk | contribs)
No edit summary
 
Line 1: Line 1:
{{Info|Function|Server & Client|1.0}}
{{Info|Function|Server & Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Get the number of spawned NPCs.}}


{{FuncSyntax|GetNPCCount()}}
{{FuncSyntax|GetNPCCount()}}
Line 8: Line 8:
{{FuncNoParam}}
{{FuncNoParam}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns the NPC count.}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua>
AddCommand("npc", function(playerid)
    AddPlayerChat(playerid, "Total NPC count: "..GetNPCCount()..".")
end)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
{{Template:NPCFunctions}}

Latest revision as of 13:35, 20 November 2019

GetNPCCount

Type: Function
Context: Server & Client
Introduced: v1.0

Description

Get the number of spawned NPCs.

Syntax

GetNPCCount()

Parameters

  • This function has no parameters.

Return Value

  • Returns the NPC count.

Example

AddCommand("npc", function(playerid)
    AddPlayerChat(playerid, "Total NPC count: "..GetNPCCount()..".")
end)

See also