Jump to content

help with making a script


berry7009

Recommended Posts

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

Link to comment
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 ?

Link to comment
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 .

Link to comment

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 xD

Link to comment
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 xD

function join() 
 outputChatBox("Welcome To My server please /register : [ .. getPlayerName(source) .. ]",root, 255, 0, 0,true) 
 end 
 addEventHandler("onPlayerJoin", root, join) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...