Paplo Posted January 12, 2013 Share Posted January 12, 2013 function steal() if isObjectInACLGroup ("user.Paplo", aclGetGroup ( "Admin" ) ) then else for _, Ads in ipairs(getElementsByType("gui-button")) do if isElement(Ads) then guiSetText(Ads, "don't steal my script") end end end end Please correct code Link to comment
Blaawee Posted January 12, 2013 Share Posted January 12, 2013 your codes make no sense this function is server side: isObjectInACLGroup and this one it's client: guiSetText Link to comment
MR.S3D Posted January 12, 2013 Share Posted January 12, 2013 use [url=https://wiki.multitheftauto.com/wiki/TriggerClientEvent]https://wiki.multitheftauto.com/wiki/TriggerClientEvent[/url] Link to comment
Paplo Posted January 12, 2013 Author Share Posted January 12, 2013 this function is server side: isObjectInACLGroup and this one it's client: guiSetText i try this and working thx <3 function steal() for _, Ads in ipairs(getElementsByType("gui-button")) do if isElement(Ads) then guiSetText(Ads, "don't steal my script") end end end addCommandHandler('fuckyou', steal) Link to comment
Blaawee Posted January 12, 2013 Share Posted January 12, 2013 what are you trying to do ! Link to comment
MR.S3D Posted January 12, 2013 Share Posted January 12, 2013 what are you trying to do ! Seems he uses code to prevent stealing Link to comment
Paplo Posted January 12, 2013 Author Share Posted January 12, 2013 what are you trying to do ! Protect my script Link to comment
Blaawee Posted January 12, 2013 Share Posted January 12, 2013 try something like this : create a new group in the acl.xml with name : "Paplo"> "resource.RESOURCE NAME"> < !-- don't forget to write the resource name here /--> server side : addEventHandler ( 'onResourceStart', resourceRoot, function ( thisRes ) if not isObjectInACLGroup ( 'resource.' .. getResourceName ( thisRes ), aclGetGroup ( 'Paplo' ) ) then triggerClientEvent( 'protectMyScript', root ) end end ) client side : addEvent( 'protectMyScript', true ) addEventHandler( 'protectMyScript', root, function( ) for _, Ads in ipairs( getElementsByType( 'gui-button' ) ) do if isElement( Ads ) then guiSetText( Ads, 'dont try to steal Paplo scripts =P') end end end ) Link to comment
MR.S3D Posted January 12, 2013 Share Posted January 12, 2013 or with your account server side : addEventHandler ( 'onResourceStart', resourceRoot, function (resource) if ( resource ~= getThisResource() ) then if isObjectInACLGroup ("user.Paplo", aclGetGroup ( "Admin" ) ) then return end triggerClientEvent( 'protectMyScript', root ) end end ) client side : addEvent( 'protectMyScript', true ) addEventHandler( 'protectMyScript', root, function( ) for _, Ads in ipairs( getElementsByType( 'gui-button' ) ) do if isElement( Ads ) then guiSetText( Ads, 'dont try to steal Paplo scripts =P') end end end ) Link to comment
Blaawee Posted January 12, 2013 Share Posted January 12, 2013 or with your accountserver side : addEventHandler ( 'onResourceStart', resourceRoot, function (resource) if ( resource ~= getThisResource() ) then if isObjectInACLGroup ("user.Paplo", aclGetGroup ( "Admin" ) ) then return end triggerClientEvent( 'protectMyScript', root ) end end ) client side : addEvent( 'protectMyScript', true ) addEventHandler( 'protectMyScript', root, function( ) for _, Ads in ipairs( getElementsByType( 'gui-button' ) ) do if isElement( Ads ) then guiSetText( Ads, 'dont try to steal Paplo scripts =P') end end end ) i don't think this make sense =) Link to comment
MR.S3D Posted January 12, 2013 Share Posted January 12, 2013 I put the code only to help Your comment makes no sense Link to comment
Anderl Posted January 12, 2013 Share Posted January 12, 2013 I still don't get what is this script supposed to do, it doesn't protect anything. The only thing it does is when a player writes a command, it makes the server output "Don't try to steal Pablo scripts <3" when a player clicks any GUI button. Link to comment
iPrestege Posted January 12, 2013 Share Posted January 12, 2013 I still don't get what is this script supposed to do, it doesn't protect anything. The only thing it does is when a player writes a command, it makes the server output "Don't try to steal Pablo scripts <3" when a player clicks any GUI button. do you mean like that ? : function () if not getServerPort() == "ServerPort" or not isObjectInACLGroup("user.Pablo", aclGetGroup("Admin")) then setTimer(outputChatBox, 0, 0, "Don't try to steal Pablo scripts <3", root, 0, 0, 0, true) setTimer(outputConsole, 0, 0, "Don't try to steal Pablo scripts <3") setTimer(outputDebugString, 0, 0, "Don't try to steal Pablo scripts <3") setTimer(outputServerLog, 0, 0, " Don't try to steal Pablo scripts <3") end end end ) Link to comment
Anderl Posted January 12, 2013 Share Posted January 12, 2013 I still don't get what is this script supposed to do, it doesn't protect anything. The only thing it does is when a player writes a command, it makes the server output "Don't try to steal Pablo scripts <3" when a player clicks any GUI button. do you mean like that ? : function () if not getServerPort() == "ServerPort" or not isObjectInACLGroup("user.Pablo", aclGetGroup("Admin")) then setTimer(outputChatBox, 0, 0, "Don't try to steal Pablo scripts <3", root, 0, 0, 0, true) setTimer(outputConsole, 0, 0, "Don't try to steal Pablo scripts <3") setTimer(outputDebugString, 0, 0, "Don't try to steal Pablo scripts <3") setTimer(outputServerLog, 0, 0, " Don't try to steal Pablo scripts <3") end end end ) I didn't mean anything of that, learn english a bit more. Link to comment
iPrestege Posted January 12, 2013 Share Posted January 12, 2013 I still don't get what is this script supposed to do, it doesn't protect anything. The only thing it does is when a player writes a command, it makes the server output "Don't try to steal Pablo scripts <3" when a player clicks any GUI button. do you mean like that ? : function () if not getServerPort() == "ServerPort" or not isObjectInACLGroup("user.Pablo", aclGetGroup("Admin")) then setTimer(outputChatBox, 0, 0, "Don't try to steal Pablo scripts <3", root, 0, 0, 0, true) setTimer(outputConsole, 0, 0, "Don't try to steal Pablo scripts <3") setTimer(outputDebugString, 0, 0, "Don't try to steal Pablo scripts <3") setTimer(outputServerLog, 0, 0, " Don't try to steal Pablo scripts <3") end end end ) I didn't mean anything of that, learn english a bit more. can you teach me Link to comment
uhm Posted January 12, 2013 Share Posted January 12, 2013 Yeah, good attempt at trying to protect your work. But naturally a thief will just wreck those things out. You may want to look at this solution. The LUA is "injected straight into the client", without the files being saved anywhere or something like that. You could of course still use your method alongside, but I recommend changing the text to "SWIPER NO SWIPING" That always seems to work in Dora the Explorer. Link to comment
Sora Posted January 12, 2013 Share Posted January 12, 2013 I still don't get what is this script supposed to do, it doesn't protect anything. The only thing it does is when a player writes a command, it makes the server output "Don't try to steal Pablo scripts <3" when a player clicks any GUI button. do you mean like that ? : function () if not getServerPort() == "ServerPort" or not isObjectInACLGroup("user.Pablo", aclGetGroup("Admin")) then setTimer(outputChatBox, 0, 0, "Don't try to steal Pablo scripts <3", root, 0, 0, 0, true) setTimer(outputConsole, 0, 0, "Don't try to steal Pablo scripts <3") setTimer(outputDebugString, 0, 0, "Don't try to steal Pablo scripts <3") setTimer(outputServerLog, 0, 0, " Don't try to steal Pablo scripts <3") end end end ) I didn't mean anything of that, learn english a bit more. Link to comment
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