Home » Renegade Discussions » Mod Forum » Scripts.dll help
Scripts.dll help [message #96859] |
Wed, 23 June 2004 12:28 |
|
gibberish
Messages: 366 Registered: May 2003
Karma:
|
Commander |
|
|
I don't know of a way to do it from the console however if you want to do it from the chat (F2) then !kill the only other code you need is the code to get a player name:
unsigned long GetPlayerData(GameObject *obj)
{
if (!obj)
return 0;
__asm {
mov edx, obj
mov eax, dword ptr[edx + 960h]
};
}
LPCWSTR GetName(unsigned long ptr_)
{
if (!ptr_)
return NULL;
__asm {
mov edx, [ptr_]
mov eax, dword ptr[edx + 758h]
};
}
LPSTR GetPlayerNameA(GameObject *obj)
{
LPCWSTR lpszSource = GetName(GetPlayerData(obj));
return wcstombsnew(lpszSource);
}
LPCWSTR GetPlayerNameW(GameObject *obj)
{
return (LPCWSTR) GetName(GetPlayerData(obj));
}
char *wcstombsnew(LPCWSTR lpszSource)
{
if (!lpszSource)
return NULL;
// Add 1 to include null terminator
size_t stLen = wcslen(lpszSource);
size_t stZero = stLen + 1;
// Calculate how much space is needed
size_t stNew = wcstombs(NULL, lpszSource, stZero);
if (stNew == ((size_t) -1))
return NULL;
char *lpszTarget = new char [stNew + 1];
wcstombs(lpszTarget, lpszSource, stZero);
return lpszTarget;
}
// Version of wcsdup that uses new instead of malloc
LPWSTR wcsdupnew(LPCWSTR lpszSource)
{
if (!lpszSource)
return NULL;
// Copy the wide string
size_t st_len = wcslen(lpszSource);
LPWSTR lpszTarget = new WCHAR[st_len + 1];
wcscpy(lpszTarget, lpszSource);
return lpszTarget;
}
Everything you need is now in this thread.
|
|
|
|
|
Scripts.dll help
By: thinlan on Sat, 19 June 2004 12:46
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
By: thinlan on Sat, 19 June 2004 12:51
|
|
|
Scripts.dll help
By: thinlan on Mon, 21 June 2004 17:59
|
|
|
Scripts.dll help
By: jonwil on Mon, 21 June 2004 18:33
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
By: thinlan on Mon, 21 June 2004 19:02
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
By: thinlan on Tue, 22 June 2004 12:59
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
By: thinlan on Tue, 22 June 2004 22:30
|
|
|
Scripts.dll help
By: thinlan on Tue, 22 June 2004 22:32
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
By: thinlan on Wed, 23 June 2004 02:18
|
|
|
Scripts.dll help
By: Tidu on Wed, 23 June 2004 08:06
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
By: Spice on Wed, 23 June 2004 11:53
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
By: thinlan on Wed, 23 June 2004 15:48
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
By: mac on Fri, 25 June 2004 15:03
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
By: thinlan on Sun, 27 June 2004 03:30
|
|
|
Scripts.dll help
|
|
|
Scripts.dll help
By: thinlan on Sun, 27 June 2004 09:16
|
Goto Forum:
Current Time: Wed Jan 01 07:44:31 MST 2025
Total time taken to generate the page: 0.01505 seconds
|