yoya99 Posted October 5, 2014 Posted October 5, 2014 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)
Enargy, Posted October 5, 2014 Posted October 5, 2014 isObjectInACLGroup -- This function only works in server-side. you must check the '/debugscript 3' for more errors
Enargy, Posted October 5, 2014 Posted October 5, 2014 oh, you are also leaving functions without arguments.
King12 Posted October 5, 2014 Posted October 5, 2014 You better use: setElementData + getElementData It's way better than triggering this time, because you would make each event for each acl group if you triggered it..
yoya99 Posted October 5, 2014 Author Posted October 5, 2014 i don't understand...can you edit it ready pls how you mean it... thx
Enargy, Posted October 5, 2014 Posted October 5, 2014 --- 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)
yoya99 Posted October 6, 2014 Author Posted October 6, 2014 Thats all? Just make a meta and ready? Do i see it in my own too or? And what is with admin acl group and moderator acl group? Iam confused
yoya99 Posted October 6, 2014 Author Posted October 6, 2014 i tried out and it is not working too....error: basic.lua:5 attempt to perform arthimetic on global "sx" (a nil value) i dont see any image at my head too..HEEELP
xeon17 Posted October 6, 2014 Posted October 6, 2014 i tried out and it is not working too....error: basic.lua:5 attempt to perform arthimetic on global "sx" (a nil value)i dont see any image at my head too..HEEELP You haven't definied the arguments , you only copied the code from this topic viewtopic.php?f=91&t=81037 It will never work
yoya99 Posted October 6, 2014 Author Posted October 6, 2014 no that is my personal code...i just ask for help becasue i am not a pro scripter..i just learnt it by a friend... SO you cant help me or??
xeon17 Posted October 6, 2014 Posted October 6, 2014 no that is my personal code. viewtopic.php?f=91&t=81037&p=743385#p743385 Seriously?
xeon17 Posted October 6, 2014 Posted October 6, 2014 Someone here is looking for topic lock Wait,what?
yoya99 Posted October 6, 2014 Author Posted October 6, 2014 you dotn gonna help me or? no i didnt see this code on that topic....its from ma friend
xXMADEXx Posted October 6, 2014 Posted October 6, 2014 you dotn gonna help me or? no i didnt see this code on that topic....its from ma friend Then your friend took it.
yoya99 Posted October 6, 2014 Author Posted October 6, 2014 I dont call that constructive help now.... If nobody can give me an normal answer then go pls away
xeon17 Posted October 6, 2014 Posted October 6, 2014 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?
ZeyadGTX Posted October 6, 2014 Posted October 6, 2014 MY SCRIPT STOLEN FROM CLIENT SIDE NO ONE GIVE HIM MY SERVER SIDE !!
xeon17 Posted October 6, 2014 Posted October 6, 2014 MY SCRIPT STOLEN FROM CLIENT SIDE NO ONE GIVE HIM MY SERVER SIDE !! I guess then you stolen the script from grafuroom and he from your server
yoya99 Posted October 6, 2014 Author Posted October 6, 2014 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?
ZeyadGTX Posted October 6, 2014 Posted October 6, 2014 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
ZeyadGTX Posted October 6, 2014 Posted October 6, 2014 MY SCRIPT STOLEN FROM CLIENT SIDE NO ONE GIVE HIM MY SERVER SIDE !! I guess then you stolen the script from grafuroom and he from your server I didn't steal it ! My friend helped me with it and he is scripter in this Forum
xeon17 Posted October 6, 2014 Posted October 6, 2014 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?
Recommended Posts