SetSignLines does not work
#11
Wink 
(01-16-2016, 06:54 AM)xoft Wrote: Ahele, se stim smiř? Smile

Hus, jeď do Kosntice jim to vysvjetlitTongue
Reply
Thanks given by:
#12
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:
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
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)