^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) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Jaysds1 Posted November 4, 2011 Posted November 4, 2011 Are you sure you want to output all that info to everyone? My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
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) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
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 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
arezu Posted November 5, 2011 Posted November 5, 2011 since its server sided, getPlayerSerial needs the player element... so: getPlayerSerial(source) instead of getPlayerSerial()
Castillo Posted November 5, 2011 Posted November 5, 2011 True, my mistake, corrected. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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