Show a objects model ID?
#1

Hey guys if i run a loop around all objects and create a 3dlabel what method would be suggested to gain the objects MODEL ID?

pawn Код:
for(new i = 0; i < MAX_OBJECTS; i++)
{
    format(string, sizeof(string), "Model ID: %d",  ???);
}
Thanks in advance, Lorenc


Note: The previous topic i created makes me crash when i click the topic link, IDK why maybe i just pasted too much code? IF any admin/mod sees this please remove that topc 'Short way of defining a object list?'
Reply
#2

i think you need distance from a object... that means you have too much labels that server can contain
pawn Код:
for(new i = 0; i < MAX_OBJECTS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, i))
    {
    format(string, sizeof(string), "Model ID: %d",  ???);
}
}
(NOT TESTED and might not work)
Reply
#3

There is no native function for getting object's modelid. You need to save the modelids when creating objects.
Reply
#4

Код:
const MaxObjectsAndLabels=1000;
new Object[MaxObjectsAndLabels];
new ObjectModelID[MaxObjectsAndLabels];
// at each
//Object[id]=CreateDynamicObject(ModelID,...);
// add a
//ObjectModelID[id]=ModelID;
// then you can obtain its ModelID by using its arrayed [id]:
format(string, sizeof(string), "ObjectID:%4d ModelID:%5d", id,  ObjectModelID[id]);
Reply
#5

bump... Those things up the top aren't working. And is everyone sure you can't do this
Reply
#6

https://sampforum.blast.hk/showthread.php?tid=175118
Reply
#7

o.0 thanks, ill look through it, although not make a edit since i aint one of those ppl.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)