31.08.2014, 20:47
Texturing tutorial
This tutorial is for people who are familiar with pawno and mapping and who want to learn how to re-texture objects. However, the tutorial is written in human's language to make it easier to understand.
All you need is a test server which can be downloaded on sa-mp forums and the mapping constructor.Click here for the link
1.-Re-texturing single objects
![](http://i1121.photobucket.com/albums/l513/TreyShaft/1-stock_zpsd531376a.png)
2.-Extract the code to pawno.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/2-pawno_zps25421369.png)
3.-Then add the includes, without them you won't be able to compile the code.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/3-pawno_zpsd6db3ebf.png)
4.-After adding the includes you should write the stock lines. This already includes a texture, we'll rewrite it later on.
Code:
![](http://i1121.photobucket.com/albums/l513/TreyShaft/4-pawno_zpsc0281625.png)
5.-Select this line and convert it to CreateDynamicObject's format by YSI on www.convertffs.com
![](http://s1121.photobucket.com/albums/l513/TreyShaft/5-pawno_zps4977fdc6.png)
The settings on the converter must be the same as below
![](http://i1121.photobucket.com/albums/l513/TreyShaft/6-convert_zpsf595f01c.png)
![](http://i1121.photobucket.com/albums/l513/TreyShaft/7-convert_zps45a7aa73.png)
-Replace the old line with this one
![](http://i1121.photobucket.com/albums/l513/TreyShaft/8-pawno_zps815f4b87.png)
6.-Now after you've converted the object to YSI (CreateDynamicObject), you must place this line under 'public OnFilterScriptInit() or OnGameModeInit - depends how do you use the objects, starting and ending with these brackets {}.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/9-pawno_zps8d168609.png)
7.-Change 'CreateDynamicObject' to your stock, so the object can take the texture from it. In this case it'll be renamed to 'CustObjectWall', like in the stock.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/10-pawno_zps08e112ee.png)
It should look like this:
![](http://i1121.photobucket.com/albums/l513/TreyShaft/11-pawno_zps493d1f69.png)
8.-Now, select your textures from http://textures.future-elife.com/ This is the easiest way to look for textures.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/12-Textures_zps9c219db5.png)
9.-Double click on the texture you want. It should bring up a small window with a code in it.
This is the objects ID you take the texture from.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/13-Textures_zps33bfc334.png)
...the id ^^ goes here (below)
![](http://i1121.photobucket.com/albums/l513/TreyShaft/14-Textures_zps1eb3a784.png)
Now, the second 'line' is something like a package from which the texture is taken, many objects might have the same 'package' of textures.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/15-Textures_zpsca1fee20.png)
...and this goes right after the ID, between the "" marks. Like shown below.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/16-Textures_zpse0d99b60.png)
The last 'line' is the exact texture from the 'package', in a single 'package' there could me many textures.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/17-Textures_zps1c2f2d38.png)
...and it goes here, also between the "" marks.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/18-Textures_zps8d6547e8.png)
10.-After you have written everything correctly compile the code and load it in your test server to check the result.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/19-Textures_zpsf9a1a3ad.png)
This tutorial is for people who are familiar with pawno and mapping and who want to learn how to re-texture objects. However, the tutorial is written in human's language to make it easier to understand.
All you need is a test server which can be downloaded on sa-mp forums and the mapping constructor.Click here for the link
1.-Re-texturing single objects
![](http://i1121.photobucket.com/albums/l513/TreyShaft/1-stock_zpsd531376a.png)
2.-Extract the code to pawno.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/2-pawno_zps25421369.png)
3.-Then add the includes, without them you won't be able to compile the code.
pawn Код:
#include <core>
#include <float>
#include <a_samp>
#include <YSI\y_ini>
#include <streamer>
![](http://i1121.photobucket.com/albums/l513/TreyShaft/3-pawno_zpsd6db3ebf.png)
4.-After adding the includes you should write the stock lines. This already includes a texture, we'll rewrite it later on.
Code:
pawn Код:
stock CustObjectWall(objectid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) //
{
new Wall=CreateDynamicObject(objectid, x, y, z, rx, ry, rz); //
SetDynamicObjectMaterial(Wall, 0, 16150, "ufo_bar", "dinerfloor01_128", 0); //
}
![](http://i1121.photobucket.com/albums/l513/TreyShaft/4-pawno_zpsc0281625.png)
5.-Select this line and convert it to CreateDynamicObject's format by YSI on www.convertffs.com
![](http://s1121.photobucket.com/albums/l513/TreyShaft/5-pawno_zps4977fdc6.png)
The settings on the converter must be the same as below
![](http://i1121.photobucket.com/albums/l513/TreyShaft/6-convert_zpsf595f01c.png)
![](http://i1121.photobucket.com/albums/l513/TreyShaft/7-convert_zps45a7aa73.png)
-Replace the old line with this one
![](http://i1121.photobucket.com/albums/l513/TreyShaft/8-pawno_zps815f4b87.png)
6.-Now after you've converted the object to YSI (CreateDynamicObject), you must place this line under 'public OnFilterScriptInit() or OnGameModeInit - depends how do you use the objects, starting and ending with these brackets {}.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/9-pawno_zps8d168609.png)
7.-Change 'CreateDynamicObject' to your stock, so the object can take the texture from it. In this case it'll be renamed to 'CustObjectWall', like in the stock.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/10-pawno_zps08e112ee.png)
It should look like this:
![](http://i1121.photobucket.com/albums/l513/TreyShaft/11-pawno_zps493d1f69.png)
8.-Now, select your textures from http://textures.future-elife.com/ This is the easiest way to look for textures.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/12-Textures_zps9c219db5.png)
9.-Double click on the texture you want. It should bring up a small window with a code in it.
This is the objects ID you take the texture from.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/13-Textures_zps33bfc334.png)
...the id ^^ goes here (below)
![](http://i1121.photobucket.com/albums/l513/TreyShaft/14-Textures_zps1eb3a784.png)
Now, the second 'line' is something like a package from which the texture is taken, many objects might have the same 'package' of textures.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/15-Textures_zpsca1fee20.png)
...and this goes right after the ID, between the "" marks. Like shown below.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/16-Textures_zpse0d99b60.png)
The last 'line' is the exact texture from the 'package', in a single 'package' there could me many textures.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/17-Textures_zps1c2f2d38.png)
...and it goes here, also between the "" marks.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/18-Textures_zps8d6547e8.png)
10.-After you have written everything correctly compile the code and load it in your test server to check the result.
![](http://i1121.photobucket.com/albums/l513/TreyShaft/19-Textures_zpsf9a1a3ad.png)