SA-MP Forums Archive
EditObject crashing!! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: EditObject crashing!! (/showthread.php?tid=417453)



EditObject crashing!! - PaulDinam - 21.02.2013

I made this:

Код:
new object;

object = CreateObject(1337, 1647.33, -2322.48, -2.84564, 0.0, 0.0, 0.0);

CMD:edit(playerid, params[])
{
	EditObject(playerid, object);
	SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You now edit the object!");
	return 1;
}
And it crashessss meeee..........


Re: EditObject crashing!! - Jay_ - 21.02.2013

You need to provide more details. What crashes? The client or server? Do you have a crash address? Does it happen with other objects or only this particular model? Do you have any mods installed? Does it work on other servers? Are you sure this is the source of the crash and nothing else?


Re: EditObject crashing!! - PaulDinam - 21.02.2013

I have fixed it, just restarted computer.
And it was client crash.

Another problem..
I made an object editor in game which saves to MySQL.

This is the insert stock

pawn Код:
stock AddObjectToFile(objectid, modelid, desc[], Float:LX, Float:LY, Float:LZ)
{
    new Query[200];
    format(Query, sizeof(Query), "INSERT INTO `objects` (model, posx, posy, posz) VALUES(%d, %f, %f, %f)", modelid, LX, LY, LZ);
    mysql_function_query(dbHandle, Query, true, "OnObjectInsert", "d", objectid);
    return 1;
}
As you can see there, desc[].

When i'm trying to use it:
pawn Код:
stock AddObjectToFile(objectid, modelid, desc[], Float:LX, Float:LY, Float:LZ)
{
    new Query[200];
    format(Query, sizeof(Query), "INSERT INTO `objects` (model, posx, posy, posz, desc) VALUES(%d, %f, %f, %f, '%s')", modelid, LX, LY, LZ, desc);
    mysql_function_query(dbHandle, Query, true, "OnObjectInsert", "d", objectid);
    return 1;
}

It gives me an error...


Re: EditObject crashing!! - SuperViper - 21.02.2013

The size of the Query string may be too short. Try increasing it to something like 250. I can't give you the exact solution because you aren't specific at all in your posts.


Re: EditObject crashing!! - PaulDinam - 21.02.2013

Nevermind, i've fixed it finallyyyyyyyyyy