Object model help!
#1

I am making a map editor but i want to make the objects save on exit.
I tried to do this by saving the objects in an .ini file.
But in the .ini file i get this: CreateObject(0,0,100,0,0,0);
Is there any way to get all the yet created objects modelid and then save it in an .ini file?
Reply
#2

Yes there is a way, but you need to have some experience.

https://sampwiki.blast.hk/wiki/Fopen
Reply
#3

You can check some of the ini functions on their respective topics.
Reply
#4

I have not problems with .ini files, i just want to know how to get object models to an array or something so that i can save the current created objects to an .ini file.
Reply
#5

Like for x, y and z co-ords, we use:
pawn Код:
new Float:X,Float:Y,FLoat:Z;
GetPlayerPos(playerid, X, Y, Z);
//and then save the co-ords in the file
You can do something like this for the object params.
Reply
#6

I know how to save the cords.but i dont know how to take the model id of an object and thats why i made this thread.
Does anybody knows how to do this?(+REP)
Reply
#7

Hmm.. I found this maybe it will be helpful for you.

https://sampforum.blast.hk/showthread.php?tid=367718
Reply
#8

pawn Код:
new objModel[MAX_OBJECTS];

hook CreateObject like so (get y_hooks):

stock hook_CreateObject(blah blah blah)
{
    new oid = CreateObject(blah blah blah);
    objModel[oid] = model;
    return oid;
}
Reply
#9

Quote:
Originally Posted by MP2
Посмотреть сообщение
pawn Код:
new objModel[MAX_OBJECTS];

hook CreateObject like so (get y_hooks):

stock hook_CreateObject(blah blah blah)
{
    new oid = CreateObject(blah blah blah);
    objModel[oid] = model;
    return oid;
}
Код:
CreateObject(objModel[oid],x,y,z,0,0,0,300.0);
It till give me the model id of the last created object.
How can i use it to take all the yet created objects model id and then save them in an .ini file?
Reply
#10

Maybe I think the function you want doesn't exist. Try making all the objects and save them in the file using MP2's code. Hope it might work it out for you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)