|
You last visited: Today at 16:10
Advertisement
Warrock - Code Snippets
Discussion on Warrock - Code Snippets within the WarRock forum part of the Shooter category.
02/12/2013, 20:16
|
#691
|
elite*gold: 0
Join Date: Jul 2011
Posts: 5
Received Thanks: 0
|
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
|
#692
|
elite*gold: 297
Join Date: Dec 2010
Posts: 1,129
Received Thanks: 1,687
|
Quote:
Originally Posted by anythinga2
(...) 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
|
#693
|
elite*gold: 0
Join Date: Jun 2009
Posts: 11
Received Thanks: 0
|
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
|
#694
|
elite*gold: 297
Join Date: Dec 2010
Posts: 1,129
Received Thanks: 1,687
|
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
|
#695
|
elite*gold: 0
Join Date: Sep 2012
Posts: 182
Received Thanks: 223
|
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
|
#696
|
elite*gold: 0
Join Date: Aug 2010
Posts: 972
Received Thanks: 1,583
|
Ich denke du meinst die Ungarische Notation.
sz = String Zero Terminated
lp = long pointer
Lässt sich hier Nachlesen:
|
|
|
02/13/2013, 20:53
|
#697
|
elite*gold: 420
Join Date: Jan 2012
Posts: 1,039
Received Thanks: 988
|
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
|
#698
|
elite*gold: 0
Join Date: Jul 2011
Posts: 5
Received Thanks: 0
|
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
|
#699
|
elite*gold: 0
Join Date: Sep 2012
Posts: 182
Received Thanks: 223
|
Quote:
Originally Posted by Yazzn (:
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
|
#700
|
elite*gold: 420
Join Date: Jan 2012
Posts: 1,039
Received Thanks: 988
|
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
|
#701
|
elite*gold: 0
Join Date: Jun 2009
Posts: 11
Received Thanks: 0
|
Quote:
Originally Posted by anythinga2
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
|
#702
|
elite*gold: 0
Join Date: Nov 2007
Posts: 119
Received Thanks: 45
|
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 .
|
|
|
02/14/2013, 10:53
|
#703
|
elite*gold: 0
Join Date: Jun 2009
Posts: 11
Received Thanks: 0
|
thank you for the reply but i cant seem to figure out still..
Quote:
Originally Posted by boknoy24
anyone have source like this? OPK that you can walk only the other players are in the position.
|
Exactly what im asking....
|
|
|
02/14/2013, 11:23
|
#704
|
elite*gold: 0
Join Date: Nov 2007
Posts: 119
Received Thanks: 45
|
Quote:
Originally Posted by anarchi8888
thank you for the reply but i cant seem to figure out still..
Exactly what im asking....
|
yeah this one i need it to :/
|
|
|
02/14/2013, 11:29
|
#705
|
elite*gold: 0
Join Date: Aug 2011
Posts: 726
Received Thanks: 3,211
|
Quote:
Originally Posted by anarchi8888
thank you for the reply but i cant seem to figure out still..
Exactly what im asking....
|
Quote:
Originally Posted by boknoy24
yeah this one 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)
|
|
|
Similar Threads
|
WarRock EU - Code Snippets
07/12/2012 - WarRock - 7490 Replies
Hi Leute,
in diesem Thread könnt ihr:
-> Nach Sourcecodes fragen(Beispiel unten)
-> Eure Sourcecodes posten(Wenn sie nicht von euch sind mit Credits!)
-> Fragen ob eure Source evtl. einen Fehler hat
-> Fragen was welcher Fehler bedeuted
-> Sourcecodes entnehmen(Bitte beim Release dann Credits angeben!)
|
All times are GMT +2. The time now is 16:10.
|
|