^Dev-PoinT^ Posted November 4, 2011 Posted November 4, 2011 Hi all i made this how to make it show the info onPlayerJoin function join ( ) local serial = getPlayerSerial() local hour, mins = getTime() local name = getPlayerName(source) local version = getPlayerVersion(source) local ip = getPlayerIP(source)
Castillo Posted November 4, 2011 Posted November 4, 2011 function join ( ) local serial = getPlayerSerial() local hour, mins = getTime() local name = getPlayerName(source) local version = getPlayerVersion(source) local ip = getPlayerIP(source) outputChatBox(tostring(name).."'s serial: ".. tostring(serial),getRootElement()) outputChatBox(tostring(name).."'s IP: ".. tostring(ip),getRootElement()) outputChatBox(tostring(name).."'s version: ".. tostring(version),getRootElement()) outputChatBox(tostring(hours)..":".. tostring(mins),getRootElement()) end addEventHandler("onPlayerJoin",root,join)
Jaysds1 Posted November 4, 2011 Posted November 4, 2011 Are you sure you want to output all that info to everyone?
Jaysds1 Posted November 4, 2011 Posted November 4, 2011 function join ( ) local admins = getTeamFromName("Admins") local serial = getPlayerSerial() local hour, mins = getTime() local name = getPlayerName(source) local version = getPlayerVersion(source) local ip = getPlayerIP(source) outputChatBox(tostring(name).."'s serial: ".. tostring(serial),admins ) outputChatBox(tostring(name).."'s IP: ".. tostring(ip),admins ) outputChatBox(tostring(name).."'s version: ".. tostring(version),admins ) outputChatBox(tostring(hours)..":".. tostring(mins),admins ) end addEventHandler("onPlayerJoin",root,join)
Castillo Posted November 4, 2011 Posted November 4, 2011 (edited) Jaysd, that would require a team called "Admins", what if he doesn't want it to work that way? function join ( ) local serial = getPlayerSerial(source) local hour, mins = getTime() local name = getPlayerName(source) local version = getPlayerVersion(source) local ip = getPlayerIP(source) for index, player in pairs(getElementsByType("player")) do local account = getPlayerAccount(player) if not account or isGuestAccount(account) then return end if isObjectInACLGroup("user."..getAccountName(account),aclGetGroup("Admin")) then outputChatBox(tostring(name).."'s serial: ".. tostring(serial),player) outputChatBox(tostring(name).."'s IP: ".. tostring(ip),player) outputChatBox(tostring(name).."'s version: ".. tostring(version),player) outputChatBox(tostring(hours)..":".. tostring(mins),player) end end end addEventHandler("onPlayerJoin",root,join) Edited November 5, 2011 by Guest
arezu Posted November 5, 2011 Posted November 5, 2011 since its server sided, getPlayerSerial needs the player element... so: getPlayerSerial(source) instead of getPlayerSerial()
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now