^Dev-PoinT^ Posted November 4, 2011 Share 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) Link to comment
Castillo Posted November 4, 2011 Share 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) Link to comment
Jaysds1 Posted November 4, 2011 Share Posted November 4, 2011 Are you sure you want to output all that info to everyone? Link to comment
^Dev-PoinT^ Posted November 4, 2011 Author Share Posted November 4, 2011 How To Make it onley For Admins Link to comment
Jaysds1 Posted November 4, 2011 Share 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) Link to comment
Castillo Posted November 4, 2011 Share 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 Link to comment
arezu Posted November 5, 2011 Share Posted November 5, 2011 since its server sided, getPlayerSerial needs the player element... so: getPlayerSerial(source) instead of getPlayerSerial() Link to comment
Castillo Posted November 5, 2011 Share Posted November 5, 2011 True, my mistake, corrected. Link to comment
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