• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Help] Killer system not working 99.62T

Junior Spellweaver
Joined
Oct 27, 2012
Messages
156
Reaction score
1
Hello ragezone, I took the source code from these files:
http://forum.ragezone.com/f197/files-0-99-60t-chs-1094548/
Trying to make a similiar "Killer" system for my castle siege server.
The killer system sends a message to the target and to the killer that he kills (or died).
(The only difference is that instead of sending the message to each of them it will posted as global message and shows the "kill log")
The problem is that it's not working. Please check my code:

PHP:
void GCDiePlayerSend_Hook(OBJECTSTRUCT* lpObj, int TargetIndex, unsigned char skill, int KillerIndex)
{
	SYSTEMTIME t;
	GetLocalTime(&t);

	if(gObj(TargetIndex)->Type == 1 && gObj(KillerIndex)->Type == 1)
	{
		if(TargetIndex != KillerIndex)
		{
			char Msg[70];
			sprintf(Msg, "[%d:%d:%d] %s killed %s", t.wHour, t.wMinute, t.wSecond, gObj(KillerIndex)->Name, gObj(TargetIndex)->Name);
			for (int i = OBJECT_MIN; i < OBJECT_MAX; i++)
			{
				OutYellowMSG2("", Msg, i);
			}


		}
	}

	GCDiePlayerSend(lpObj, TargetIndex, skill, KillerIndex);
}

func.HookThis((DWORD)&GCDiePlayerSend_Hook,0x00401082);
#define GCDiePlayerSend ((void(*)(OBJECTSTRUCT* lpObj, int TargetIndex, BYTE skill, int KillerIndex)) 0x0043EA00) // OK

Thanks.
 
Last edited:
Joined
May 26, 2009
Messages
17,312
Reaction score
3,222
Upvote 0
Back
Top