Quantcast

Jump to content

» «
Photo

No-Clip (C++)

1 reply to this topic
gpackers52
  • gpackers52

    Player Hater

  • Members
  • Joined: 4 weeks ago
  • United-States

#1

Posted 2 weeks ago

Does anyone have sample code for no-clip?


DoggoMaster
  • DoggoMaster

    Player Hater

  • Members
  • Joined: 18 Sep 2017
  • Poland

#2

Posted 2 weeks ago Edited by DoggoMaster, 2 weeks ago.

Vector3 pos = ENTITY::GET_ENTITY_COORDS(playerPed, false);

ENTITY::SET_ENTITY_COORDS_NO_OFFSET(playerPed, pos.x, pos.y, pos.z, false, false, false);
if (GetAsyncKeyState(VK_KEY_S) || CONTROLS::IS_DISABLED_CONTROL_JUST_PRESSED(2, 268)) {
float fivef = .5f;
float heading = ENTITY::GET_ENTITY_HEADING(playerPed);
float xVec = fivef * sin(degToRad(heading)) * -1.0f;
float yVec = fivef * cos(degToRad(heading));
ENTITY::SET_ENTITY_HEADING(playerPed, heading);
 
pos.x -= xVec, pos.y -= yVec;
ENTITY::SET_ENTITY_COORDS_NO_OFFSET(playerPed, pos.x, pos.y, pos.z, false, false, false);
}
if (GetAsyncKeyState(VK_KEY_W) || CONTROLS::IS_DISABLED_CONTROL_JUST_PRESSED(2, 269)) {
float fivef = .5f;
float heading = ENTITY::GET_ENTITY_HEADING(playerPed);
float xVec = fivef * sin(degToRad(heading)) * -1.0f;
float yVec = fivef * cos(degToRad(heading));
ENTITY::SET_ENTITY_HEADING(playerPed, heading);
 
pos.x += xVec, pos.y += yVec;
ENTITY::SET_ENTITY_COORDS_NO_OFFSET(playerPed, pos.x, pos.y, pos.z, false, false, false);
}
if (GetAsyncKeyState(VK_KEY_A) || CONTROLS::IS_DISABLED_CONTROL_JUST_PRESSED(2, 266)) {
float fivef = .5f;
float heading = ENTITY::GET_ENTITY_HEADING(playerPed);
ENTITY::SET_ENTITY_HEADING(playerPed, heading + 0.5f);
}
if (GetAsyncKeyState(VK_KEY_D) || CONTROLS::IS_DISABLED_CONTROL_JUST_PRESSED(2, 271)) {
float fivef = .5f;
float heading = ENTITY::GET_ENTITY_HEADING(playerPed);
ENTITY::SET_ENTITY_HEADING(playerPed, heading - 0.5f);
}
if (GetAsyncKeyState(VK_SHIFT) || CONTROLS::IS_DISABLED_CONTROL_JUST_PRESSED(2, ControlFrontendRb)) {
float heading = ENTITY::GET_ENTITY_HEADING(playerPed);
ENTITY::SET_ENTITY_HEADING(playerPed, heading);
 
pos.z -= 0.5;
ENTITY::SET_ENTITY_COORDS_NO_OFFSET(playerPed, pos.x, pos.y, pos.z, false, false, false);
}
if (GetAsyncKeyState(VK_SPACE) || CONTROLS::IS_DISABLED_CONTROL_JUST_PRESSED(2, ControlFrontendLb)) {
float heading = ENTITY::GET_ENTITY_HEADING(playerPed);
ENTITY::SET_ENTITY_HEADING(playerPed, heading);
 
pos.z += 0.5;
ENTITY::SET_ENTITY_COORDS_NO_OFFSET(playerPed, pos.x, pos.y, pos.z, false, false, false);
} no problem :>




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users