25.03.2017, 18:36
I don't have a script to generate hpp and cpp files for you, but it is easy to invoke a function, you can write it in python and run it when you update the file.
This is for AttachDynamicObjectToObject
and this is for GetDynamicObjectPos
sampgdk will call OnPublicCall when a plugin call a callback (for example streamer will call OnPlayerPickUpDynamicPickup). You can take a look here to see how you can do that, https://github.com/Zeex/sampgdk/issues/155.
Of course you can add it to an IDL file and recompile the plugin, but this is the easy way.
This is for AttachDynamicObjectToObject
Код:
const bool Object::AttachToObject(int32_t ID, int32_t AttachToID, float X, float Y, float Z, float RotationX, float RotationY, float RotationZ, bool SyncRotation) { static AMX_NATIVE Native = sampgdk::FindNative("AttachDynamicObjectToObject"); return !!sampgdk::InvokeNative(Native, "iiffffffb", ID, AttachToID, X, Y, Z, RotationX, RotationY, RotationZ, SyncRotation); }
Код:
const Point3D<float> Object::GetPosition(int32_t ID) { Point3D<float> Restult; static AMX_NATIVE Native = sampgdk::FindNative("GetDynamicObjectPos"); sampgdk::InvokeNative(Native, "iRRR", ID, &Restult.X, &Restult.Y, &Restult.Z); return Restult; }
Of course you can add it to an IDL file and recompile the plugin, but this is the easy way.