ZeyadGTX Posted September 24, 2014 Posted September 24, 2014 I would like to draw image for Console's Only if in Group ACL Console ! draws image for him next to nametag using that dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 1*scale, sy - imageSize, imageSize, imageSize, ":Admin/Image/Admin.png" ) My nick in MTA is Spider
Castillo Posted September 24, 2014 Posted September 24, 2014 You can use element data, set it when the player logs in if he's in the ACL group. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
#DRAGON!FIRE Posted September 24, 2014 Posted September 24, 2014 use "onResourceStart" with isObjectInACLGroup + setElementData and "onPlayerLogin" with isObjectInACLGroup + setElementData and don't forget isGuestAccount and Check in Client if player have the data and make your code . To Contact Me at Skype : [email protected]
ZeyadGTX Posted September 28, 2014 Author Posted September 28, 2014 can you explain by small script ? My nick in MTA is Spider
xeon17 Posted September 28, 2014 Posted September 28, 2014 can you explain by small script ? Every wiki page have a example.. A unique GangWar gamemode waiting for you!Click here for more information.
ZeyadGTX Posted September 28, 2014 Author Posted September 28, 2014 I tried and failed and i'm not pro scripter so i need help My nick in MTA is Spider
xeon17 Posted September 28, 2014 Posted September 28, 2014 I tried and failed and i'm not pro scripter so i need help Of course we can help you , but we won't create the script for you. If you tried then post your code. A unique GangWar gamemode waiting for you!Click here for more information.
ZeyadGTX Posted October 4, 2014 Author Posted October 4, 2014 HelHelp I tried that code not working 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, "player.png" ) end if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "player.png" ) end if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Warden" ) ) then dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "player.png" ) end My nick in MTA is Spider
Anubhav Posted October 4, 2014 Posted October 4, 2014 its a server sided function trigger. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
ZeyadGTX Posted October 4, 2014 Author Posted October 4, 2014 I added These line in my Nametags and it's client side : i added that Client side : local accName = getAccountName ( getPlayerAccount ( player ) ) Do i add this server side : ? 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, "player.png" ) end if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "player.png" ) end if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Warden" ) ) then dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "player.png" ) end My nick in MTA is Spider
crismar Posted October 4, 2014 Posted October 4, 2014 I'm not sure what you're trying to achieve but: Server: function setDataOnLogin() if not isGuestAccount(getPlayerAccount(source)) and isObjectInACLGroup("user."..getAccountName(source), aclGetGroup("Console")) then setElementData(source, "showimg", 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, "showimg", true) end end end addEventHandler("onResourceStart", resourceRoot, setDataOnResourceStart) Client: function showImage() dxDrawImage() -- Here will go the rest of your code. end addEventHandler("onClientResourceStart", resourceRoot, function() addEventHandler("onClientRender", root, showImage) end) Please not your Lua knowledge is terrible, you don't seem to know even the basics of it, dxDrawImage is a client-sided function and shall not be used server-side, it won't have any effect and will throw an error. I've made you the script, you only need to do the dxDrawImage part, even so I looked through the rest of your stuff and it's just not making any sense, you copied a few lines from another script and came here asking for help. nameWidth, teamWidth, scale, imageSize,, sy and sx and undefined variables, I don't even know how you expect this to work. Contact me if you are looking for a Web Developer. 3rd of October 2014 - Founder of RomaniaZ
xeon17 Posted October 6, 2014 Posted October 6, 2014 CODE REMOVED BY XeoN A unique GangWar gamemode waiting for you!Click here for more information.
ZeyadGTX Posted October 6, 2014 Author Posted October 6, 2014 Anyway i made another code and worked My nick in MTA is Spider
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now