SetObjectMaterial problem
#1

Hello my friend mapped map which he want to set some materials on it but when i put material in game is Sand Material not showed.I am doing this first time..so please help me

code:
pawn Код:
new obj;
obj = CreateDynamicObject(6959,1663.05859375,-1561.73535156,-7.46702766,90.00000000,0.00000000,269.98901367); //tento1
    obj = CreateDynamicObject(6959,1662.96533203,-1520.50451660,-7.44203091,90.00000000,0.00000000,269.98901367); //tento2
    obj = CreateDynamicObject(6959,1652.89746094,-1520.17871094,-7.44202757,90.00000000,0.00000000,269.99450684); //tento3
    obj = CreateDynamicObject(6959,1652.07128906,-1552.18017578,-7.44202757,87.49993896,0.00000000,269.98901367); //tento4
    obj = CreateDynamicObject(4199,1665.06250000,-1467.11718750,6.70912743,0.00000000,90.00000000,179.99450684); //object(garages1_lan) (5)
    obj = CreateDynamicObject(4199,1665.08496094,-1477.06152344,6.70912743,0.00000000,90.00000000,179.99450684); //object(garages1_lan) (6)
    obj = CreateDynamicObject(4199,1650.86328125,-1466.06640625,6.70912743,0.00000000,90.00000000,0.00000000); //object(garages1_lan) (3)
    obj = CreateDynamicObject(4199,1653.05053711,-1497.16943359,6.40912628,0.00000000,68.74996948,0.00000000); //object(garages1_lan) (4)
    SetObjectMaterial(obj,3,4242,"seabed","des_dirt1");
Reply
#2

pawn Код:
new obj[7];
    obj[0] = CreateDynamicObject(6959,1663.05859375,-1561.73535156,-7.46702766,90.00000000,0.00000000,269.98901367); //tento1
    obj[1] = CreateDynamicObject(6959,1662.96533203,-1520.50451660,-7.44203091,90.00000000,0.00000000,269.98901367); //tento2
    obj[2] = CreateDynamicObject(6959,1652.89746094,-1520.17871094,-7.44202757,90.00000000,0.00000000,269.99450684); //tento3
    obj[3] = CreateDynamicObject(6959,1652.07128906,-1552.18017578,-7.44202757,87.49993896,0.00000000,269.98901367); //tento4
    obj[4] = CreateDynamicObject(4199,1665.06250000,-1467.11718750,6.70912743,0.00000000,90.00000000,179.99450684); //object(garages1_lan) (5)
    obj[5] = CreateDynamicObject(4199,1665.08496094,-1477.06152344,6.70912743,0.00000000,90.00000000,179.99450684); //object(garages1_lan) (6)
    obj[6] = CreateDynamicObject(4199,1650.86328125,-1466.06640625,6.70912743,0.00000000,90.00000000,0.00000000); //object(garages1_lan) (3)
    obj[7] = CreateDynamicObject(4199,1653.05053711,-1497.16943359,6.40912628,0.00000000,68.74996948,0.00000000); //object(garages1_lan) (4)
    for(new i=0; i < 7; i++)
    {
    SetObjectMaterial(obj[i],3,4242,"seabed","des_dirt1");
    }
Try this, i didn't test it, so tell me if it works
Reply
#3

Quote:
Originally Posted by Jari_Johnson*
Посмотреть сообщение
pawn Код:
new obj[7];
    obj[0] = CreateDynamicObject(6959,1663.05859375,-1561.73535156,-7.46702766,90.00000000,0.00000000,269.98901367); //tento1
    obj[1] = CreateDynamicObject(6959,1662.96533203,-1520.50451660,-7.44203091,90.00000000,0.00000000,269.98901367); //tento2
    obj[2] = CreateDynamicObject(6959,1652.89746094,-1520.17871094,-7.44202757,90.00000000,0.00000000,269.99450684); //tento3
    obj[3] = CreateDynamicObject(6959,1652.07128906,-1552.18017578,-7.44202757,87.49993896,0.00000000,269.98901367); //tento4
    obj[4] = CreateDynamicObject(4199,1665.06250000,-1467.11718750,6.70912743,0.00000000,90.00000000,179.99450684); //object(garages1_lan) (5)
    obj[5] = CreateDynamicObject(4199,1665.08496094,-1477.06152344,6.70912743,0.00000000,90.00000000,179.99450684); //object(garages1_lan) (6)
    obj[6] = CreateDynamicObject(4199,1650.86328125,-1466.06640625,6.70912743,0.00000000,90.00000000,0.00000000); //object(garages1_lan) (3)
    obj[7] = CreateDynamicObject(4199,1653.05053711,-1497.16943359,6.40912628,0.00000000,68.74996948,0.00000000); //object(garages1_lan) (4)
    for(new i=0; i < 7; i++)
    {
    SetObjectMaterial(obj[i],3,4242,"seabed","des_dirt1");
    }
Try this, i didn't test it, so tell me if it works
It`s not working anyone can help me fast?
Reply
#4

Код:
new obj[8];
    obj[0] = CreateDynamicObject(6959,1663.05859375,-1561.73535156,-7.46702766,90.00000000,0.00000000,269.98901367); //tento1
    obj[1] = CreateDynamicObject(6959,1662.96533203,-1520.50451660,-7.44203091,90.00000000,0.00000000,269.98901367); //tento2
    obj[2] = CreateDynamicObject(6959,1652.89746094,-1520.17871094,-7.44202757,90.00000000,0.00000000,269.99450684); //tento3
    obj[3] = CreateDynamicObject(6959,1652.07128906,-1552.18017578,-7.44202757,87.49993896,0.00000000,269.98901367); //tento4
    obj[4] = CreateDynamicObject(4199,1665.06250000,-1467.11718750,6.70912743,0.00000000,90.00000000,179.99450684); //object(garages1_lan) (5)
    obj[5] = CreateDynamicObject(4199,1665.08496094,-1477.06152344,6.70912743,0.00000000,90.00000000,179.99450684); //object(garages1_lan) (6)
    obj[6] = CreateDynamicObject(4199,1650.86328125,-1466.06640625,6.70912743,0.00000000,90.00000000,0.00000000); //object(garages1_lan) (3)
    obj[7] = CreateDynamicObject(4199,1653.05053711,-1497.16943359,6.40912628,0.00000000,68.74996948,0.00000000); //object(garages1_lan) (4)
    for(new i=0; i < 7; i++)
    {
    SetObjectMaterial(obj[i],3,4242,"seabed","des_dirt1");
    }
Reply
#5

Quote:
Originally Posted by Shetch
Посмотреть сообщение
Код:
new obj[8];
    obj[0] = CreateDynamicObject(6959,1663.05859375,-1561.73535156,-7.46702766,90.00000000,0.00000000,269.98901367); //tento1
    obj[1] = CreateDynamicObject(6959,1662.96533203,-1520.50451660,-7.44203091,90.00000000,0.00000000,269.98901367); //tento2
    obj[2] = CreateDynamicObject(6959,1652.89746094,-1520.17871094,-7.44202757,90.00000000,0.00000000,269.99450684); //tento3
    obj[3] = CreateDynamicObject(6959,1652.07128906,-1552.18017578,-7.44202757,87.49993896,0.00000000,269.98901367); //tento4
    obj[4] = CreateDynamicObject(4199,1665.06250000,-1467.11718750,6.70912743,0.00000000,90.00000000,179.99450684); //object(garages1_lan) (5)
    obj[5] = CreateDynamicObject(4199,1665.08496094,-1477.06152344,6.70912743,0.00000000,90.00000000,179.99450684); //object(garages1_lan) (6)
    obj[6] = CreateDynamicObject(4199,1650.86328125,-1466.06640625,6.70912743,0.00000000,90.00000000,0.00000000); //object(garages1_lan) (3)
    obj[7] = CreateDynamicObject(4199,1653.05053711,-1497.16943359,6.40912628,0.00000000,68.74996948,0.00000000); //object(garages1_lan) (4)
    for(new i=0; i < 7; i++)
    {
    SetObjectMaterial(obj[i],3,4242,"seabed","des_dirt1");
    }
Not working someone can fix it?
Reply
#6

loose the dynamic part, it won't work on objects created with a streamer
Reply
#7

First of all the 6959 object only has ONE material index - 0 - and you're setting 3. Second of all you're creating DYNAMIC objects but setting the material of NON-DYNAMIC objects.
Reply
#8

in other words...
pawn Код:
SetDynamicObjectMaterial(obj[i],0,4242,"seabed","des_dirt1");
this is what MP2 said..
when you create a Dynamic object, you should use the dynamic features of the streamer to control it...
MoveDynamicObject, DestroyDynamicObject, and so on..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)