21.12.2010, 11:59
How can i add objects on interiors? I want to optimise my server and i want to add some objects in lspd but i don't know how.
15 3 288.4723 170.0647 1007.1794 22.0477 Las Venturas Police Department ;
native CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 200.0);
new Object[20];
public OnGameModeInit() { Object[0]=CreateDynamicObject(1501,187.9120,156.7346,1002.0236,0,0,90,-1,3,-1,50);//door 1 Object[1]=CreateDynamicObject(1501,187.9120,159.7348,1002.0236,0,0,-90,-1,3,-1,50);//door 2 return 1; }
i mapped 4 doors in the LVPD interior, ill show you how to create 2 of them ^^
one thing you need, is the interior ID. its stored in the GTA Server/scriptfiles/properties/interiors.txt open that file with notepad, and search for the line containing Код:
15 3 288.4723 170.0647 1007.1794 22.0477 Las Venturas Police Department ; so all you need, is the 3. as you see in the CreateObject function (https://sampwiki.blast.hk/wiki/CreateObject), it is not supporting virtual worlds nor interiors. you would need to script that for yourself, OR have a look at the streamer plugin (https://sampforum.blast.hk/showthread.php?tid=102865), pay attention to the Код:
native CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 200.0); edit: i presume you will use the streamer, this solution wont work with the standard function! after declaring, lets say, 20 objecs in an array at your top of the gamemode/filterscript.. Код:
new Object[20]; Код:
public OnGameModeInit() { Object[0]=CreateDynamicObject(1501,187.9120,156.7346,1002.0236,0,0,90,-1,3,-1,50);//door 1 Object[1]=CreateDynamicObject(1501,187.9120,159.7348,1002.0236,0,0,-90,-1,3,-1,50);//door 2 return 1; } |