Jump to content
Moopler
  • 0
Sign in to follow this  
Roopie

Question Auto Terminate Script

Question

Hi, what do I change on this script to allow up to a number of players or certain IGN's?

[v198.2 GMS] Auto Terminate

Quote

[enable]
//By DavHeed, ButterSmooth, at Moopler
//auto kill maple when user enters field
//threshold of people count is set on enable
alloc(hook, 128)
Label(skip)

02588810:
jmp hook

hook:
cmp ebx,eax
je skip
pushad
push 0
push ffffffff
call TerminateProcess
test eax,eax
popad
jnz skip
xor eax,eax
div eax

skip:
jmp 02588A9E //first je/jmp in CUserPool::OnUserEnterField

[disable]
02588810:   //CUserPool::OnUserEnterField 8D 4D D8 E8 ? ? ? ? 8D 4D D0 E8 ? ? ? ? 8B 4D F4 64 89 0D ? ? ? ? [Function Start]
push ebp
mov ebp,esp
push -01

//cmp esi,eax
//je 02588A9E  //first je/jmp in above function
DeAlloc(hook)

 

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 0

Here you go, this should do what you're after. I only tested it once, but seems to work.

[enable]
alloc(hook, 128)
Label(Return)
Label(return_original)

025EF030:
jmp hook
Return:

hook:
pushad
mov ecx,[034D0C34] //TSingleton<CUserPool> - 8B 0D ?? ?? ?? ?? 83 ?? ?? ?? 0F 85
lea ecx,[ecx+A8] //m_lUserRemote
call 0085A4D0 //TSecType::GetData<long> - E8 ?? ?? ?? ?? 8B ?? ?? 3B ?? 74 ?? C7 [Follow call]
cmp eax,#2
popad
jle return_original
push 0
push ffffffff
call TerminateProcess
xor eax,eax
div eax

return_original:
push ebp
mov ebp,esp
push -01
jmp Return

[disable]
025EF030:   //CUserPool::OnUserEnterField 8D 4D D8 E8 ? ? ? ? 8D 4D D0 E8 ? ? ? ? 8B 4D F4 64 89 0D ? ? ? ? [Function Start]
push ebp
mov ebp,esp
push -01
DeAlloc(hook)

Just change the #2 to whatever amount of players you want. Note that it excludes yourself, so it'll be 0 if it's just you on the map.

  • Like 2

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×