pawn Код:
CreateBlock(blockmodel,Float:x, Float:y, Float:z,rot=0)
{
new ob;
if(blockmodel<DECORATIONS_ID)
{
ob = CreateDynamicObjectEx(CUBE_MODEL[blockmodel],x,y,z, 0,0,0,900,100);
SetDynamicObjectMaterial(ob, 0, cmodel[blockmodel], ctxd[blockmodel], ctexture[blockmodel], ccolor[blockmodel]);
BlockX[ob]=x;
BlockY[ob]=y;
BlockZ[ob]=z;
}
else
{
if(DECO_MODEL[blockmodel-DECORATIONS_ID]==DOOR_1 || DECO_MODEL[blockmodel-DECORATIONS_ID]==DOOR_2) return CreateDoor(blockmodel,x,y,z,rot);
if(DECO_MODEL[blockmodel-DECORATIONS_ID]==SIGN) return CreateSign(blockmodel,x,y,z,rot);
if(rot==0) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x+DECO_X_INDEX[blockmodel-DECORATIONS_ID],y+DECO_Y_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
if(rot==90) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x-DECO_Y_INDEX[blockmodel-DECORATIONS_ID],y+DECO_X_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
if(rot==180) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x-DECO_X_INDEX[blockmodel-DECORATIONS_ID],y-DECO_Y_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
if(rot==270) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x+DECO_Y_INDEX[blockmodel-DECORATIONS_ID],y-DECO_X_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
BlockX[ob]=x;
BlockY[ob]=y;
BlockZ[ob]=z;
}
BlockAdd[ob]=-1;
return ob;
}
CreateDoor(blockmodel,Float:x,Float:y,Float:z,rot=0)
{
new ob,dob[4];
if(rot==0) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x+DECO_X_INDEX[blockmodel-DECORATIONS_ID],y+DECO_Y_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
if(rot==90) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x-DECO_Y_INDEX[blockmodel-DECORATIONS_ID],y+DECO_X_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
if(rot==180) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x-DECO_X_INDEX[blockmodel-DECORATIONS_ID],y-DECO_Y_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
if(rot==270) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x+DECO_Y_INDEX[blockmodel-DECORATIONS_ID],y-DECO_X_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
if(rot==0)
{
dob[0] = CreateDynamicObjectEx(DOOR_RAM_MODEL,x+DECO_X_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_X,y+DECO_Y_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_Y,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_Z, DOOR_RIGHT_ROT_X,DOOR_RIGHT_ROT_Y,DOOR_RIGHT_ROT_Z+rot,900,100);
}
if(rot==90)
{
dob[0] = CreateDynamicObjectEx(DOOR_RAM_MODEL,x-DECO_Y_INDEX[blockmodel-DECORATIONS_ID]-DOOR_RIGHT_Y,y+DECO_X_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_X,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_Z, DOOR_RIGHT_ROT_X,DOOR_RIGHT_ROT_Y,DOOR_RIGHT_ROT_Z+rot,900,100);
}
if(rot==180)
{
dob[0] = CreateDynamicObjectEx(DOOR_RAM_MODEL,x-DECO_X_INDEX[blockmodel-DECORATIONS_ID]-DOOR_RIGHT_X,y-DECO_Y_INDEX[blockmodel-DECORATIONS_ID]-DOOR_RIGHT_Y,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_Z, DOOR_RIGHT_ROT_X,DOOR_RIGHT_ROT_Y,DOOR_RIGHT_ROT_Z+rot,900,100);
}
if(rot==270)
{
dob[0] = CreateDynamicObjectEx(DOOR_RAM_MODEL,x+DECO_Y_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_Y,y-DECO_X_INDEX[blockmodel-DECORATIONS_ID]-DOOR_RIGHT_X,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+DOOR_RIGHT_Z, DOOR_RIGHT_ROT_X,DOOR_RIGHT_ROT_Y,DOOR_RIGHT_ROT_Z+rot,900,100);
}
BlockX[ob]=x;
BlockY[ob]=y;
BlockZ[ob]=z;
BlockAdd[ob]=dob[0];
return ob;
}
CreateSign(blockmodel,Float:x,Float:y,Float:z,rot=0)
{
new ob,dob[4];
if(rot==0) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x+DECO_X_INDEX[blockmodel-DECORATIONS_ID],y+DECO_Y_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
if(rot==90) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x-DECO_Y_INDEX[blockmodel-DECORATIONS_ID],y+DECO_X_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
if(rot==180) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x-DECO_X_INDEX[blockmodel-DECORATIONS_ID],y-DECO_Y_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
if(rot==270) ob = CreateDynamicObjectEx(DECO_MODEL[blockmodel-DECORATIONS_ID],x+DECO_Y_INDEX[blockmodel-DECORATIONS_ID],y-DECO_X_INDEX[blockmodel-DECORATIONS_ID],z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID], 0,0,rot,900,100);
if(rot==0)
{
dob[0] = CreateDynamicObjectEx(SIGN_RAM_MODEL,x+DECO_X_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_X,y+DECO_Y_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_Y,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_Z, SIGN_RIGHT_ROT_X,SIGN_RIGHT_ROT_Y,SIGN_RIGHT_ROT_Z+rot,900,100);
}
if(rot==90)
{
dob[0] = CreateDynamicObjectEx(SIGN_RAM_MODEL,x-DECO_Y_INDEX[blockmodel-DECORATIONS_ID]-SIGN_RIGHT_Y,y+DECO_X_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_X,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_Z, SIGN_RIGHT_ROT_X,SIGN_RIGHT_ROT_Y,SIGN_RIGHT_ROT_Z+rot,900,100);
}
if(rot==180)
{
dob[0] = CreateDynamicObjectEx(SIGN_RAM_MODEL,x-DECO_X_INDEX[blockmodel-DECORATIONS_ID]-SIGN_RIGHT_X,y-DECO_Y_INDEX[blockmodel-DECORATIONS_ID]-SIGN_RIGHT_Y,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_Z, SIGN_RIGHT_ROT_X,SIGN_RIGHT_ROT_Y,SIGN_RIGHT_ROT_Z+rot,900,100);
}
if(rot==270)
{
dob[0] = CreateDynamicObjectEx(SIGN_RAM_MODEL,x+DECO_Y_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_Y,y-DECO_X_INDEX[blockmodel-DECORATIONS_ID]-SIGN_RIGHT_X,z+DECO_Z_INDEX[blockmodel-DECORATIONS_ID]+SIGN_RIGHT_Z, SIGN_RIGHT_ROT_X,SIGN_RIGHT_ROT_Y,SIGN_RIGHT_ROT_Z+rot,900,100);
}
SetDynamicObjectMaterialText(dob[0],0,"Blank sign",OBJECT_MATERIAL_SIZE_256x128,"Arial",36,1,0xFF000000,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
BlockX[ob]=x;
BlockY[ob]=y;
BlockZ[ob]=z;
BlockAdd[ob]=dob[0];
return ob;
}