papam77 Posted July 25, 2013 Share Posted July 25, 2013 Hello i have made this, but i need for players command /join CountryName How can do it? ----------------------------- -- Language Chat By DeeJay -- ----------------------------- function LanguageChat(thePlayer, cmd, ...) local msg = table.concat({...}, " ") for _,players in ipairs(getElementsByType("player")) do local r, g, b = getPlayerNametagColor (thePlayer) local name = getPlayerName(thePlayer) local mycountry = exports.admin:getPlayerCountry(thePlayer) local playerscountry = exports.admin:getPlayerCountry(players) if (playerscountry == mycountry) then if (msg and msg ~= "") then outputChatBox("#FF6464["..mycountry.."]#ffffff "..name..": #FFFFFF"..msg.."",players,r, g, b,true) end end end end addCommandHandler("Language",LanguageChat) addEventHandler("onPlayerJoin",root, function () bindKey(source,"L","down","chatbox","Language") end ) addEventHandler("onResourceStart",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do bindKey(player,"L","down","chatbox","Language") end end ) Link to comment
Castillo Posted July 25, 2013 Share Posted July 25, 2013 You'll have to modify that script to use element data or tables, or if he hasn't got any custom language set, to use his default language. Link to comment
papam77 Posted July 28, 2013 Author Share Posted July 28, 2013 How you mean to create tables? Give me an example please. Link to comment
iMr.3a[Z]eF Posted July 28, 2013 Share Posted July 28, 2013 An example for table local table = { [1] = 123,4567890, [2] = 0987,654321 } function a() for i,v in ipairs (position) do if isPlayerDead(source) then spawnPlayer(source, math.random([1],[2])) end end end addEventHandler("onPlayerWasted", getRootElement(), a) Link to comment
Castillo Posted July 28, 2013 Share Posted July 28, 2013 @iMr.3a[Z]eF: Would you please stop posting when you have ABSOLUTELY no idea? because most of your posts are like this one you've just made. @papam: http://lua-users.org/wiki/TablesTutorial 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