mirror of
https://github.com/Ragora/T2-CPP.git
synced 2026-01-20 02:24:46 +00:00
92 lines
2 KiB
C++
92 lines
2 KiB
C++
/**
|
|
*
|
|
*/
|
|
|
|
#include <LinkerAPI.h>
|
|
#include <DXAPI/DXAPI.h>
|
|
|
|
const char *conGetAddress(SimObject *obj, S32 argc, const char *argv[])
|
|
{
|
|
// Hmm...
|
|
char result[256];
|
|
sprintf(result, "%x", obj);
|
|
return result;
|
|
}
|
|
|
|
bool conPlayerGetJumpingState(SimObject *obj, S32 argc, const char* argv[])
|
|
{
|
|
DX::Player operand = DX::Player((unsigned int)obj);
|
|
|
|
return operand.is_jumping;
|
|
}
|
|
|
|
bool conPlayerGetJettingState(SimObject *obj, S32 argc, const char* argv[])
|
|
{
|
|
DX::Player operand = DX::Player((unsigned int)obj);
|
|
|
|
return operand.is_jetting;
|
|
}
|
|
|
|
bool conProjectileExplode(SimObject *obj, S32 argc, const char* argv[])
|
|
{
|
|
Point3F position;
|
|
position.x = 0;
|
|
position.y = 0;
|
|
position.z = 0;
|
|
|
|
Point3F normal;
|
|
normal.x = 0;
|
|
normal.y = 0;
|
|
normal.z = 0;
|
|
|
|
unsigned int collideType = atoi(argv[4]);
|
|
//DX::Projectile_explode((DX::Projectile*)obj, position, normal, collideType);
|
|
|
|
return true;
|
|
}
|
|
|
|
bool conProjectileMakeNerf(SimObject *obj, S32 argc, const char* argv[])
|
|
{
|
|
DX::GrenadeProjectile grenade = DX::GrenadeProjectile((unsigned int)obj);
|
|
grenade.hidden = true;
|
|
|
|
return true;
|
|
}
|
|
|
|
const char* conGrenadeProjectileGetPosition(SimObject *obj, S32 argc, const char* argv[])
|
|
{
|
|
char result[256];
|
|
|
|
DX::GrenadeProjectile grenade = DX::GrenadeProjectile((unsigned int)obj);
|
|
sprintf_s<256>(result, "%f %f %f", grenade.position.x, grenade.position.y, grenade.position.z);
|
|
return result;
|
|
}
|
|
|
|
const char* conGrenadeProjectileGetVelocity(SimObject *obj, S32 argc, const char* argv[])
|
|
{
|
|
char result[256];
|
|
|
|
DX::GrenadeProjectile grenade((unsigned int)obj);
|
|
sprintf_s<256>(result, "%f %f %f", grenade.velocity.x, grenade.velocity.y, grenade.velocity.z);
|
|
|
|
return result;
|
|
}
|
|
|
|
// General Commands ---------------------------------
|
|
#include <cstdarg>
|
|
#include <vector>
|
|
#include <string.h>
|
|
|
|
const char* conSprintf(SimObject *obj, S32 argc, const char* argv[])
|
|
{
|
|
std::vector<const char*> input;
|
|
for (unsigned int i = 2; i < argc; i++)
|
|
input.push_back(argv[i]);
|
|
|
|
char result[256];
|
|
|
|
va_list variable_args = reinterpret_cast<va_list>(input.data());
|
|
vsprintf(result, argv[1], variable_args);
|
|
|
|
return result;
|
|
} |