No categories assigned
LUA:GetFactionAmount
- Last edited 13 years ago by I need to Update My Profile
LUA Functions: GetFactionAmount()
Returns the current amount of faction the given spawn has with the given faction.
Syntax
var = GetFactionAmount(param1, param2)
Parameters
- Required - param1 (Spawn), param2 (int32)
- param1 is the player who we are checking for, must be a player
- param2 is the faction id we are checking
Usage
function hailed(NPC, Spawn)
-- Assume Test Faction has a faction id of 1
Say(NPC, "Your faction with Test Faction is " .. GetFactionAmount(Spawn, 1) .. "!")
end
This makes the NPC respond to the player with their faction with Test Faction (faction id 1).
Notes
Faction ID comes from the factions table in the DB.
The Faction ID used in the example is fake and only used for the example.