CrunchLikeTwix (07-03-2016),Fade Pot'z (06-09-2016),Kid a (06-10-2016),Scoudem (06-10-2016),Tiiiiimooo (01-13-2017)
I just wrote this little function which gives the specified client the golden desert eagle.
Please don't release it as part of dll without asking me and leave a thanks
If called correctly (there is not much that can go wrong) it should look like this:Code:void GiveGoldenDesertEagle(int clientNum) { static const char* deserteaglegold_mp { "deserteaglegold_mp" }; __asm { PUSH EAX PUSH EBX PUSH EDI PUSH ESI MOV EAX, 0x00479500 PUSH deserteaglegold_mp CALL EAX ADD ESP, 0x04 MOV EDI, 0x0274 IMUL EDI, clientNum ADD EDI, 0x0194B950 MOV ESI, EDI ADD ESI, 0x0158 MOV ESI, [ESI] MOV EBX, 0x00550D60 PUSH 0x00000000 PUSH 0x00 PUSH EAX PUSH ESI CALL EBX ADD ESP, 0x04 POP EAX ADD ESP, 0x08 MOV EBX, 0x0051FD90 PUSH 0x00000000 PUSH 0x00 CALL EBX ADD ESP, 0x08 POP ESI POP EDI POP EBX POP EAX } }
CrunchLikeTwix (07-03-2016),Fade Pot'z (06-09-2016),Kid a (06-10-2016),Scoudem (06-10-2016),Tiiiiimooo (01-13-2017)
In addition: if you want to switch to the weapon you can use this:
Where iWeaponIndex is the result of calling 0x479500Code:// G_SelectWeaponIndex(int clientNum, int iWeaponIndex) ((void(__cdecl*)(int clientNum, int iWeaponIndex))0x550990)(id, index);
Last edited by Scoudem; 06-10-2016 at 04:50 PM. Reason: botched
Kid a (06-10-2016)
Is it possible to use this same code to receive the defaultweapon?
Kid a (06-10-2016)
Umm, excuse me. I know this is somewhat irrelevant but which language is the code written in?
Host only, right?
Either way, thanks for this, Xen0