A small question -
DemME - 02.11.2015
It is possible to put objects within a file, and everytime I get the server on it will reload the map from the file itself instead of spamming my gamemode with mapping and such.
Re: A small question -
Kevln - 02.11.2015
Yes, it is.
Re: A small question -
DemME - 02.11.2015
Quote:
Originally Posted by Kevln
Yes, it is.
|
Arh-.. and how do I do so?
Re: A small question -
rangerxxll - 02.11.2015
Filterscripts are a great way. We keep all of our mapping in one - then reload the filterscript everytime we do a gmx. Quite easy to create.
Re: A small question -
ThePhenix - 02.11.2015
Quote:
Originally Posted by DemME
Arh-.. and how do I do so?
|
You could have them stored in a file using a specifier to separate the object model, x, y, z positions, x, y, z rotations respectively and finally use sscanf.
Imagine I have a file called
objects.txt in the scriptfiles folder, and I've predefined the following format to store the objects in the file:
Код:
Object model|PosX|PosY|PosZ|RotX|RotY|RotZ
Note I'm using the | delimiter to break up the needed information for each object.
If we considerate the format stated above we might end up with a line into the file which would look like this:
Код:
19941|144.134|931.33|444.11|0.0|.0.0|0.0
4141|1444.134|1131.33|44.11|0.0|.0.0|0.0
5414|1484.134|51.33|344.11|0.0|.0.0|0.0
Now to load these objects and create them in game you would come up with something like this:
PHP код:
LoadObjects()
{
new
File:handle = fopen("objects.txt", io_read),
buf[128]
;
if(!handle) return 0;
new
model,
Float:pos[3],
Float:rot[3],
count
;
while(fread(handle, buf))
{
if(sscanf(buf, "p<|>dffffff", model, pos[0], pos[1], pos[2], rot[0], rot[1], rot[2]))
{
count++;
CreateObject(model, pos[0], pos[1], pos[2], rot[0], rot[1], rot[2]);
}
}
fclose(handle);
printf("Objects loaded from 'objects.txt': %d objects.", count);
return 1;
}
Re: A small question -
AbyssMorgan - 02.11.2015
https://github.com/AbyssMorgan/ADM/b...pts/objsX2.pwn
Permitted record
PHP код:
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid);
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid, interiorid);
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid, interiorid, playerid);
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid, interiorid, playerid, Float:streamdistance);
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid, interiorid, playerid, Float:streamdistance, Float:drawdistance);
Re: A small question -
Gammix - 02.11.2015
https://github.com/Gammix/Map-Loader
An edit of Southclaw's map parser filterscript to an include, you can very easily move all your map code to a file and then do in your script:
pawn Код:
Map_Load("your_file_name");
Many other interesting features as well, and this only supports streamer and streamer items only.
Re: A small question -
DemME - 06.11.2015
Quote:
Originally Posted by Gammix
https://github.com/Gammix/Map-Loader
An edit of Southclaw's map parser filterscript to an include, you can very easily move all your map code to a file and then do in your script:
pawn Код:
Map_Load("your_file_name");
Many other interesting features as well, and this only supports streamer and streamer items only.
|
Genius! thanks