berry7009 Posted February 14, 2013 Posted February 14, 2013 i want to make a script the says when a player connects Welcome "playerNickname" or "playerNickname" Comes from "country" i looked everywhere and i tried lots of times and couldn't make it ! please help
Shazzimal Posted February 14, 2013 Posted February 14, 2013 What you must contain in your script is the folowing: getPlayerName function() local localPlayerName = getPlayerName(getLocalPlayer()) --so we can use it for outputChatBox outputChatBox(localPlayerName) --for the thing to say end post the result so we can check it.
DNL291 Posted February 14, 2013 Posted February 14, 2013 (edited) exports["admin"]:getPlayerCountry(source) outputChatBox Event: onPlayerJoin Edited February 14, 2013 by Guest
iPrestege Posted February 14, 2013 Posted February 14, 2013 function join() local country = exports.admin:getPlayerCountry(source) or "N/A" outputChatBox("#00ffff* [ Join Server ] Name[#ffffff" .. getPlayerName(source) .. "#00ffff] Country[#ffffff" .. country .. "#00ffff]", root, 0, 0, 0, true) end addEventHandler("onPlayerJoin", root, join) Server Side
berry7009 Posted February 14, 2013 Author Posted February 14, 2013 What you must contain in your script is the folowing: getPlayerName function() local localPlayerName = getPlayerName(getLocalPlayer()) --so we can use it for outputChatBox outputChatBox(localPlayerName) --for the thing to say end post the result so we can check it. Didn't work function join() local country = exports.admin:getPlayerCountry(source) or "N/A" outputChatBox("#00ffff* [ Join Server ] Name[#ffffff" .. getPlayerName(source) .. "#00ffff] Country[#ffffff" .. country .. "#00ffff]", root, 0, 0, 0, true) end addEventHandler("onPlayerJoin", root, join) Server Side and if i want it without the country ?
iPrestege Posted February 14, 2013 Posted February 14, 2013 function join() outputChatBox("#00ffff* [ Join Server ] Name[#ffffff" .. getPlayerName(source) .. "#00ffff]", root, 0, 0, 0, true) end addEventHandler("onPlayerJoin", root, join) Server Side !
berry7009 Posted February 14, 2013 Author Posted February 14, 2013 why did you add #ffffff"? and el salam alyekeim
berry7009 Posted February 14, 2013 Author Posted February 14, 2013 (edited) just tested your script its awesome ! but i wanted it to say example: Welcome Mr.Pres[T]ege! also from where did you learn all that? i read most of MTA wiki and couldn't find that Edited February 14, 2013 by Guest
iPrestege Posted February 14, 2013 Posted February 14, 2013 just tested your script its awesome ! but i wanted it say example Welcome Mr.Pres[T]ege! also from where did you learn all that? i read most of MTA wiki and couldn't find that function join() outputChatBox("#00ffffWelcome : #ffffff" .. getPlayerName(source) .. "#00ffff !", root, 0, 0, 0, true) end addEventHandler("onPlayerJoin", root, join) You will learn with time .
berry7009 Posted February 14, 2013 Author Posted February 14, 2013 sorry for annoying you but if i want to remove the colors ? when i made it like this function join() outputChatBox("Welcome To My server please /register : [ .. getPlayerName(source) .. ], root, 0, 0, 0, true) end addEventHandler("onPlayerJoin", root, join) i got an error and yes my server name is my server
iPrestege Posted February 14, 2013 Posted February 14, 2013 sorry for annoying you but if i want to remove the colors ? when i made it like this function join() outputChatBox("Welcome To My server please /register : [ .. getPlayerName(source) .. ], root, 0, 0, 0, true) end addEventHandler("onPlayerJoin", root, join) i got an error and yes my server name is my server function join() outputChatBox("Welcome To My server please /register : [ .. getPlayerName(source) .. ]",root, 255, 0, 0,true) end addEventHandler("onPlayerJoin", root, join)
berry7009 Posted February 14, 2013 Author Posted February 14, 2013 (edited) why the 255 ? also it says Welcome To My server please /register : [ .. getPlayerName(source) .. ] when i log in. Not my name Edited February 14, 2013 by Guest
iPrestege Posted February 14, 2013 Posted February 14, 2013 Just To Show A Color Or You Want It Hide It Lool .
DNL291 Posted February 14, 2013 Posted February 14, 2013 function join() outputChatBox("Welcome To My server please /register : [" .. getPlayerName(source) .. "]", source, 0, 0, 0, true) end addEventHandler("onPlayerJoin", root, join)
berry7009 Posted February 14, 2013 Author Posted February 14, 2013 function join() outputChatBox("Welcome To My server please /register : [" .. getPlayerName(source) .. "]", source, 0, 0, 0, true) end addEventHandler("onPlayerJoin", root, join) " was missing thanks a lot !
iPrestege Posted February 14, 2013 Posted February 14, 2013 function join() outputChatBox("Welcome To My server please /register : [" .. getPlayerName(source) .. "]", source, 0, 0, 0, true) end addEventHandler("onPlayerJoin", root, join) " was missing thanks a lot ! Yes exactly.
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