Difference between revisions of "LUA:HasPendingLootItem"

(Created page with "= LUA Functions: HasPendingLootItem() = Checks to see if the given player has pending loot with the given entity ==== Syntax ==== var = HasPendingLootItem(param1, param2) ===...")
 
 
Line 1: Line 1:
 
= LUA Functions: HasPendingLootItem() =
 
= LUA Functions: HasPendingLootItem() =
Checks to see if the given player has pending loot with the given entity
+
Checks to see if the given player has pending item with the given entity
  
  
 
==== Syntax ====
 
==== Syntax ====
var = HasPendingLootItem(param1, param2)
+
var = HasPendingLootItem(param1, param2, param3)
  
  
 
==== Parameters ====
 
==== Parameters ====
; Required - ''param1'' (Spawn), ''param2'' (Spawn)
+
; Required - ''param1'' (Spawn), ''param2'' (Spawn), ''param3'' (int32)
 
: ''param1'' is the spawn we want to check
 
: ''param1'' is the spawn we want to check
 
: ''param2'' is the player we want to check
 
: ''param2'' is the player we want to check
 +
: ''param3'' is the item ID to check for
  
  
Line 16: Line 17:
 
<pre>
 
<pre>
 
function hailed(NPC, Spawn)
 
function hailed(NPC, Spawn)
     if HasPendingLootItem(NPC, Spawn) then
+
     if HasPendingLootItem(NPC, Spawn, 1) then
         Say(NPC, "You have pending loot with me")
+
         Say(NPC, "You have item 1 pending with me")
 
     end
 
     end
 
end
 
end
 
</pre>
 
</pre>
  
The NPC will respond if the player has pending loot with it
+
The NPC will respond if the player has item ID 1 pending with it
  
 
== Notes ==
 
== Notes ==
 
Returns a bool
 
Returns a bool

Latest revision as of 20:30, 11 September 2013

LUA Functions: HasPendingLootItem()

Checks to see if the given player has pending item with the given entity


Syntax

var = HasPendingLootItem(param1, param2, param3)


Parameters

Required - param1 (Spawn), param2 (Spawn), param3 (int32)
param1 is the spawn we want to check
param2 is the player we want to check
param3 is the item ID to check for


Usage

function hailed(NPC, Spawn)
    if HasPendingLootItem(NPC, Spawn, 1) then
        Say(NPC, "You have item 1 pending with me")
    end
end

The NPC will respond if the player has item ID 1 pending with it

Notes

Returns a bool