You are viewing an old version of this page. Return to the latest version.
Version of 16:14, 28 August 2013 by I need to Update My Profile
Difference between revisions of "LUA:CompareSpawns"
(Created page with "= LUA Functions: AddHate() = Adds hate to ''param2'' from ''param1'' ==== Syntax ==== AddHate(param1, param2, param3) ==== Parameters ==== ; Required - ''param1'' (Spawn), ''...") |
|||
| Line 1: | Line 1: | ||
| − | = LUA Functions: | + | = LUA Functions: CompareSpawns() = |
| − | + | Compares the given spawns | |
==== Syntax ==== | ==== Syntax ==== | ||
| − | + | CompareSpawns(param1, param2) | |
==== Parameters ==== | ==== Parameters ==== | ||
| − | ; Required - ''param1'' (Spawn), ''param2'' (Spawn | + | ; Required - ''param1'' (Spawn), ''param2'' (Spawn) |
| − | : ''param1'' is the spawn | + | : ''param1'' is the first spawn to compare |
| − | : ''param2'' is the spawn | + | : ''param2'' is the second spawn to compare |
| − | |||
==== Usage ==== | ==== Usage ==== | ||
<pre> | <pre> | ||
| − | function | + | function hailed(NPC, Spawn) |
| − | + | local target = GetTarget(NPC) | |
| − | + | if target ~= nil and CompareSpawns(target, Spawn) then | |
| + | Say(NPC, "I have you targeted") | ||
| + | end | ||
end | end | ||
</pre> | </pre> | ||
| − | This is | + | This will have the spawn say whether the player who hailed it is also its target |
== Notes == | == Notes == | ||
| − | + | Returns a bool, true if the spawns are the same. | |
Latest revision as of 17:32, 28 August 2013
LUA Functions: CompareSpawns()
Compares the given spawns
Syntax
CompareSpawns(param1, param2)
Parameters
- Required - param1 (Spawn), param2 (Spawn)
- param1 is the first spawn to compare
- param2 is the second spawn to compare
Usage
function hailed(NPC, Spawn)
local target = GetTarget(NPC)
if target ~= nil and CompareSpawns(target, Spawn) then
Say(NPC, "I have you targeted")
end
end
This will have the spawn say whether the player who hailed it is also its target
Notes
Returns a bool, true if the spawns are the same.