22.10.2013, 14:45
here is public of OnPlayerEditObject:
and here is full command
Код:
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; }
Код:
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; }