02.02.2010, 23:25
Okay, it's done:
I used an enum for the data rather than a string (as ****** suggested), so the new natives are very fast and easy to use. This is all in the include file, but I'll just post it here for reference:
You can use it like this:
That will retrieve gPickup's current position from the plugin.
Here's another example from the first page:
Quote:
v2.3.5: - Added data manipulation natives: Streamer_GetFloatData, Streamer_GetIntData, Streamer_SetFloatData, and Streamer_SetIntData |
pawn Код:
#define STREAMER_TYPE_OBJECT (0)
#define STREAMER_TYPE_PICKUP (1)
#define STREAMER_TYPE_CP (2)
#define STREAMER_TYPE_RACE_CP (3)
#define STREAMER_TYPE_MAP_ICON (4)
#define STREAMER_TYPE_3D_TEXT_LABEL (5)
pawn Код:
enum
{
E_STREAMER_ATTACHED_PLAYER,
E_STREAMER_ATTACHED_VEHICLE,
E_STREAMER_COLOR,
E_STREAMER_DISTANCE,
E_STREAMER_DRAW_DISTANCE,
E_STREAMER_EXTRA_ID,
E_STREAMER_INTERIOR_ID,
E_STREAMER_MARKER_TYPE,
E_STREAMER_MODEL_ID,
E_STREAMER_NEXT_X,
E_STREAMER_NEXT_Y,
E_STREAMER_NEXT_Z,
E_STREAMER_PLAYER_ID,
E_STREAMER_R_X,
E_STREAMER_R_Y,
E_STREAMER_R_Z,
E_STREAMER_SIZE,
E_STREAMER_SPEED,
E_STREAMER_TEST_LOS,
E_STREAMER_TYPE,
E_STREAMER_WORLD_ID,
E_STREAMER_X,
E_STREAMER_Y,
E_STREAMER_Z
}
pawn Код:
new
Float:x,
Float:y,
Float:z;
Streamer_GetFloatData(STREAMER_TYPE_PICKUP, gPickup, E_STREAMER_X, x);
Streamer_GetFloatData(STREAMER_TYPE_PICKUP, gPickup, E_STREAMER_Y, y);
Streamer_GetFloatData(STREAMER_TYPE_PICKUP, gPickup, E_STREAMER_Z, z);
Here's another example from the first page:
pawn Код:
Streamer_SetIntData(STREAMER_TYPE_OBJECT, gObject, E_STREAMER_MODEL_ID, 1225);