Plugin for SA:MP 0.3a R4 server
Structure Access
by 009
Плагин позволяет брать данные типов float и integer из структур сервера CPlayer , CVehicle , CObject
Изменить данные нельзя,и нет смысла делать это т.к. клиенту эти данные не передаются(сервер просто посылает эти данные остальным игрокам - синхронизация)
Для получения данных требуется знать offset нужного вам значения структуры Функции:
GetPlayerStructureInfoInt(playerid,structure_offset)
Получает значение типа integer из структуры CPlayer игрока с id = playerid с offset = structure_offset
GetPlayerStructureInfoFloat(playerid,structure_offset)
Получает значение типа float из структуры CPlayer игрока с id = playerid с offset = structure_offset
GetVehicleStructureInfoInt(vehicleid,structure_offset)
Получает значение типа integer из структуры CVehicle транспорта с id = vehicleid с offset = structure_offset
GetVehicleStructureInfoFloat(vehicleid,structure_offset)
Получает значение типа float из структуры CVehicle транспорта с id = vehicleid с offset = structure_offset
GetObjectStructureInfoInt(vehicleid,structure_offset)
Получает значение типа integer из структуры CObject обьекта с id = objectid с offset = structure_offset
GetObjectStructureInfoFloat(vehicleid,structure_offset)
Получает значение типа float из структуры CObject обьекта с id = objectid с offset = structure_offset
Примеры использования даны в samples.pwn
[pwn]// CPlayer offsets
#define CPLAYER_OFFSET_CAMERA_LOOK_OT_X 0xBF
#define CPLAYER_OFFSET_CAMERA_LOOK_OT_Y 0xC3
#define CPLAYER_OFFSET_CAMERA_LOOK_OT_Z 0xC7
#define CPLAYER_OFFSET_CAMERA_POS_X 0xD7
#define CPLAYER_OFFSET_CAMERA_POS_Y 0xDB
#define CPLAYER_OFFSET_CAMERA_POS_Z 0xDF
// CVehicle offsets
#define CVEHICLE_OFFSET_COLOR_1 0xC5
#define CVEHICLE_OFFSET_COLOR_2 0xC9
stock GetPlayerCameraPos(playerid,&Float:X,&Float:Y,&Float:Z)
{
X = GetPlayerStructureInfoFloat(playerid,CPLAYER_OFFSET_CAMERA_POS_X);
Y = GetPlayerStructureInfoFloat(playerid,CPLAYER_OFFSET_CAMERA_POS_Y);
Z = GetPlayerStructureInfoFloat(playerid,CPLAYER_OFFSET_CAMERA_POS_Z);
}
stock GetPlayerCameraLookPos(playerid,&Float:X,&Float:Y,&Float:Z)
{
X = GetPlayerStructureInfoFloat(playerid,CPLAYER_OFFSET_CAMERA_POS_X) + GetPlayerStructureInfoFloat(playerid,CPLAYER_OFFSET_CAMERA_LOOK_OT_X);
Y = GetPlayerStructureInfoFloat(playerid,CPLAYER_OFFSET_CAMERA_POS_Y) + GetPlayerStructureInfoFloat(playerid,CPLAYER_OFFSET_CAMERA_LOOK_OT_Y);
Z = GetPlayerStructureInfoFloat(playerid,CPLAYER_OFFSET_CAMERA_POS_Z) + GetPlayerStructureInfoFloat(playerid,CPLAYER_OFFSET_CAMERA_LOOK_OT_Z);
}
stock GetVehicleColor(vehicleid,&color1,&color2)
{
color1 = GetVehicleStructureInfoInt(vehicleid,CVEHICLE_OFFSET_COLOR_1);
color2 = GetVehicleStructureInfoInt(vehicleid,CVEHICLE_OFFSET_COLOR_2);
}[/pwn]
download