01-21-2016, 03:52 AM
Pages: 1 2
03-16-2025, 10:36 PM
In API: SetSignLines(BlockX,BlockY,BlockZ,Line1,Line2,Line3,Line4,Player)
if isset "Player" then i get error "to many arguments".
if there is no "player", the function works fine, but my another function not work...
if i place sign with "[stats]" in first line, all work, but i klick on sign, function "OnSignUpdate" not getting "Player" and send error.
if i added "Player" in function "SetSignLines", i get error "to many arguments" in function "SetSignLines"...
How do?
my code:
if isset "Player" then i get error "to many arguments".
if there is no "player", the function works fine, but my another function not work...
if i place sign with "[stats]" in first line, all work, but i klick on sign, function "OnSignUpdate" not getting "Player" and send error.
if i added "Player" in function "SetSignLines", i get error "to many arguments" in function "SetSignLines"...
How do?
my code:
Code:
function OnSignUpdate(World, BlockX, BlockY, BlockZ, Line1, Line2, Line3, Line4, Player)
if(string.find(string.lower(Line1),'%[stats%]') ~= nil)then
local Statistics = Player:GetStatistics()
local mobKills = Statistics.Custom[CustomStatistic.MobKills]
return false, Line1, Player:GetName(), mobKills , Line4
end
end
function OnPlayerRightClick(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ)
local World = Player:GetWorld()
if(World:GetBlock(Vector3i(BlockX, BlockY, BlockZ)) == E_BLOCK_WALLSIGN)then
local IsValid, Line1, Line2, Line3, Line4 = World:GetSignLines(BlockX, BlockY, BlockZ)
if(string.find(string.lower(Line1),'%[stats%]') ~= nil)then
local Statistics = Player:GetStatistics()
local mobKills = Statistics.Custom[CustomStatistic.MobKills]
World:SetSignLines(BlockX, BlockY, BlockZ, Line1, Line2, mobKills, Line4)
end
end
return false
end
Pages: 1 2