ManUthps Posted June 17, 2011 Share Posted June 17, 2011 (edited) Hey guys this is my first release. It is a little Pedspawner for GTA: San Andreas. I've done this mainly to learn something about modding with c++. Maybe someone of you guys can use it for a video or something like else. You can spawn the most of Peds of San Andreas, but not all (main-chars like Sweet will crash your game). If someone of you good coders have some improvement suggestions, u can say it to me here a little video of this tool here the downloads and the sourccode: Compiled: https://rapidshare.com/files/883151708/Spawner.rarhttp://ul.to/lavihhgm Sourcecode: https://rapidshare.com/files/3350427080/PedSpawner.rarhttp://ul.to/kzfks411 and here as pastebin links: Spawner.exe:main.cpphttp://pastebin.com/XSenu7mkInjector.cpphttp://pastebin.com/qLdt7DXymain.hhttp://pastebin.com/AUHSczn5Injector.hhttp://pastebin.com/b3R4DP90Hook.dll:scm.cpphttp://pastebin.com/pVejkKw3main.cpphttp://pastebin.com/FyCWmuvbscm.hhttp://pastebin.com/Sng6wsRkopcodes.hhttp://pastebin.com/fAGXXCpy sorry for (maybe?) my bad english Edited June 18, 2011 by ManUthps Link to comment Share on other sites More sharing options...
NTAuthority Posted June 17, 2011 Share Posted June 17, 2011 (edited) There's a lot of such tools (even internal using CLEO or other non-existent external scripting runtimes), but as you said this is a coding exercise for you, I'd forgive you that. Anyway, time for a few comments on the code: 1. You don't have to ship the .ncb file Visual Studio generates, it'll be re-generated when opening the project, and saves a lot of space. 2. An injector might be regarded as a bit obsolete, but that's just my general dislike for external tools (and trainers usually do inject). 3. You seem to be calling the script functions from code, which is a stable means of doing so, and is actually my preferred method of doing flexible code execution (but as this is single-purpose, it might've been better to do it natively -- the MTA source code is a nice reference). However, I think some credit to whoever developed the C script execution code you reused would be in place. 4. However, you should NOT call the script execution functions from DllMain, this will result in terrible failures later on (like when you'd actually depend on certain events in the main loop, or other random crashes). 5. Why are you reading the player coordinates using native code while most of your code is script-based? That's a bit inconsistent. 6. Even more WTF-like, why in heck are you patching your DllMain function from your launching utility? There's WAY less hacky means of passing through data between processes! 7. Why don't you add -0.5 to the player ped's Z position? That usually ends you up on the ground. And a slight hint - 'main characters' should be loaded using the 'load special model' opcodes (that is, 0x023C, even though it only works for ped models - the internal function is better, but a bit crashy when I tried using it). Edited June 17, 2011 by NTAuthority Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding! Link to comment Share on other sites More sharing options...
ManUthps Posted June 18, 2011 Author Share Posted June 18, 2011 (edited) thank you for ur response ! 1. ok thanks to 3. i will have a look into the MTA Source, and will test a little bit with it, and to the ©, there is http://pastebin.com/pVejkKw3 Line 5, very little, but it is 4. i think you mean that i call the function directly and not the call from Dllmain, iam right? 5. i know, this is a very terrible way, but ive done this because i dont know whats the offset or address of PLAYER_CHAR which i need for using opcode 00A0 6. because of calling the function from Dllmain 7. Done ! and thanks for nice tip with load special model, havent seen this before ^^ ah and in general apart from my whole mistakes, is this the usually way to work together between my Spawner.exe and my Hook.dll, or is there a better way? Edited June 18, 2011 by ManUthps Link to comment Share on other sites More sharing options...
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