Problem With EditObject
#4

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
What is this code under? A callback, a command?
here is public of OnPlayerEditObject:
Код:
public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
    if(response == EDIT_RESPONSE_FINAL)
	{
	if(ObjEdita[playerid]!=-1)
	{
	new i=ObjeditaId[playerid];
	ATMI[i][aPozx]=fX;
    ATMI[i][aPozy]=fY;
    ATMI[i][aPozz]=fZ;
    ATMI[i][aRotx]=fRotX;
    ATMI[i][aRoty]=fRotY;
    ATMI[i][aRotz]=fRotZ;
    DestroyObject(ObjEdita[playerid]);
    SaveATM(i);
    ATMukras(i);
	ObjEdita[playerid]=-1;
	ObjeditaId[playerid]=-1;
	}
	}
	return 1;
}
and here is full command
Код:
if(strcmp(x_nr,"napravi",true) == 0)
{
new i;
if(ObjeditaId[playerid]!=-1)return SendClientMessage(playerid,-1, "Vec editujete objekat!");
for(new h=1;h<999;h++){new FileName[328];format(FileName, sizeof(FileName), "ATM/ATM_%d.ini",h);if(!fexist(FileName)){i=h;h=998;}}
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
ObjEdita[playerid]=CreateObject(2942,x,y,z+3,0,0,0); //ATM
EditObject(playerid,ObjEdita[playerid]);
ObjeditaId[playerid]=i;
ATMI[i][aPostavljen]=1;
ATMI[i][aKasa]=5000;
ATMI[i][aOpljackan] = 0;
new FileName[328];
format(FileName, sizeof(FileName), "ATM/ATM_%d.ini",i);
fopen(FileName, io_write);
SaveATM(i);
return 1;
}
Reply


Messages In This Thread
Problem With EditObject - by Dusan01 - 20.10.2013, 09:58
Re: Problem With EditObject - by Dusan01 - 22.10.2013, 14:12
Re: Problem With EditObject - by Threshold - 22.10.2013, 14:34
Re: Problem With EditObject - by Dusan01 - 22.10.2013, 14:45

Forum Jump:


Users browsing this thread: 3 Guest(s)