Jump to content

[HELP] Please


1LoL1

Recommended Posts

Please how to delete hex codes in name?

Here is script:

addEvent("onZombieWasted") 
addEventHandler( "onZombieWasted", getRootElement(), 
function (killer) 
killerName = getPlayerName(killer) 
weapon = getPedWeapon(killer) 
wr, wg, wb = getPlayerNametagColor(killer) 
exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=162,g=2,b=2},"Zombie"},getRootElement(),wr,wg,wb ) 
end) 

Please help me anyone.

i used :gsub but not work :(

Link to comment
  
addEvent("onZombieWasted") 
addEventHandler( "onZombieWasted", getRootElement(), 
function (killer) 
killerName = getPlayerName(killer):gsub( "#%x%x%x%x%x%x", "" ) 
weapon = getPedWeapon(killer) 
wr, wg, wb = getPlayerNametagColor(killer) 
exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=162,g=2,b=2},"Zombie"},getRootElement(),wr,wg,wb ) 
end) 
  

Link to comment
  
addEvent("onZombieWasted") 
addEventHandler( "onZombieWasted", getRootElement(), 
function (killer) 
killerName = getPlayerName(killer):gsub( "#%x%x%x%x%x%x", "" ) 
weapon = getPedWeapon(killer) 
wr, wg, wb = getPlayerNametagColor(killer) 
exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=162,g=2,b=2},"Zombie"},getRootElement(),wr,wg,wb ) 
end) 
  

Not work :(

SSRSSFSF.png

Link to comment
function checkColorCode() 
    for k, v in ipairs (getElementsByType("player")) do 
        local name = getPlayerName(v) 
            if (string.find(name,"#%x%x%x%x%x%x")) then 
                local name = string.gsub(name,"#%x%x%x%x%x%x","") 
                setPlayerName(v,name) 
                cancelEvent() 
            end 
    end 
end 
addEventHandler("onResourceStart",resourceRoot,checkColorCode) 

try to use the same code with and ;

addEventHandler("onPlayerJoin",getRootElement(),checkColorCode) 
addEventHandler("onPlayerChangeNick",getRootElement(),checkColorCode) 

and try to add oldNick , newNick.

Link to comment

Can you use here please?

addEvent("onZombieWasted") 
addEventHandler( "onZombieWasted", getRootElement(), 
function (killer) 
killerName = getPlayerName(killer) 
weapon = getPedWeapon(killer) 
wr, wg, wb = getPlayerNametagColor(killer) 
exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=162,g=2,b=2},"Zombie"},getRootElement(),wr,wg,wb ) 
end) 

Link to comment

Why do you need to loop all players when someone's join?

Can you use here please?
  
addEvent("onZombieWasted") 
addEventHandler( "onZombieWasted", getRootElement(), 
function (killer) 
killerName = getPlayerName(killer) 
killerName = string.gsub(killerName,"#%x%x%x%x%x%x","") 
killerName = string.gsub(killerName,"#%x%x%x%x%x%x","") 
weapon = getPedWeapon(killer) 
wr, wg, wb = getPlayerNametagColor(killer) 
exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=162,g=2,b=2},"Zombie"},getRootElement(),wr,wg,wb ) 
end) 
  

Link to comment

why u want to disable Hex code just when you kill Zombie disable it for all players i already gave you the solution.

-- Server side

-- On resource start

function checkColorCode() 
    for k, v in ipairs (getElementsByType("player")) do 
        local name = getPlayerName(v) 
            if (string.find(name,"#%x%x%x%x%x%x")) then 
                local name = string.gsub(name,"#%x%x%x%x%x%x","") 
                setPlayerName(v,name) 
                cancelEvent() 
            end 
    end 
end 
addEventHandler("onResourceStart",resourceRoot,checkColorCode) 

and you need to disable it on player join

function rCC(oldNick,newNickname) 
    local name = getPlayerName(source) 
    if newNickname then 
        name = newNickname 
    end 
    if (string.find(name,"#%x%x%x%x%x%x",1,false)) then 
        local name = string.gsub(name,"#%x%x%x%x%x%x","") 
        setPlayerName(source,name) 
            if (newNickname) then 
                cancelEvent() 
            end 
    end  
end 
addEventHandler("onPlayerJoin",getRootElement(),rCC) 

also you need to disable it when the player change his name onPlayerChangeNick

addEventHandler("onPlayerChangeNick",getRootElement(),rCC) 

Link to comment

You're blind dude...

  
  
addEvent("onZombieWasted") 
addEventHandler( "onZombieWasted", getRootElement(), 
function (killer) 
killerName = getPlayerName(killer) 
killerName = string.gsub(killerName,"#%x%x%x%x%x%x","") 
killerName = string.gsub(killerName,"#%x%x%x%x%x%x","") 
weapon = getPedWeapon(killer) 
wr, wg, wb = getPlayerNametagColor(killer) 
exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=162,g=2,b=2},"Zombie"},getRootElement(),wr,wg,wb ) 
end) 
  

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