READ THE RULES
0 Members and 1 Guest are viewing this topic.
function MyINFOArrival(tUser, sData) sCountryCode = IP2Country.GetCountryCode(tUser.sIP) if sCountryCode ~= nil then Core.SetUserValue(tUser, 2, sCountryCode.." "..Core.GetUserValue(tUser, 2)) -- 2 is sDescription endend
function UserConnected(tUser) sCountryCode = IP2Country.GetCountryCode(tUser.sIP) if sCountryCode ~= nil then if SetMan.GetBool(13) then -- 13 is Strip user description Core.SetUserValue(tUser, 2, sCountryCode.." "..Core.GetUserValue(tUser, 2), sCountryCode, true) -- 2 is sDescription else Core.SetUserValue(tUser, 2, sCountryCode.." "..Core.GetUserValue(tUser, 2), sCountryCode.." "..Core.GetUserValue(tUser, 2), true) -- 2 is sDescription end endend
So now my example script will add country code to user description on login permanently, script don't need to process MyINFO everytime is new one received...
however what you would need to do is keep a copy of the original *unmodified* myinfo string, then when ptokax receives a new myinfo from the user, if it is the same as the original -> do nothing, if it is different to the original -> re-call lua function.