Jump to content

Help pls


*FuN

Recommended Posts

In resources joinquit,killmessages use this function:

_getPlayerName = getPlayerName 
function getPlayerName( el ) 
    if isElement( el ) then 
        local name = _getPlayerName( el ) 
        if name then 
            return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name 
        end 
        return false     
    end 
    return false 
end 

Example

  
_getPlayerName = getPlayerName 
function getPlayerName( el ) 
    if isElement( el ) then 
        local name = _getPlayerName( el ) 
        if name then 
            return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name 
        end 
        return false     
    end 
    return false 
end 
  
-- .... code 
  

Example resource joinquit:

joinquit.lua

  
g_Root = getRootElement() 
_getPlayerName = getPlayerName 
function getPlayerName( el ) 
    if isElement( el ) then 
        local name = _getPlayerName( el ) 
        if name then 
            return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name 
        end 
        return false     
    end 
    return false 
end 
  
addEventHandler('onClientPlayerJoin', g_Root, 
    function() 
        outputChatBox('* ' .. getPlayerName(source) .. ' has joined the game', 255, 100, 100) 
    end 
) 
  
addEventHandler('onClientPlayerChangeNick', g_Root, 
    function(oldNick, newNick) 
        outputChatBox('* ' .. oldNick .. ' is now known as ' .. newNick, 255, 100, 100) 
    end 
) 
  
addEventHandler('onClientPlayerQuit', g_Root, 
    function(reason) 
        outputChatBox('* ' .. getPlayerName(source) .. ' has left the game [' .. reason .. ']', 255, 100, 100) 
    end 
) 
  

Link to comment
In resources joinquit,killmessages use this function:
_getPlayerName = getPlayerName 
function getPlayerName( el ) 
    if isElement( el ) then 
        local name = _getPlayerName( el ) 
        if name then 
            return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name 
        end 
        return false     
    end 
    return false 
end 

Example

  
_getPlayerName = getPlayerName 
function getPlayerName( el ) 
    if isElement( el ) then 
        local name = _getPlayerName( el ) 
        if name then 
            return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name 
        end 
        return false     
    end 
    return false 
end 
  
-- .... code 
  

In joinquit what file i have replace??

Link to comment

Find file joinquit.lua in resource joinquit.

Open and replace with this:

  
g_Root = getRootElement() 
_getPlayerName = getPlayerName 
function getPlayerName( el ) 
    if isElement( el ) then 
        local name = _getPlayerName( el ) 
        if name then 
            return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name 
        end 
        return false     
    end 
    return false 
end 
  
addEventHandler('onClientPlayerJoin', g_Root, 
    function() 
        outputChatBox('* ' .. getPlayerName(source) .. ' has joined the game', 255, 100, 100) 
    end 
) 
  
addEventHandler('onClientPlayerChangeNick', g_Root, 
    function(oldNick, newNick) 
        outputChatBox('* ' .. oldNick .. ' is now known as ' .. newNick, 255, 100, 100) 
    end 
) 
  
addEventHandler('onClientPlayerQuit', g_Root, 
    function(reason) 
        outputChatBox('* ' .. getPlayerName(source) .. ' has left the game [' .. reason .. ']', 255, 100, 100) 
    end 
) 
  

In other resources paste this:

_getPlayerName = getPlayerName 
function getPlayerName( el ) 
    if isElement( el ) then 
        local name = _getPlayerName( el ) 
        if name then 
            return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name 
        end 
        return false     
    end 
    return false 
end 

Upper code.

Link to comment

Paste the code it up.

_getPlayerName = getPlayerName 
function getPlayerName( el ) 
    if isElement( el ) then 
        local name = _getPlayerName( el ) 
        if name then 
            return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name 
        end 
        return false     
    end 
    return false 
end 

Edited by Guest
Link to comment
Paste it up code.
_getPlayerName = getPlayerName 
function getPlayerName( el ) 
    if isElement( el ) then 
        local name = _getPlayerName( el ) 
        if name then 
            return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name 
        end 
        return false     
    end 
    return false 
end 

But where? xD

Link to comment
In script files resource.

Sorry , but i'm not understand :/

Open folder:mta_folder/server/mods/deathmatch/

Find resource killmessages.zip

Open it for example with winrar.

Open script files for example with notepad++ : killmessages_client.lua/killmessages_server.lua ( lua expansion )

And paste it:

_getPlayerName = getPlayerName 
function getPlayerName( el ) 
    if isElement( el ) then 
        local name = _getPlayerName( el ) 
        if name then 
            return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name 
        end 
        return false     
    end 
    return false 
end 

At the top of the script file.

Link to comment
In script files resource.

Sorry , but i'm not understand :/

Open folder:mta_folder/server/mods/deathmatch/

Find resource killmessages.zip

Open it for example with winrar.

Open script files for example with notepad++ : killmessages_client.lua/killmessages_server.lua ( lua expansion )

And paste it:

_getPlayerName = getPlayerName 
function getPlayerName( el ) 
    if isElement( el ) then 
        local name = _getPlayerName( el ) 
        if name then 
            return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name 
        end 
        return false     
    end 
    return false 
end 

At the top of the script file.

thankz

Link to comment

No problem.

Do the same but with a resource joinquit.

Open folder:mta_folder/server/mods/deathmatch/

Find resource joinquit.zip

Open it for example with winrar.

Open script files for example with notepad++ : joinquit.lua ( lua expansion )

And paste it:

_getPlayerName = getPlayerName 
function getPlayerName( el ) 
    if isElement( el ) then 
        local name = _getPlayerName( el ) 
        if name then 
            return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name 
        end 
        return false     
    end 
    return false 
end 

At the top of the script file.

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