FapFap 13 Report post Posted August 31, 2018 Im having this errors at log/log/getshipid_err.txt: It keeps spamming alot in each sec Quote Share this post Link to post Share on other sites
mkhzaleh 131 Report post Posted September 1, 2018 you can find this inside Functions.lua Quote Share this post Link to post Share on other sites
Inuarashi 5 Report post Posted September 1, 2018 13 hours ago, FapFap said: Im having this errors at log/log/getshipid_err.txt: It keeps spamming alot in each sec that means that a function is calling this function each second (or a lot of times a second), try to search ur files for TurnToShip and see what function is triggering this function (example would be cha_timer) the log appears because x_role in this function is nil based on some function that is running it. it probably happens because you are using TurnToShip (role) function on something that doesnt require the character to be in a ship (so GetCtrlBoat is nil) and returning this message. Quote Share this post Link to post Share on other sites
FapFap 13 Report post Posted September 1, 2018 @Inuarashi this is the function on function.lua: function TurnToShip ( role ) local x_role = role if ChaIsBoat ( role ) == 0 then x_role = GetCtrlBoat ( role ) if x_role == nil then LG ( "getshipid_err" , " get a nil shipid " ) end end return x_role end and this is the hook-timer: -- Ship Fuel Fixed function ResumeFuel(cha) cha = TurnToShip(cha); if(ChaIsBoat(cha) == 1)then local boat = TurnToShip(cha) local fuel,mxfuel,fuelrec = GetChaAttr(boat, ATTR_SP),GetChaAttr(boat, ATTR_MXSP),GetChaAttr(boat, ATTR_SREC) local dura,mxdura,durarec = GetChaAttr(boat, ATTR_HP),GetChaAttr(boat, ATTR_MXHP),GetChaAttr(boat, ATTR_HREC) if(fuel <= 0)then if(dura > 0)then SystemNotice(boat, 'No more fuel! ['..GetChaDefaultName(boat)..'] is slowly getting damaged.') durarec = durarec - 0.025 * mxdura dura = math.min(mxdura, dura + durarec) SetCharaAttr(dura, boat, ATTR_HP) end if(dura <= 0)then return end else fuel = math.max(0, fuel - fuelrec) SetCharaAttr(fuel, boat, ATTR_SP) end end end ResumeHook = Resume Resume = function(role) ResumeHook(role) ResumeFuel(role) end Quote Share this post Link to post Share on other sites
Inuarashi 5 Report post Posted September 1, 2018 (edited) @FapFap what are you trying to do with this script? o.o anyways, try this, might work. function ResumeFuel(cha) local Cha_Boat = ChaIsBoat(cha) if Cha_Boat ~= 1 then return end local boat = TurnToShip(cha) local fuel,mxfuel,fuelrec = GetChaAttr(boat, ATTR_SP),GetChaAttr(boat, ATTR_MXSP),GetChaAttr(boat, ATTR_SREC) local dura,mxdura,durarec = GetChaAttr(boat, ATTR_HP),GetChaAttr(boat, ATTR_MXHP),GetChaAttr(boat, ATTR_HREC) if(fuel <= 0)then if(dura > 0)then SystemNotice(boat, 'No more fuel! ['..GetChaDefaultName(boat)..'] is slowly getting damaged.') durarec = durarec - 0.025 * mxdura dura = math.min(mxdura, dura + durarec) SetCharaAttr(dura, boat, ATTR_HP) end if(dura <= 0)then return end else fuel = math.max(0, fuel - fuelrec) SetCharaAttr(fuel, boat, ATTR_SP) end end end ResumeHook = Resume Resume = function(role) ResumeHook(role) ResumeFuel(role) end Edited September 1, 2018 by Inuarashi Quote Share this post Link to post Share on other sites
FapFap 13 Report post Posted September 1, 2018 @Inuarashi For the moment the error is not showing with this one, thanks i hope it wont appear anymore Quote Share this post Link to post Share on other sites