CreateDynamicObject doesnt create object.
#1

hello all i have a furniture script that i have been developing but i found out i cant load back my furnitures. Then i realised i can just do createobject when i buy but after buying it doesnt create dynamic object so i added this code only to check:

Код:
CMD:cdo(playerid,params[])
{
	new Float:tpx,Float:tpy,Float:tpz;
	CreateDynamicObject(2078, tpx+2, tpy, tpz, 0.0, 0.0 ,0.0, 0, 0, -1,300.0, 300.0, -1, 0);
	return 1;
}
and yes it doesnt create an object. this is the native for createdynamicobject:

Код:
native STREAMER_TAG_OBJECT CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_OBJECT_SD, Float:drawdistance = STREAMER_OBJECT_DD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1, priority = 0);
what is wrong here ?
Reply
#2

did you install the plugin?
Reply
#3

Yes ofcourse i did and i can perfectly use 3dtexts for houses and everything i want in streamer plugin but apparently not createdynamicobject. İ was using version 2.8.2 i upgraded to 2.9.1 it still didnt work so i downgraded to 2.8.2 again. Stilll doesnt work.
Reply
#4

Quote:
Originally Posted by grymtn
Посмотреть сообщение
Yes ofcourse i did and i can perfectly use 3dtexts for houses and everything i want in streamer plugin but apparently not createdynamicobject. İ was using version 2.8.2 i upgraded to 2.9.1 it still didnt work so i downgraded to 2.8.2 again. Stilll doesnt work.
Your test command is wrong, you forgot to add getplayerpos.

If object still won't appear, check amount of CreateObject. Maybe you've used all slots (1000).
Reply
#5

Oh thanks for the info i will edit it and tell the result in a min

EDIT:

I edited my code to this:
Код:
CMD:cdo(playerid,params[])
{
	new Float:tpx,Float:tpy,Float:tpz;
	GetPlayerPos(playerid,tpx,tpy,tpz);
	CreateDynamicObject(2078,tpx+2,tpy,tpz,0.0, 0.0 ,0.0 ,0 ,0 ,-1, 300.0 ,300.0 ,-1,0);
	return 1;
}
still doesnt work
Reply
#6

What about object limit? Are you sure you have free slots?
Any error logs?
Reply
#7

i literally dont use any object. This is a gamemode that i made from scratch
Reply
#8

If you add a new streamed entity in the immediate vicinity of the player then it will not be streamed until you leave the area and come back. The plugin divides the map in cells (imagine a large grid with a lot of squares over the map) and no updates will be sent as long as the player stays in the current cell (square). You can use Streamer_Update() to force an update.
Reply
#9

tired that too btw my command works but my saved furnitures doesnt appear. Right now i can hit them(cant walk thru them) but still they are not being able to seen they only exist as unwalkable thru air. i tried streamer_update too they really dont want to show up.

I also thought that model ids are being problem here(like it doesnt load model id so it tries to load id0 and fails to show but my server log gives correct ids such as Loaded object id 1723). So I dont have model id problem too.

Here is my load cmd:
Код:
stock loadobject()
{
	new ostr[40];
	ocnt=1;
	for(new g=1; g<MAX_OBJECT; g++)
	{
	    format(ostr,sizeof(ostr),"Furnitures/%d.ini",g);
	    if(!dini_Exists(ostr))
		{
		    for(new p=0;p<MAX_PLAYERS;p++)
		    {
				Streamer_Update(p,-1);
			}
			return 0;
		}
		objinfo[g][oid]=dini_Int(ostr,"id");
		objinfo[g][ox]=dini_Float(ostr,"ox");
		objinfo[g][oy]=dini_Float(ostr,"oy");
		objinfo[g][oz]=dini_Float(ostr,"oz");
		objinfo[g][orx]=dini_Float(ostr,"orx");
		objinfo[g][ory]=dini_Float(ostr,"ory");
		objinfo[g][orz]=dini_Float(ostr,"orz");
		objinfo[g][oint]=dini_Int(ostr,"oint");
		objinfo[g][ovir]=dini_Int(ostr,"ovir");
		objinfo[g][omdl]=dini_Int(ostr,"mdl");
		objinfo[g][oid] = CreateDynamicObject(objinfo[g][omdl],objinfo[g][ox],objinfo[g][oy],objinfo[g][oz],objinfo[g][orx],objinfo[g][ory],objinfo[g][orz],objinfo[g][ovir],objinfo[g][oint],-1,50.0,50.0,-1,0);
		ocnt++;
		new ltext[100];
		format(ltext,sizeof(ltext),"Loaded object id %d",objinfo[g][omdl]);
		printf(ltext);
	}
	return 1;
}
Reply
#10

Have you checked server logs? We might find something.
Reply
#11

i have crashdetect but nothing so far. command is being executed objects are being created but i am not able to see them. I am only able to collide with them. my server log even tells me that i successfully load the object from printf codes
Reply
#12

EDIT:

my object save was sending z instead of x its my bad and fixed now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)