Jump to content

What's wrong with....


Recommended Posts

ListSerial = { 
[1] = { 'D959022732DB64516435467F3D1BF5F4' }, -- Sojn 
[2] = { 'A5331B0D0A5919DBA1C19B1A278E68D4' }, -- d7om 
[3] = { '1715B68D93F4CDF04BAA065F5D4D14B2' }, -- Me 
[4] = { '2D7A67D844738FEA7562CEDBE812A3E2' } -- Mizo 
} 
  
  
addEventHandler('onResourceStart', root, 
function ( ) 
    if getPlayerSerial( source ) == ListSerial[1] then 
    setPlayerNametagText ( source, "سوجن" ) 
    setPlayerNametagColor ( source, 255, 0, 0 ) 
    elseif getPlayerSerial( source ) == ListSerial[2] then 
    setPlayerNametagText ( source, "دحومي" ) 
    setPlayerNametagColor ( source, 255, 0, 0 ) 
    elseif getPlayerSerial( source ) == ListSerial[3] then 
    setPlayerNametagText ( source, "عازف" ) 
    setPlayerNametagColor ( source, 255, 0, 0 ) 
    elseif getPlayerSerial( source ) == ListSerial[4] then 
    setPlayerNametagText ( source, "ميزو" ) 
    setPlayerNametagColor ( source, 255, 0, 0 ) 
    end 
end) 

I want for those serials have a red nametag with arabic nametag too.

the debug says the 'player' in getPlayerSerial() is bad pointer.

Link to comment
  • Moderators
local ListSerial = { 
    ["D959022732DB64516435467F3D1BF5F4"]=true, -- Sojn 
    ["A5331B0D0A5919DBA1C19B1A278E68D4"]=true, -- d7om 
    ["1715B68D93F4CDF04BAA065F5D4D14B2"}=true, -- Me 
    ["2D7A67D844738FEA7562CEDBE812A3E2"]=true -- Mizo 
} 
  
addEventHandler('onPlayerJoin', root, 
function ( ) 
    if ListSerial[getPlayerSerial( source )] then 
        setPlayerNametagText ( source, "????" ) 
        setPlayerNametagColor ( source, 255, 0, 0 ) 
    end 
end) 

Link to comment
local ListSerial = { 
    ["D959022732DB64516435467F3D1BF5F4"]=true, -- Sojn 
    ["A5331B0D0A5919DBA1C19B1A278E68D4"]=true, -- d7om 
    ["1715B68D93F4CDF04BAA065F5D4D14B2"}=true, -- Me 
    ["2D7A67D844738FEA7562CEDBE812A3E2"]=true -- Mizo 
} 
  
addEventHandler('onPlayerJoin', root, 
function ( ) 
    if ListSerial[getPlayerSerial( source )] then 
        setPlayerNametagText ( source, "????" ) 
        setPlayerNametagColor ( source, 255, 0, 0 ) 
    end 
end) 

No, i want each serial have a difference text in nametag

Link to comment
  • Moderators
local ListSerial = { 
    ["D959022732DB64516435467F3D1BF5F4"]="Sojn", --  
    ["A5331B0D0A5919DBA1C19B1A278E68D4"]="d7om", --  
    ["1715B68D93F4CDF04BAA065F5D4D14B2"]="iMr.3a[Z]eF", 
    ["2D7A67D844738FEA7562CEDBE812A3E2"]="Mizo" 
} 
  
addEventHandler('onPlayerJoin', root, 
function ( ) 
    local serialData = ListSerial[getPlayerSerial( source )]  
    if serialData then 
        setPlayerNametagText ( source, serialData ) 
        setPlayerNametagColor ( source, 255, 0, 0 ) 
    end 
end) 

Edited by Guest
Link to comment
  • Moderators

It seems there is no problem.

But maybe you can better use setPlayerName instead of setPlayerNametagText .

https://wiki.multitheftauto.com/wiki/SetPlayerName

local ListSerial = { 
    ["D959022732DB64516435467F3D1BF5F4"]="Sojn",  
    ["A5331B0D0A5919DBA1C19B1A278E68D4"]="d7om",  
    ["C57CA400888FD05D058D04571B4FA912"]="iMr.3a[Z]eF", 
    ["2D7A67D844738FEA7562CEDBE812A3E2"]="Mizo" 
} 
  
addEventHandler('onPlayerJoin', root, 
function ( ) 
    local serialData = ListSerial[getPlayerSerial( source )]  
    if serialData then 
        setPlayerName ( source, serialData) 
        setPlayerNametagColor ( source, 255, 0, 0 ) 
    end 
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...