Posts: 617
Threads: 129
Joined: Feb 2014
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?
Posts: 2,593
Threads: 34
Joined: Dec 2007
1. Yes its possible, use loop + GetObjectModel
2. Search y_ini tutorials
http://forum.sa-mp.com/forumdisplay.php?f=70
Posts: 617
Threads: 129
Joined: Feb 2014
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?
Posts: 2,593
Threads: 34
Joined: Dec 2007
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(...);
}
Posts: 617
Threads: 129
Joined: Feb 2014
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