SetObjectMaterial question - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetObjectMaterial question (
/showthread.php?tid=631622)
SetObjectMaterial question -
1fret - 01.04.2017
is there a way to change muliply object textures without having to repeat the code setobjectmarital muliply time? , im thinking of something like an if statement or so......
Also could you help me with trying to read from a specific line in a y_ini file?
Re: SetObjectMaterial question -
Jefff - 01.04.2017
1. Yes its possible, use loop + GetObjectModel
2. Search y_ini tutorials
http://forum.sa-mp.com/forumdisplay.php?f=70
Re: SetObjectMaterial question -
1fret - 01.04.2017
Quote:
Originally Posted by Jefff
|
PHP код:
//So it would be something like this?
for(new i; i<MAX_OBJECTS; i++)
{
if(GetObjectModel(i))
{
}
}
But my issue is, isn't the (i) stands for like playerid?
Re: SetObjectMaterial question -
Jefff - 02.04.2017
Yes this is 'playerid' ( objectid ) you want to change material and you need use modelid in if statement
for single model
pawn Код:
if(GetObjectModel(i) == 1500)
{
// change material here
}
or multiple models
pawn Код:
switch(GetObjectModel(i))
{
case model_here: SetObjectMaterial(...);
case model_here: SetObjectMaterial(...);
case model_here: SetObjectMaterial(...);
}
Re: SetObjectMaterial question -
1fret - 02.04.2017
Quote:
Originally Posted by Jefff
Yes this is 'playerid' ( objectid ) you want to change material and you need use modelid in if statement
for single model
pawn Код:
if(GetObjectModel(i) == 1500) { // change material here }
or multiple models
pawn Код:
switch(GetObjectModel(i)) { case model_here: SetObjectMaterial(...); case model_here: SetObjectMaterial(...); case model_here: SetObjectMaterial(...); }
|
Thank you very much ... rep+
but about the .ini issue i spent a couple minutes searching and reading about the include but i dont understand the explanation