Really good tutorial, as Cryder said, Incognito's streamer is an amazing tool.
I wonder what method would you use in order to identify different properties, for example, differentiate between houses and businesses.
I used arrays in order to save two values, the first one indicates the property type and the second one the id of the property.
PHP Code:
CreateHouse(index)
{
new array[2];
array[0] = 1; /* House */
array[1] = index;
h_Info[index][Area] = CreateDynamicSphere(...);
Streamer_SetArrayData(STREAMER_TYPE_AREA, h_Info[index][Area], E_STREAMER_EXTRA_ID, array, 2);
return 1;
}
CreateBusiness(index)
{
new array[2];
array[0] = 2; /* Business */
array[1] = index;
b_Info[index][Area] = CreateDynamicSphere(...);
Streamer_SetArrayData(STREAMER_TYPE_AREA, b_Info[index][Area], E_STREAMER_EXTRA_ID, array, 2);
return 1;
}
Then:
PHP Code:
public OnPlayerEnterDynamicArea(playerid, areaid)
{
new array[2];
Streamer_GetArrayData(STREAMER_TYPE_AREA, areaid, E_STREAMER_EXTRA_ID, array, 2);
switch(array[0])
{
case 1: /* House */
{
SetPlayerPos(playerid, h_Info[array[1]][IntPos][0], ...);
}
case 2: /* Business */
{
SetPlayerPos(playerid, b_Info[array[1]][IntPos][0], ...);
}
}
return 1;
}
What method would you use guys?