SetObjectMaterial with objects with the same modelid
#1

Hey guys,
Is there any way to set the object material to EVERY object which has the same modelid?
So that you wont have to use arrays or simple variables for each object you create?
Thanks.
Reply
#2

loop?
Reply
#3

But there is no way to get the objectid of objects. Sure you can do stuff like:

for(new o = 0; o < MAX_OBJECTS; o++)

But that would just get every object, but not the id if I am correct, cus there is nothing like GetObjectID(); unlike GetPlayerVehicleID(
Reply
#4

It's not that hard to store the information about the object in variables, using the ID that's produced when you call Create(Dynamic)Object.

PHP код:
enum objectData
{
     
objectModel //, whatever else you want
}
new 
ObjectData[MAX_OBJECTS][objectData];
// Farther down the script, where you spawn your objects.
stock CreateObjectEx(blablablamodelblablabla)
{
      new 
oID CreateObject(blabla); ObjectData[oID][objectModel] = model;

Or something. You'll think of a good way.
Reply
#5

pawn Код:
stock CreateObjectEx(blablabla, model, blablabla)
{
      switch(model)
{

}
}
Reply
#6

thnx guys,
but thats not really what I wanted..
I found a way myself.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)