I have a code which looks something like this. Basically what I wanted to do was change multiple textures for a single object and ofc it didn't work out the way I imagined it. Could you show me the proper way of scripting things like these for further works? IkIk, the code might look dumb but I was trying to find the possible solution, then I gave up and decided to ask for your advice.
Код:
//Jeff #2 walls
stock CustObjectJeff2(objectid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) //
{
new Jeff2=CreateDynamicObject(objectid, x, y, z, rx, ry, rz); //
SetDynamicObjectMaterial(Jeff2, 7, 14425, "madbedrooms", "ah_wallstyle1", 0); //
SetDynamicObjectMaterial(Jeff2, 6, 14425, "madbedrooms", "ah_wallstyle1", 0); //
SetDynamicObjectMaterial(Jeff2, 3, 14425, "madbedrooms", "ah_wallstyle1", 0); //
SetDynamicObjectMaterial(Jeff2, 2, 14425, "madbedrooms", "ah_wallstyle1", 0); //
SetDynamicObjectMaterial(Jeff2, 17, 9362, "sfn_byofficeint", "CJ_WOOD5", 0); //Jeff #2 roof (wood covers)
SetDynamicObjectMaterial(Jeff2, 16, 14602, "papaerchaseoffice", "gun_ceiling1", 0); //Jeff #2 roof (white blocks)
SetDynamicObjectMaterial(Jeff2, 11, 2817, "gb_bedrmrugs01", "GB_rugbedroom01", 0); //Jeff #2 floor
SetDynamicObjectMaterial(Jeff2, 13, 14525, "imy_motel2", "Bow_bar_top", 0xFFAA481A); //Wooden fringe for the walls of the Jeff #2
}
public OnFilterScriptInit()
{
CustObjectJeff2(14506,1292.2497600,-1337.1656500,1086.2578100,0.0000000,0.0000000,0.0000000); //
}
Eh, I somehow managed to compile the code but when I load the map IG the textures are black for these 2 objects.
Код:
new Jeff1;
Jeff1 = CreateDynamicObject(14525,1292.2441400,-1337.1586900,1086.2578100,0.0000000,0.0000000,0.0000000); //
SetDynamicObjectMaterial(Jeff1, 22, 14425, "madbedrooms", "ah_wallstyle1", 0); //
SetDynamicObjectMaterial(Jeff1, 8, 14425, "madbedrooms", "ah_wallstyle1", 0); //
SetDynamicObjectMaterial(Jeff1, 7, 14425, "madbedrooms", "ah_wallstyle1", 0); //
SetDynamicObjectMaterial(Jeff1, 4, 14425, "madbedrooms", "ah_wallstyle1", 0); //
SetDynamicObjectMaterial(Jeff1, 3, 14425, "madbedrooms", "ah_wallstyle1", 0); //
SetDynamicObjectMaterial(Jeff1, 2, 14425, "madbedrooms", "ah_wallstyle1", 0); //
SetDynamicObjectMaterial(Jeff1, 18, 14602, "papaerchaseoffice", "gun_ceiling1", 0); //Jeff #1 roof (white blocks)
SetDynamicObjectMaterial(Jeff1, 19, 9362, "sfn_byofficeint", "CJ_WOOD5", 0); //Jeff #1 roof (wood covers)
SetDynamicObjectMaterial(Jeff1, 13, 2817, "gb_bedrmrugs01", "GB_rugbedroom01", 0); //Jeff #1 floor
SetDynamicObjectMaterial(Jeff1, 15, 14525, "imy_motel2", "Bow_bar_top", 0xFFAA481A); //Wooden fringe for the walls of Jeff #1
new Jeff2;
Jeff2 = CreateDynamicObject(14506,1292.2497600,-1337.1656500,1086.2578100,0.0000000,0.0000000,0.0000000); //
SetDynamicObjectMaterial(Jeff2, 7, 14425, "madbedrooms", "ah_wallstyle1", 0); //
SetDynamicObjectMaterial(Jeff2, 6, 14425, "madbedrooms", "ah_wallstyle1", 0); //
SetDynamicObjectMaterial(Jeff2, 3, 14425, "madbedrooms", "ah_wallstyle1", 0); //
SetDynamicObjectMaterial(Jeff2, 2, 14425, "madbedrooms", "ah_wallstyle1", 0); //
SetDynamicObjectMaterial(Jeff2, 17, 9362, "sfn_byofficeint", "CJ_WOOD5", 0); //Jeff #2 roof (wood covers)
SetDynamicObjectMaterial(Jeff2, 16, 14602, "papaerchaseoffice", "gun_ceiling1", 0); //Jeff #2 roof (white blocks)
SetDynamicObjectMaterial(Jeff2, 11, 2817, "gb_bedrmrugs01", "GB_rugbedroom01", 0); //Jeff #2 floor
SetDynamicObjectMaterial(Jeff2, 13, 14525, "imy_motel2", "Bow_bar_top", 0xFFAA481A); //Wooden fringe for the walls of the Jeff #2