当我尝试使用SDK编译简单的GTA San Andreas ASI(dll)项目时,我看到了错误
C2065 'D3DFORMAT': undeclared identifier.
行:RwBool _rwD3D9CheckValidCameraTextureFormat(D3DFORMAT format); // 0x4CBE20
有趣的是,几个月前,在重置为出厂设置(Windows 10)之前一切正常。 我尝试使用Visual Studio 2015/2017/2019。
我的代码非常简单,因为所有代码都在SDK中。 (https://github.com/DK22Pac/plugin-sdk)
#include "plugin.h"
#include "common.h"
#include "CTimer.h"
#include "CStreaming.h"
using namespace plugin;
class PlayerWeapon {
public:
PlayerWeapon() {
static int keyPressTime = 0;
Events::gameProcessEvent += [] {
CPed *playa = FindPlayerPed();
if (playa && KeyPressed(VK_TAB) && CTimer::m_snTimeInMilliseconds - keyPressTime > 500) {
keyPressTime = CTimer::m_snTimeInMilliseconds;
CStreaming::RequestModel(MODEL_M4, 2);
CStreaming::LoadAllRequestedModels(false);
playa->GiveWeapon(WEAPON_M4, 10, true);
playa->SetCurrentWeapon(WEAPON_M4);
CStreaming::SetModelIsDeletable(MODEL_M4);
}
};
}
} playerWeapon;