Hey ich hab ein neues Problem.
Ich habe bei meinem Noclip "w" und "s" eingebaut und es funktionert.
Nun weis ich aber nicht wie ich "a" und "d" berechnen soll :S
Hier ein Bild der Blickrichtung, und die auswirkung auf die X/Z Koordinate.
Habe vergessen + zu setzen. Einfach hindenken.
Hier der Source.
PHP Code:
void CheckKey()
{
if(GetAsyncKeyState('W'))
{
WishedXCoord = ActualXCoord + (*(float*)(PlayerStruct+0x70) * TeleportSpeed);
WishedYCoord = ActualYCoord;
WishedZCoord = ActualZCoord + (*(float*)(PlayerStruct+0x78) * TeleportSpeed);
TeleportState = 1;
}
if(GetAsyncKeyState('S'))
{
WishedXCoord = ActualXCoord + ((-*(float*)(PlayerStruct+0x70)) * TeleportSpeed);
WishedYCoord = ActualYCoord;
WishedZCoord = ActualZCoord + ((-*(float*)(PlayerStruct+0x78)) * TeleportSpeed);
TeleportState = 1;
}
}
Ihr müsst es euch so vorstellen.
Das Kreuz das ich gezeichnet habe, stellt die Blickrichtung des Spielers dar.
Bei einer links und rechts bewegung ändert sich die Blickrichtung aber nicht, d.h. ich muss irgendwie berechnen, womit die SpielerPosition addiert werden muss.
Edit:
Habs gelöst.
Ist zwar nich die feine Englische art, aber evtl. hat jemand eine andere Idee.
Ich lasse das erstmal so.
PHP Code:
void CheckKey()
{
if(GetAsyncKeyState('W'))
{
WishedXCoord = ActualXCoord + (*(float*)(PlayerStruct+0x70) * TeleportSpeed);
WishedYCoord = ActualYCoord;
WishedZCoord = ActualZCoord + (*(float*)(PlayerStruct+0x78) * TeleportSpeed);
TeleportState = 1;
}
if(GetAsyncKeyState('S'))
{
WishedXCoord = ActualXCoord + ((-*(float*)(PlayerStruct+0x70)) * TeleportSpeed);
WishedYCoord = ActualYCoord;
WishedZCoord = ActualZCoord + ((-*(float*)(PlayerStruct+0x78)) * TeleportSpeed);
TeleportState = 1;
}
if(GetAsyncKeyState('E'))
{
float CurrentXView = *(float*)(PlayerStruct+0x70);
float CurrentZView = *(float*)(PlayerStruct+0x78);
if(CurrentXView >= 0 && CurrentXView >= 0 && CurrentZView >= 0)
{
WishedXCoord = ActualXCoord + ((*(float*)(PlayerStruct+0x70) - 1.0) * TeleportSpeed);
WishedYCoord = ActualYCoord;
WishedZCoord = ActualZCoord + ((*(float*)(PlayerStruct+0x70)) * TeleportSpeed);
TeleportState = 1;
}
else if(CurrentXView <= 0 && CurrentZView >= 0)
{
WishedXCoord = ActualXCoord + (-(*(float*)(PlayerStruct+0x78)) * TeleportSpeed);
WishedYCoord = ActualYCoord;
WishedZCoord = ActualZCoord + ((*(float*)(PlayerStruct+0x70)) * TeleportSpeed);
TeleportState = 1;
}
else if(CurrentXView <= 0 && CurrentZView <= 0)
{
WishedXCoord = ActualXCoord + (-(*(float*)(PlayerStruct+0x78)) * TeleportSpeed);
WishedYCoord = ActualYCoord;
WishedZCoord = ActualZCoord + ((*(float*)(PlayerStruct+0x70)) * TeleportSpeed);
TeleportState = 1;
}
else if(CurrentXView >= 0 && CurrentZView <= 0)
{
WishedXCoord = ActualXCoord + (-(*(float*)(PlayerStruct+0x78)) * TeleportSpeed);
WishedYCoord = ActualYCoord;
WishedZCoord = ActualZCoord + ((*(float*)(PlayerStruct+0x70)) * TeleportSpeed);
TeleportState = 1;
}
}
if(GetAsyncKeyState('Q'))
{
float CurrentXView = *(float*)(PlayerStruct+0x70);
float CurrentZView = *(float*)(PlayerStruct+0x78);
if(CurrentXView >= 0 && CurrentXView >= 0 && CurrentZView >= 0)
{
WishedXCoord = ActualXCoord + ((*(float*)(PlayerStruct+0x78)) * TeleportSpeed);
WishedYCoord = ActualYCoord;
WishedZCoord = ActualZCoord + (-(*(float*)(PlayerStruct+0x70)) * TeleportSpeed);
TeleportState = 1;
}
else if(CurrentXView <= 0 && CurrentZView >= 0)
{
WishedXCoord = ActualXCoord + ((*(float*)(PlayerStruct+0x78)) * TeleportSpeed);
WishedYCoord = ActualYCoord;
WishedZCoord = ActualZCoord + (-(*(float*)(PlayerStruct+0x70)) * TeleportSpeed);
TeleportState = 1;
}
else if(CurrentXView <= 0 && CurrentZView <= 0)
{
WishedXCoord = ActualXCoord + ((*(float*)(PlayerStruct+0x78)) * TeleportSpeed);
WishedYCoord = ActualYCoord;
WishedZCoord = ActualZCoord + (-(*(float*)(PlayerStruct+0x70)) * TeleportSpeed);
TeleportState = 1;
}
else if(CurrentXView >= 0 && CurrentZView <= 0)
{
WishedXCoord = ActualXCoord + ((*(float*)(PlayerStruct+0x78)) * TeleportSpeed);
WishedYCoord = ActualYCoord;
WishedZCoord = ActualZCoord + (-(*(float*)(PlayerStruct+0x70)) * TeleportSpeed);
TeleportState = 1;
}
}
}