CharlesHudson
Just alive, or just breathing...
- Joined
- Oct 25, 2011
- Messages
- 98
- Reaction score
- 14
Hey everybody Good night i want to request how to add VIP on look players like
Or
As i know that can be added on event/scripts/player.lua
This is my version
This is my version: VIP System [The Forgotten Server 1.0]
PLX HELP :c
Code:
You see Arthas. He is a Master Sorcerer
He is a VIP player
Code:
You see Arthas. He is a Master Sorcerer
He is not a VIP player
This is my version
Lua:
-- Internal Use
STONE_SKIN_AMULET = 2197
ITEM_STORE_INBOX = 26052
GOLD_POUNCH = 26377
-- No move items with actionID 8000
NOT_MOVEABLE_ACTION = 8000
-- Players cannot throw items on teleports if set to true
local blockTeleportTrashing = true
local titles = {
{storageID = 14960, title = " Scout"},
{storageID = 14961, title = " Sentinel"},
{storageID = 14962, title = " Steward"},
{storageID = 14963, title = " Warden"},
{storageID = 14964, title = " Squire"},
{storageID = 14965, title = " Warrior"},
{storageID = 14966, title = " Keeper"},
{storageID = 14967, title = " Guardian"},
{storageID = 14968, title = " Sage"},
{storageID = 14969, title = " Tutor"},
{storageID = 14970, title = " Senior Tutor"},
{storageID = 14971, title = " King"},
}
local function getTitle(uid)
local player = Player(uid)
if not player then return false end
for i = #titles, 1, -1 do
if player:getStorageValue(titles[i].storageID) == 1 then
return titles[i].title
end
end
return false
end
function Player:onBrowseField(position)
return true
end
local function getHours(seconds)
return math.floor((seconds/60)/60)
end
local function getMinutes(seconds)
return math.floor(seconds/60)
end
local function getTime(seconds)
local hours, minutes = getHours(seconds), getMinutes(seconds)
if (minutes > 59) then
minutes = minutes-hours*60
end
if (minutes < 10) then
minutes = "0" ..minutes
end
return hours..":"..minutes.. "h"
end
function Player:onLook(thing, position, distance)
local description = "You see "
if thing:isItem() then
if thing.actionid == 5640 then
description = description .. "a honeyflower patch."
elseif thing.actionid == 5641 then
description = description .. "a banana palm."
elseif thing.itemid >= ITEM_HEALTH_CASK_START and thing.itemid <= ITEM_HEALTH_CASK_END
or thing.itemid >= ITEM_MANA_CASK_START and thing.itemid <= ITEM_MANA_CASK_END
or thing.itemid >= ITEM_SPIRIT_CASK_START and thing.itemid <= ITEM_SPIRIT_CASK_END
or thing.itemid >= ITEM_KEG_START and thing.itemid <= ITEM_KEG_END then
description = description .. thing:getDescription(distance)
local charges = thing:getCharges()
if charges then
description = string.format("%s\nIt has %d refillings left.", description, charges)
end
else
description = description .. thing:getDescription(distance)
end
local itemType = thing:getType()
if (itemType and itemType:getImbuingSlots() > 0) then
local imbuingSlots = "Imbuements: ("
for i = 1, itemType:getImbuingSlots() do
local specialAttr = thing:getSpecialAttribute(i)
local time = 0
if (thing:getSpecialAttribute(i+3)) then
time = getTime(thing:getSpecialAttribute(i+3))
end
if (specialAttr and specialAttr ~= 0) then
if (i ~= itemType:getImbuingSlots()) then
imbuingSlots = imbuingSlots.. "" ..specialAttr.." " ..time..", "
else
imbuingSlots = imbuingSlots.. "" ..specialAttr.." " ..time..")."
end
else
if (i ~= itemType:getImbuingSlots()) then
imbuingSlots = imbuingSlots.. "Empty Slot, "
else
imbuingSlots = imbuingSlots.. "Empty Slot)."
end
end
end
description = string.gsub(description, "It weighs", imbuingSlots.. "\nIt weighs")
end
else
description = description .. thing:getDescription(distance)
end
if self:getGroup():getAccess() then
if thing:isItem() then
description = string.format("%s\nItem ID: %d", description, thing:getId())
local actionId = thing:getActionId()
if actionId ~= 0 then
description = string.format("%s, Action ID: %d", description, actionId)
end
local uniqueId = thing:getAttribute(ITEM_ATTRIBUTE_UNIQUEID)
if uniqueId > 0 and uniqueId < 65536 then
description = string.format("%s, Unique ID: %d", description, uniqueId)
end
local itemType = thing:getType()
local transformEquipId = itemType:getTransformEquipId()
local transformDeEquipId = itemType:getTransformDeEquipId()
if transformEquipId ~= 0 then
description = string.format("%s\nTransforms to: %d (onEquip)", description, transformEquipId)
elseif transformDeEquipId ~= 0 then
description = string.format("%s\nTransforms to: %d (onDeEquip)", description, transformDeEquipId)
end
local decayId = itemType:getDecayId()
if decayId ~= -1 then
description = string.format("%s\nDecays to: %d", description, decayId)
end
elseif thing:isCreature() then
local str = "%s\nHealth: %d / %d"
if thing:isPlayer() and thing:getMaxMana() > 0 then
str = string.format("%s, Mana: %d / %d", str, thing:getMana(), thing:getMaxMana())
end
description = string.format(str, description, thing:getHealth(), thing:getMaxHealth()) .. "."
end
local position = thing:getPosition()
description = string.format(
"%s\nPosition: %d, %d, %d",
description, position.x, position.y, position.z
)
if thing:isCreature() then
if thing:isPlayer() then
description = string.format("%s\nIP: %s.", description, Game.convertIpToString(thing:getIp()))
end
end
end
self:sendTextMessage(MESSAGE_INFO_DESCR, description)
end
function Player:onLookInBattleList(creature, distance)
local description = "You see " .. creature:getDescription(distance)
if self:getGroup():getAccess() then
local str = "%s\nHealth: %d / %d"
if creature:isPlayer() and creature:getMaxMana() > 0 then
str = string.format("%s, Mana: %d / %d", str, creature:getMana(), creature:getMaxMana())
end
description = string.format(str, description, creature:getHealth(), creature:getMaxHealth()) .. "."
local position = creature:getPosition()
description = string.format(
"%s\nPosition: %d, %d, %d",
description, position.x, position.y, position.z
)
if creature:isPlayer() then
description = string.format("%s\nIP: %s", description, Game.convertIpToString(creature:getIp()))
end
end
self:sendTextMessage(MESSAGE_INFO_DESCR, description)
end
function Player:onLookInTrade(partner, item, distance)
self:sendTextMessage(MESSAGE_INFO_DESCR, "You see " .. item:getDescription(distance))
end
function Player:onLookInShop(itemType, count)
return true
end
local config = {
maxItemsPerSeconds = 1,
exhaustTime = 2000,
}
if not pushDelay then
pushDelay = { }
end
PLX HELP :c