SetObjectMaterial prolem
#1

Hi guys,

I have a problem. Why the texture doesn't set for all objects correctly?


This is the code:

pawn Код:
stock Remove( playerid )
{
    ...
    RemoveBuildingForPlayer( playerid, 10983, -2076.6484, 222.8516, 31.2188, 0.25 );
    RemoveBuildingForPlayer( playerid, 11143, -2076.6484, 222.8516, 31.2188, 0.25 );
    RemoveBuildingForPlayer( playerid, 11339, -2079.9531, 159.2031, 30.8672, 0.25 );
    RemoveBuildingForPlayer( playerid, 11340, -2079.9531, 159.2031, 30.8672, 0.25 );
    RemoveBuildingForPlayer( playerid, 11223, -2049.1719, 250.3203, 33.0781, 0.25 );
    RemoveBuildingForPlayer( playerid, 11226, -2049.1719, 250.3203, 29.3750, 0.25 );
    return 1;
}
stock LoadObjects( )
{
    ...
    variable[ 0 ] = CreateObject( 11340, -2079.95, 159.20, 30.87, 0.00, 0.00, 0.00 );
    variable[ 1 ] = CreateObject( 10983, -2076.65, 222.85, 31.22, 0.00, 0.00, 0.00 );
    variable[ 2 ] = CreateObject( 11223, -2049.1719, 250.3203, 33.0781, 0.00, 0.00, 0.00 );
    variable[ 3 ] = CreateObject( 11143, -2076.6484, 222.8516, 31.2188, 0.00, 0.00, 0.00 );
    variable[ 4 ] = CreateObject( 11223, -2049.1719, 250.3203, 33.0781, 0.00, 0.00, 0.00 );
    variable[ 5 ] = CreateObject( 11339, -2079.9531, 159.2031, 30.8672, 0.00, 0.00, 0.00 );
    variable[ 6 ] = CreateObject( 11226, -2049.1719, 250.3203, 29.3750, 0.00, 0.00, 0.00 );
    return 1;
}

stock AnotherStock( )
{
    SetObjectMaterial( variable[ 0 ], 0, 10972, "groundbit_sfse", "desgreengrass", 0 );
    SetObjectMaterial( variable[ 1 ], 1, 10972, "groundbit_sfse", "desgreengrass", 0 );
    SetObjectMaterial( variable[ 2 ], 2, 10972, "groundbit_sfse", "desgreengrass", 0 );
    SetObjectMaterial( variable[ 3 ], 3, 10972, "groundbit_sfse", "desgreengrass", 0 );
    SetObjectMaterial( variable[ 4 ], 4, 10972, "groundbit_sfse", "desgreengrass", 0 );
    SetObjectMaterial( variable[ 5 ], 5, 10972, "groundbit_sfse", "desgreengrass", 0 );
    SetObjectMaterial( variable[ 6 ], 6, 10972, "groundbit_sfse", "desgreengrass", 0 );
}
Thanks!
Reply
#2

Read this: https://sampforum.blast.hk/showthread.php?tid=331497

Код:
stock AnotherStock( )
{
    SetObjectMaterial( variable[ 0 ], 0, 10972, "groundbit_sfse", "desgreengrass", 0 );
    SetObjectMaterial( variable[ 1 ], 1, 10972, "groundbit_sfse", "desgreengrass", 0 );
    SetObjectMaterial( variable[ 2 ], 2, 10972, "groundbit_sfse", "desgreengrass", 0 );
    SetObjectMaterial( variable[ 3 ], 3, 10972, "groundbit_sfse", "desgreengrass", 0 );
    SetObjectMaterial( variable[ 4 ], 4, 10972, "groundbit_sfse", "desgreengrass", 0 );
    SetObjectMaterial( variable[ 5 ], 5, 10972, "groundbit_sfse", "desgreengrass", 0 );
    SetObjectMaterial( variable[ 6 ], 6, 10972, "groundbit_sfse", "desgreengrass", 0 );
}
The numbers in bold are the problem. You can try them all as 0 (zero) but each index changes for each object.
Reply
#3

Oh, thanks! I thought the bold parameter is like iconid in SetPlayerMapIcon .
Reply
#4

Sorry for double post... I think I found a SetObjectMaterial bug. Just look at the video:
http://tinypic.com/r/2vukks2/5
Reply
#5

Did you delete the original objects?
Reply
#6

Quote:
Originally Posted by zgintasz
Посмотреть сообщение
Sorry for double post... I think I found a SetObjectMaterial bug. Just look at the video:
http://tinypic.com/r/2vukks2/5
I don't think it's classed as a bug. Just increase the objects draw distance so that it doesn't fade out as you get further away.
Reply
#7

Quote:
Originally Posted by Manuel_P
Посмотреть сообщение
Did you delete the original objects?
Yes, look at the top of the topic and you will see my code.
Quote:
Originally Posted by Psymetrix
Посмотреть сообщение
I don't think it's classed as a bug. Just increase the objects draw distance so that it doesn't fade out as you get further away.
I set draw distance to 300.0. Thanks, now it's better.
Reply
#8

Use Jernejl's map editor to remove the buildings, that way the LOD textures are removed with the object (not sure if it's calld LOD lol)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)