CreateObject problem.
#1

I have made an command which creates object and than saves it. Here is the problem.

The cmd:
Код:
CMD:makeobject(playerid, params[])
{
	new obj, str[128];
	if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1, "{FF0000}You need to be an rcon admin.");
	if(sscanf(params, "i", obj)) return SCM(playerid, -1, "{00FFFF}>> USAGE: {FFFFFF}/makeobject [objectid]");
	format(str, sizeof(str), "{80FF00}You are editing object %d.", obj);
	SCM(playerid, -1, str);
	GetPlayerPos(playerid, x,y,z);
	obc = CreateObject(obj, x, y, z, 0, 0, 0);
	EditObject(playerid, obc);
	editing[playerid] = 1;
	return 1;
}
The saving:
Код:
public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
	if(editing[playerid] == 1)
	{
	editing[playerid] = 0;
	CreateObject(objectid, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ);
    format(LogStr, sizeof(LogStr), "CreateObject(%d,1,%f,%f,%f,%f,%f,%f);\r\n", playerobject, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ);
	Object(LogStr);
	}
}
I always InGame type "1215" ID of object (bollardlight), but in scriptfiles it's not that ID. This is what I get.
Код:
CreateObject(0,1,1567.438842,1016.241271,10.679662,0.000000,0.000000,0.000000);
Reply


Messages In This Thread
CreateObject problem. - by Vegas. - 19.11.2012, 07:31
Re: CreateObject problem. - by Konstantinos - 19.11.2012, 07:44
Re: CreateObject problem. - by Vegas. - 19.11.2012, 07:50
Re: CreateObject problem. - by nemanjatesic - 19.11.2012, 09:27
Re: CreateObject problem. - by Vegas. - 19.11.2012, 09:38

Forum Jump:


Users browsing this thread: 1 Guest(s)