[Tutorial] Smart use of the Streamer [Incognito]
#7

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.
Quote:
Originally Posted by Jingles
// If you plan on using this in more systems, make sure the areaid equals that of the respective propery too!
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_AREAh_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_AREAb_Info[index][Area], E_STREAMER_EXTRA_ID, array, 2);
    return 
1;

Then:
PHP Code:
public OnPlayerEnterDynamicArea(playeridareaid)
{
    new array[
2];
    
Streamer_GetArrayData(STREAMER_TYPE_AREAareaidE_STREAMER_EXTRA_ID, array, 2);
    switch(array[
0])
    {
        case 
1/* House */
        
{
            
SetPlayerPos(playeridh_Info[array[1]][IntPos][0], ...);
        }
        case 
2/* Business */
        
{
            
SetPlayerPos(playeridb_Info[array[1]][IntPos][0], ...);
        } 
    }
    return 
1;

What method would you use guys?
Reply


Messages In This Thread
Smart use of the Streamer [Incognito] - by Jingles - 09.07.2016, 20:49
Re: Smart use of the Streamer [Incognito] - by Jingles - 09.07.2016, 20:54
Re: Smart use of the Streamer [Incognito] - by Abagail - 09.07.2016, 20:55
Re: Smart use of the Streamer [Incognito] - by Luis- - 09.07.2016, 21:16
Re: Smart use of the Streamer [Incognito] - by Crayder - 09.07.2016, 21:19
Re: Smart use of the Streamer [Incognito] - by PrO.GameR - 09.07.2016, 22:44
Re: Smart use of the Streamer [Incognito] - by RIDE2DAY - 05.08.2016, 18:42
Re: Smart use of the Streamer [Incognito] - by Jingles - 06.08.2016, 09:44
Re: Smart use of the Streamer [Incognito] - by Sioux - 06.08.2016, 16:41
Re: Smart use of the Streamer [Incognito] - by Konstantinos - 06.08.2016, 17:06
Re: Smart use of the Streamer [Incognito] - by zsoolt997 - 11.08.2016, 16:15

Forum Jump:


Users browsing this thread: 5 Guest(s)