Problem With EditObject - 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: Problem With EditObject (
/showthread.php?tid=470905)
Problem With EditObject -
Dusan01 - 20.10.2013
Hi guys, i have problem with EditObject function!
i have this:
Код:
ObjEdita[playerid]=CreateObject(2942,x,y,z+3,0,0,0); //ATM
EditObject(playerid,ObjEdita[playerid]);
and when i use that command for this EditObject, it would not show me arrows and create that object...
its should be like this:
https://sampwiki.blast.hk/wroot/images2/...tingObject.png
and in my case dont show nothing
Re: Problem With EditObject -
Dusan01 - 22.10.2013
BUMP
Re: Problem With EditObject -
Threshold - 22.10.2013
What is this code under? A callback, a command?
Re: Problem With EditObject -
Dusan01 - 22.10.2013
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;
}