![](https://forum.multitheftauto.com/uploads/set_resources_22/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
myonlake
Members-
Posts
2,312 -
Joined
-
Days Won
41
Everything posted by myonlake
-
Even your phone can be hacked, whether or not was it connected to internet. There's no way you can protect anything from being hacked, really, unless you have a fully self-contained local network and everything wired up inside steel-reinforced rooms with very good protection against incoming electromagnetic radiation from outside of your building. Also, there's not really such thing has SHA251. And it's quite difficult to "crack" the decryption for data encrypted with RSA - never even done before.
-
I doubt he made it in Lua. I'd personally go for cpp or c.
-
There is always a way to find such things out. I suggest you go read about encryption before going to decryption. But the in-depth is something were not supposed to talk about in here.
-
You don't need to know anything about decryption. Just asking all these questions makes you look a bit foolish, though it is true the encryption is under the fire.
-
Cache doesn't fix too much. It can still be accessed if you know enough of memory addressing. @newmta: As far as I know, RSA, or any two-key auth algorithm requires two keys. In this case you have access to the net module's key, but not the one on luac.multitheftauto.com, so not sure how you've decrypted much anything so far. And please let us know on what would be a better solution, since you're the expert. I find the current algorithm as good as it can get. Of course you could always encrypt it yourself, but that's not practical and you'd still have to share a key with the client. Though, they don't have access to the server key.
-
Why don't people use the encryption option then? I think it's obviously the only way to protect your code right now. If you're not using it and you're commenting on this thread about "your code is stolen", then perhaps you should just use encryption and no cache.
-
You don't understand what encryption means or did you write this at night? No one has written a decrypter, because the encryption within the compiled code is based on hash, or multiple hashes. You need to first unlock the hash (which is kind of a problem since it's either using a long MD5 or SHA with some private and public key produced by the MTA's compile server; or then it's RSA, which is currently proven as unbreakable - until someone breaks it, of course). If you have made a decrypter, good job, but I think you should write a whole Lua script of your own thousand times better than what they have out there. Good luck.
-
You must set the ACL permissions denied for those commands on the group "Default".
-
That's inefficient. You should use [[ ]] instead.
-
Not sure why you'd have to translate or do anything like so, you can just download and use that resource. It has some exported functions which you can use.
-
You're welcome.
-
guiRoot is a predefined variable, which contains all GUI elements. This way you only have to type in that to destroy GUIs.
-
Remove the loss part from the if statement. Spraycan might have a loss of equal to or less than 1.0, which I am also quite sure of.
-
Second suggestion already suggested: https://bugs.mtasa.com/view.php?id=7582 Relation: https://bugs.mtasa.com/view.php?id=5822
-
Is that so? Your code just made no sense so I went and fixed everything for you. Hopefully you learnt something from this. Server-side local teams = { } function addTeam( parameter ) -- Check if the parameter is a player or a resource if ( parameter ~= resource ) and ( getElementType( parameter ) == "player" ) then -- Get the player's account local account = ( getPlayerAccount( parameter ) and ( not isGuestAccount( getPlayerAccount( parameter ) ) ) and getPlayerAccount( parameter ) or nil ) if ( account ) then -- If the player has an account, get the name of the account local account_name = getAccountName( account ) -- Check if the account is within the admin group if ( isObjectInACLGroup( "user." .. account_name, aclGetGroup( "Admin" ) ) ) then local team = getTeamFromName( "Staff" ) -- If there is no team with the name of "Staff" if ( not team ) then -- Create a new team with that name teams[ "staff" ] = createTeam( "Staff", 255, 255, 255 ) outputChatBox( "[sTAFF TOOLS] Staff team " .. ( ( teams[ "staff" ] and isElement( teams[ "staff" ] ) ) and "added" or "could not be added" ) .. ".", parameter, 255, 0, 0, false ) else outputChatBox( "[sTAFF TOOLS] Staff team already exists.", parameter, 255, 0, 0, false ) end end end -- If the parameter is a resource, then create the team elseif ( parameter == resource ) then teams[ "staff" ] = createTeam( "Staff", 255, 255, 255 ) end end addEventHandler( "onResourceStart", resourceRoot, addTeam ) addCommandHandler( "readd", addTeam ) -- You had a typo here "addTeaM" instead of "addTeam"; Lua is case-sensitive addEventHandler( "onPlayerLogin", root, function( _, account ) -- Get the account name of the account the player logged on to local account_name = getAccountName( account ) -- If the account is within the admin group if ( isObjectInACLGroup( "user." .. account_name, aclGetGroup( "Admin" ) ) ) then setElementData( source, "Staff", true, true ) end end ) addCommandHandler( "gostaff", function( player, cmd ) -- Get the player's account if any local account = ( getPlayerAccount( player ) and ( not isGuestAccount( getPlayerAccount( player ) ) ) and getPlayerAccount( player ) or nil ) if ( account ) then -- Get the account name of this account local account_name = getAccountName( account ) -- If the account is within the admin, moderator or super moderator group if ( isObjectInACLGroup( "user." .. account_name, aclGetGroup( "Admin" ) ) or isObjectInACLGroup( "user." .. account_name, aclGetGroup( "Moderator" ) ) or isObjectInACLGroup( "user." .. account_name, aclGetGroup( "Super Moderator" ) ) ) then -- Get the admin team local team = getTeamFromName( "Staff" ) -- If there is an admin team, then proceed if ( team ) then -- Set the player to the staff team and set the player model to 217 setPlayerTeam( player, getTeamFromName( "Staff" ) ) setElementModel( player, 217 ) outputChatBox( "[sTAFF TOOLS] Welcome to the staff team!", player, 255, 0, 0, false ) else outputChatBox( "[sTAFF TOOLS] Seems like the staff team is missing.", player, 255, 0, 0, false ) end -- End the function so that the error message below won't show up return end end outputChatBox( "[sTAFF TOOLS] You are not a staff.", player, 255, 0, 0, false ) end ) function isPlayerInStaffTeam( player ) -- If the player is not an actual player, then return false if ( not player ) or ( getElementType( player ) ~= "player" ) then return false end -- Get the staff team local team = getTeamFromName( "Staff" ) -- If that staff team exists, then proceed if ( team ) then -- If the player is in the staff team and their skin is 217, then return true if ( getPlayerTeam( player ) == team ) and ( getElementModel( player ) == 217 ) then return true end end return false end function toggleDamageProof( player ) -- If the player is not an actual player, then return false if ( not player ) or ( getElementType( player ) ~= "player" ) then return false end -- Get the occupied vehicle of the player local vehicle = getPedOccupiedVehicle( player ) if ( getElementData( player, "Staff" ) ) and ( vehicle ) then setVehicleDamageProof( vehicle, not isVehicleDamageProof( vehicle ) ) return true end return false end addEvent( getResourceName( resource ) .. ":sync.attack", true ) addEventHandler( getResourceName( resource ) .. ":sync.attack", root, function( target ) -- Set the health so that it's synchronized setElementHealth( target, 200 ) setElementHealth( source, getElementHealth( source ) - 10 ) -- Warn the attacker outputChatBox( "[sTAFF TOOLS] Stop shooting staff members or you will be killed.", source, 255, 0, 0, false ) end ) Client-side addEventHandler( "onClientPlayerDamage", root, function( attacker ) -- If the attacker is not in the staff team if ( not getElementData( attacker, "Staff" ) ) then -- Cancel the event and set the health of both cancelEvent( ) -- Send a request to the server to synchronize stuff triggerServerEvent( getResourceName( resource ) .. ":sync.attack", attacker, source ) outputChatBox( "[sTAFF TOOLS] " .. getPlayerName( attacker ) .. " just attacked you.", 255, 0, 0, false ) end end ) I will edit this post in a moment with some comments in the code, make sure to read those when I get to it.
-
The wheel turned when exiting the car as MTA script?
myonlake replied to MrGTAmodsgerman's topic in Scripting
He wants to do this: Yeah, I would first try with shaders (but I'm a perfect noobs with shaders) because I think it's possible. Otherwise I would use an invisible ped to do it. He will just press the forward button and freeze the car element. But if you use a ped, then the car owner will probably do the carjack animation (even if you destroy the ped in the event onPlayerVehicleEnter, idk give it a try) Also, if another crazy driver hit the car (which is frozen) the car won't go anywhere, so it's not really realistic. That's not what he wanted. He wants to save wheel rotation. -
Remove an "end" from your code. There's one too much.
-
I wouldn't use those functions for the radar. You should instead use 50p's mask shader in combination with your images, that way you can have a great radar.
-
That's not what I meant. The thing I meant was that you removed all your code from this thread, which is kind of considered as a bad habit. You don't need to release your code, just don't remove the code in the thread you post. That's just ridiculous. I've had many of my help threads out there too with all kinds of code; doesn't mean I have to delete it all. It's very unlikely for them to be able to make something work by copy-pasting the code from forums anyways; the code is considered as material for further questions related to the same issues, this way we don't always have to give the same answers again when people can use the search tool and search for that issue. Just keep this in your mind next time you come around asking for help.
-
No. If you don't want it to be used by others, then don't ask for our help at all in the first place.
-
@OP: The MTA forums aren't here for personal advantage. If you want to get support, then don't remove your code. There are other people having same issues and you're just not making it any better here for anyone. That's just a disgrace.
-
The wheel turned when exiting the car as MTA script?
myonlake replied to MrGTAmodsgerman's topic in Scripting
I am not sure if the vehicle components include wheels, but if they do, you have the setVehicleComponentRotation/Position functions at your disposal. Other than that, you can make it the hardcoded way with setPedAnalogControlState with a pedestrian inside the vehicle. -
I highly recommend using indentation as the code is nearly unreadable right now.
-
I am not receiving that amount of lag on my end. Could it be your custom code that causes this?