SetObjectMaterial question
#1

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?
Reply
#2

1. Yes its possible, use loop + GetObjectModel
2. Search y_ini tutorials http://forum.sa-mp.com/forumdisplay.php?f=70
Reply
#3

Quote:
Originally Posted by Jefff
Посмотреть сообщение
1. Yes its possible, use loop + GetObjectModel
2. Search y_ini tutorials http://forum.sa-mp.com/forumdisplay.php?f=70
PHP код:
//So it would be something like this?
for(new ii<MAX_OBJECTSi++)
{
    if(
GetObjectModel(i))
    {
    
    }

But my issue is, isn't the (i) stands for like playerid?
Reply
#4

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(...);
}
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)