PDA

View Full Version : Problem with response ; OnPlayerEditDynamicObject


Chipardeur
19/07/2017, 09:06 PM
Hi !

I have this code:

ATM[slot][aObject] = CreateDynamicObject(model, ATM[slot][aX], ATM[slot][aY], ATM[slot][aZ]-0.50, 0.000, 0.000, ATM[slot][aA], ATM[slot][aWorld], ATM[slot][aInt], -1, 50.0, 50.0);
EditDynamicObject(playerid, ATM[slot][aObject]);

I modify the object and then press the floppy disk to save

public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
printf("%d, %d", EDIT_RESPONSE_FINAL, response);
}

Why my response = 2?
In my a_samp, EDIT_RESPONSE_FINAL = 1.
http://wiki.sa-mp.com/wiki/ObjectEditionResponesTypes Here same

Why my "response" = 2 and not 1 ?

Thx

Dayrion
19/07/2017, 09:12 PM
EDIT_RESPONSE_FINAL come when you click on the Save button

Chipardeur
19/07/2017, 09:20 PM
I know and that's what I explained in my topic...

When I click save and I look at my console, response is worth 2 while I pressed save... Why is not it worth 1?

Dayrion
19/07/2017, 09:51 PM
You should try this one to see when EDIT_RESPONSE_FINAL come:
if(response == EDIT_RESPONSE_FINAL)
printf("-> Reponse: %i (%i), response, EDIT_RESPONSE_FINAL);

Daymen
19/07/2017, 09:52 PM
Whenever you press the Floppy Disk icon, it saves the object's information and then processes an UPDATE so everyone is able to see it's changes.

That's why if you have an object editor, you can move it around on your screen, but it stays in it's previous position UNTIL you press the floppy disk.

Chipardeur
19/07/2017, 10:18 PM
Nobody understands me ?

You should try this one to see when EDIT_RESPONSE_FINAL come:
if(response == EDIT_RESPONSE_FINAL)
printf("-> Reponse: %i (%i), response, EDIT_RESPONSE_FINAL);

Do not have this debug because when I press save EDIT_RESPONSE_FINAL is not recognized. EDIT_RESPONSE_FINAL is set to 1.
And my response is worth 2 !!!

Chipardeur
19/07/2017, 10:40 PM
If I leave the object at the initial coordinates, EDIT_RESPONSE_FINAL is equal to 1, but if I shift a coordinate, then when I press the backup disk instead of 1 it puts 2

Dutheil
20/07/2017, 02:25 PM
Responses may be probably inverted.
Check it out.