Jump to content

can i have someSmall Help in here


^Dev-PoinT^

Recommended Posts

Hi all see My Code

  
addEventHandler('onPlayerQuit', root, 
    function(reason) 
        outputChatBox('* ' .. getPlayerName(source) .. ' Has left the game [' .. reason .. ']',getRootElement(), 255, 0, 0) 
    end 
) 
  
function a () 
    local flag = call(getResourceFromName("admin"), "getPlayerCountry", source) 
    local ip = getPlayerIP( source ) 
    setElementData(source,"Country",flag) 
    outputChatBox(getPlayerName(source).."Has Join The Game From ["..flag..]..["..ip..]",root, 255,255,255) 
end 
addEventHandler("onPlayerJoin",getRootElement(),a) 

he say Dev-PoinT Has Join The Game From [sA127.0.0.1]

how Make it Dev-PoinT Has Join The Game From [sA] [ip Here]

i tryed but alwasy return false :(

Link to comment
  
addEventHandler('onPlayerQuit', root, 
    function(reason) 
        outputChatBox('* ' .. getPlayerName(source) .. ' Has left the game [' .. reason .. ']',getRootElement(), 255, 0, 0) 
    end 
) 
  
function a () 
    local flag = call(getResourceFromName("admin"), "getPlayerCountry", source) 
    local ip = getPlayerIP( source ) 
    setElementData(source,"Country",flag) 
    outputChatBox(getPlayerName(source).."Has Join The Game From"..flag..", IP: "..ip..,root, 255,255,255) 
end 
addEventHandler("onPlayerJoin",getRootElement(),a) 
  
  
  
  

Not tested.

EDIT:You didn't finished a string somewhere but i can't see where.(Give us some debug)

EDIT2:Now it should work.(probably)

Link to comment

This code is a bit wrong and can be made with less lines/characters.

 addEventHandler('onPlayerQuit', root, 
    function(reason) 
        outputChatBox('* ' .. getPlayerName(source) .. ' has left the game [' .. reason .. ']',root, 255, 0, 0) 
    end 
) 
  
function a () 
    local flag = exports.admin:getPlayerCountry ( source ) 
    setElementData(source,"Country",flag) 
    outputChatBox("* "..getPlayerName(source).." has joined the game from"..flag..", IP: "..tostring(getPlayerIP( source )),root, 255, 0, 0) 
end 
addEventHandler("onPlayerJoin",getRootElement(),a) 

Link to comment
addEventHandler('onPlayerQuit', root, 
    function(reason) 
        outputChatBox('* ' .. getPlayerName(source) .. ' has left the game [' .. reason .. ']',getRootElement(), 255, 0, 0) 
    end 
) 
  
function a () 
    local flag = exports.admin:getPlayerCountry ( source ) 
    setElementData(source,"Country",flag) 
    outputChatBox("* "..getPlayerName(source).." has joined the game from [".. tostring(flag) .."] [".. tostring(getPlayerIP( source )) .."]",getRootElement(), 255, 0, 0) 
end 
addEventHandler("onPlayerJoin",root,a) 

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...