Jump to content

Nametag images||Class system


yoya99

Recommended Posts

hi there i have a problem ..i want to draw images next to the nametags for admin,moderators and normal players.... i have this files but it is not working...i tried all but i didnt found a solution....pls help me ...thx in advance :?

basic.lua.

function showImage() 
dxDrawImage() 
  
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Everyone" ) ) then 
dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "player.png" ) 
                      end 
  
  
  
 if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "admin.png" ) 
                      end 
  
  
 if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Moderator" ) ) then 
dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "moderator.png" ) 
                      end 
  
  
 if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then 
  
dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "vip.png" ) 
                      end 
end 
addEventHandler("onClientResourceStart", resourceRoot, function() addEventHandler("onClientRender", root, showImage) end) 

and that one:

function setDataOnLogin() 
    if not isGuestAccount(getPlayerAccount(source)) and isObjectInACLGroup("user."..getAccountName(source), aclGetGroup("Console")) then 
        setElementData(source, "showImage", true) 
    end 
end 
addEventHandler("onPlayerLogin", root, setDataOnLogin) 
  
function setDataOnResourceStart() 
    for i, v in ipairs(getElementsByType("player")) do 
        if not isGuestAccount(getPlayerAccount(v)) and isObjectInACLGroup("user."..getAccountName(v), aclGetGroup("Console")) then 
            setElementData(v, "showImage", true) 
        end 
    end 
end 
addEventHandler("onResourceStart", resourceRoot, setDataOnResourceStart) 
  

Link to comment
--- I HAVE NOT TRIED.

server.lua

  
  
function setDataOnLogin() 
     if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount( source )),aclGetGroup ( "Console" )) then 
        setElementData(source, "showImage", true) 
    end 
end 
addEventHandler("onPlayerLogin", root, setDataOnLogin) 
  
function setDataOnResourceStart() 
    for i, v in ipairs(getElementsByType("player")) do 
     if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount ( v )), aclGetGroup ( "Console" )) then 
            setElementData(v, "showImage", true) 
        end 
    end 
end 
addEventHandler("onResourceStart", resourceRoot, setDataOnResourceStart) 
  
function removeDataOnLogout() 
        setElementData(source, "showImage", false) 
end 
addEventHandler("onPlayerLogout", root, removeDataOnLogout) 
  

client.lua

function showImage() 
if getElementData(getLocalPlayer(), "showImage") then 
dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "vip.png" ) 
else 
dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "player.png" ) 
end 
end 
addEventHandler("onClientRender", root, showImage) 

Link to comment
I dont call that constructive help now.... If nobody can give me an normal answer then go pls away
isObjectInACLGroup 

is a server side function , you can't use on client side.

You have to use

triggerServerEvent 

Where is sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "vip.png" definied?

Done, i helped you. happy?

Link to comment

i did not steal it...how could i post it here?? Zares you compilingyour resources lollike everyone other too so how should i steal it??

Second: With the walking style and the Fighting style were my codes because nobody answered my topics you made a new topic and let users make it for you...If i would write to the community to bnlock your ip of server then you are done or?

Link to comment
i did not steal it...how could i post it here?? Zares you compilingyour resources lollike everyone other too so how should i steal it??

Second: With the walking style and the Fighting style were my codes because nobody answered my topics you made a new topic and let users make it for you...If i would write to the community to bnlock your ip of server then you are done or?

Lol my Nametags resources is not compiled + Fighting style i mad it my self ! no body answered me so i made it

+ idc stop stealing my codes , Any moderator Close this Topic

Link to comment
i did not steal it...how could i post it here?? Zares you compilingyour resources lollike everyone other too so how should i steal it??

Second: With the walking style and the Fighting style were my codes because nobody answered my topics you made a new topic and let users make it for you...If i would write to the community to bnlock your ip of server then you are done or?

Lol my Nametags resources is not compiled + Fighting style i mad it my self ! no body answered me so i made it

+ idc stop stealing my codes , Any moderator Close this Topic

You use dx functions on server side and you want i belive you? :|

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...