LUA:SetRequiredHistory
- Last edited 9 years ago by I need to Update My Profile
LUA Functions: SetRequiredHistory()
Required a player to have a Lua history entry set as a certain data value for access to this spawn.
Syntax
SetRequiredHistory(param1, param2, param3, [param4], [param5], [param6])
Parameters
- Required - param1 (Spawn), param2 (int32), param3 (int32)
- param1 is the spawn we want to set
- param2 is the event ID that is required
- param3 is the history value1 that is required
- Optional - param4 (int32), param5 (int8), param6 (int16)
- param4 is the history value2 that is required
- param5 sets a spawn as private when the player does not meet history reqs, grants access when they do. Set as 1 if used.
- param6 vis_flags override value to be used while a player does not meet history reqs, uses vis_flags as normal when they do.
Usage
function spawn(Spawn)
SetRequiredHistory(Spawn, 1234, 5, 0, 1, 0)
end
This sets spawn access requirements for a spawn. Both value 1 and value 2 must match and the player must have this history entry. When a player does not meet spawn access requirements, no vis flags will be sent for the spawn to that player. This disables use of the spawn (cannot target, use commands) but allows the player to still see the spawn. Using the private_spawn param (5) hides this spawn completely from the player. If you only want certain flags to be sent while a player does not have access to the spawn use the vis_flags override (param6). Notes on this below.
Notes
To calculate the values for vis flags, use the base values of (attackable = +64), (show_level = +32), (show_name = +16), (targetable = +4), (show_command_icon = +2). Add the sum of all the values you wish to be activated. For instance to have just show_name and targetable, use 20 as the value (4+16).