Warrock - Code Snippets

02/12/2013 20:16 anythinga2#691
Code:
struct cPlayer
{
char Speaker13[20];//0x102EC
float PosX;//0x10300
char Speaker14[4];//0x10304
float PosY;//0x10310
char Speaker15[4];//0x10314
float PosZ;//0x10308
}; //size = 0x010310 (66320)
struct CBase
{
cPlayer* pLocal;//0xA4FEB0
char unknown0 [1212644];//0xA4FEB4
cPlayer** pGlobal;//0xB77F98
};CBase* p_Player = (CBase*)Adr_PlayerPointer;
CBase* global = (CBase*)Adr_RemotePointer;

Code:
if (opk == 1){
			for(int i = 0; i < 32; i++) {
				cPlayer* pPlayerA = p_Player->pGlobal[i];
				//p_Player->pLocal->PosX = 0.0F;
				//p_Player->pLocal->PosY = 0.0F;
				//p_Player->pLocal->PosZ = 0.0F;
				p_Player->pGlobal[i]->PosX = 0.0F;
				p_Player->pGlobal[i]->PosY = 0.0F;
				p_Player->pGlobal[i]->PosZ = 0.0F;
								
			}
		}
Can someone, please tell me or explain to me why this is not working (and no, not nullptr since that wasnt what i did wrong)
the p_player->plocal->pos works fine, its pglobal that causes the crashing.
i don't have a bypass, might that be what is crashing it?
also, in OPK where does the unknown0 in Cbase come into play?

thanks in advance!
02/12/2013 21:01 Raz9r#692
Quote:
Originally Posted by anythinga2 View Post
(...) its pglobal that causes the crashing.
Dereferencing something pointing to invalid memory causes undefined behavior as stated in the C++ Standard. You should better check your pointers before dereferencing them. Also, try to debug it first.
02/13/2013 08:03 anarchi8888#693
may i ask something? i have a no menu base and my question is about OPK Warrock.. i can distance myself to them.

the problem is, is it possible to make the player move? i mean the only thing that is stuck in one place are the enemies.

Hoping for your spare time Masters of the Forum. thanks
02/13/2013 09:32 Raz9r#694
By setting everyones location to (0, 0, 0) you freeze them at that position. If you do that for every player but yourself, you will still be able to move.

Pseudo-Code:
Code:
for (size_t i = 0; i < 32; ++i) {
  if (i != local_index) {
    do_opk();
  }
}
02/13/2013 20:22 SonyRazzer#695
Kann mir einer vielleicht sagen, wo man nachlesen kann, wie man was in C++ bennent ?
Also damit meine ich jetzt z.B. ein LPSTR dann als szString oder lpString zu nennen.
02/13/2013 20:47 NikM#696
Ich denke du meinst die Ungarische Notation.
sz = String Zero Terminated
lp = long pointer

Lässt sich hier Nachlesen:
[Only registered and activated users can see links. Click Here To Register...]
02/13/2013 20:53 +Yazzn#697
Das Präfix "sz" steht in der Hungarian notation für zero-terminated string (null-terminierte Zeichenkette) und "lp" für long pointer

Es ist jedem selbst überlassen welcher naming conventions man sich unterwirft.
02/13/2013 20:55 anythinga2#698
okay, i got opk working, altough now i have a problem, it teleports everyone, and then keeps sending them back to their normal location, so it look likes an infinite loop, anyway you can freeze them?
02/13/2013 21:42 SonyRazzer#699
Quote:
Originally Posted by Yazzn (: View Post
Das Präfix "sz" steht in der Hungarian notation für zero-terminated string (null-terminierte Zeichenkette) und "lp" für long pointer

Es ist jedem selbst überlassen welcher naming conventions man sich unterwirft.
Danke, aber was ist z.B. mit lpszBlaBla
Das nutzt doch z.B. Microsoft ( MSDN .. )
02/13/2013 21:56 +Yazzn#700
Zu der Sache mit den long pointern:
Quote:
Historisch steht P für "pointer", während LP für "long pointer" steht. Lange Zeiger (auch weite Zeiger genannt) sind ein Überbleibsel aus 16-Bit-Windows, bei dem Sie dafür benötigt wurden, Speicherbereiche außerhalb des aktuellen Segments abzudecken. Das Präfix LP wurde beibehalten, um das Portieren von 16-Bit-Code in 32-Bit-Windows zu vereinfachen. Aktuell besteht hier kein Unterschied — ein Zeiger ist ein Zeiger.
02/14/2013 05:31 anarchi8888#701
Quote:
Originally Posted by anythinga2 View Post
okay, i got opk working, altough now i have a problem, it teleports everyone, and then keeps sending them back to their normal location, so it look likes an infinite loop, anyway you can freeze them?
out of the topic question Sir. I just want to ask if you can move? and the only thing that is stuck are the other players not you?

thanks
02/14/2013 10:41 boknoy24#702
anyone have a source here. you can move on opk only the enemies are in the 0 position. or a save position then when you saved it. the enemies are in there :D.
02/14/2013 10:53 anarchi8888#703
thank you for the reply but i cant seem to figure out still..


Quote:
Originally Posted by boknoy24 View Post
anyone have source like this? OPK that you can walk only the other players are in the position.

[Only registered and activated users can see links. Click Here To Register...]
Exactly what im asking....
02/14/2013 11:23 boknoy24#704
Quote:
Originally Posted by anarchi8888 View Post
thank you for the reply but i cant seem to figure out still..




Exactly what im asking....

yeah this one [Only registered and activated users can see links. Click Here To Register...] i need it to :/
02/14/2013 11:29 R3d_L!n3#705
Quote:
Originally Posted by anarchi8888 View Post
thank you for the reply but i cant seem to figure out still..




Exactly what im asking....
Quote:
Originally Posted by boknoy24 View Post
yeah this one [Only registered and activated users can see links. Click Here To Register...] i need it to :/

Seriously ?

Go back old old page and read what UnderSc.. said , just loop all player only u by doing if(Index != MyIndex)