IsNPCStreamedIn: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|IsNPCStreamedIn(player, npc)}} {{FuncParameters}} {{FuncParam|player|__EDIT_ME__}} {{FuncParam|npc..." |
No edit summary |
||
Line 1: | Line 1: | ||
{{Info|Function|Server|1.0}} | {{Info|Function|Server|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Checks if stated NPC is streamed in for the player}} | ||
{{FuncSyntax|IsNPCStreamedIn(player, npc)}} | {{FuncSyntax|IsNPCStreamedIn(player, npc)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|player| | {{FuncParam|player|Player which you want to check}} | ||
{{FuncParam|npc| | {{FuncParam|npc|NPC which you want to check}} | ||
{{FuncReturnValue| | {{FuncReturnValue|boolean: true or false value}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
function npcCheck(player) | |||
local x, y, z = GetPlayerLocation(player) | |||
local npc = CreateNPC(1, x, y, z, 0) | |||
if IsNPCStreamedIn(player, npc) then | |||
AddPlayerChat('npc has been created and streamed in') | |||
end | |||
end | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
__EDIT_ME__ | __EDIT_ME__ |
Revision as of 18:21, 13 November 2019
Description
Checks if stated NPC is streamed in for the player
Syntax
IsNPCStreamedIn(player, npc)
Parameters
- player
Player which you want to check - npc
NPC which you want to check
Return Value
- boolean: true or false value
Example
function npcCheck(player)
local x, y, z = GetPlayerLocation(player)
local npc = CreateNPC(1, x, y, z, 0)
if IsNPCStreamedIn(player, npc) then
AddPlayerChat('npc has been created and streamed in')
end
end
See also
__EDIT_ME__