20.10.2013, 19:29
So I have recently trying to add objects on players head and try to save the information about the objects using the OnPlayerEditAttachedObject callback which isn't really calling after I am editing any object. Whenever I save the object after I have edited coordinates for the object the OnPlayerEditAttachedObject callback won't call in any moment. I have searched on internet for solutions it says that it requires 0.3e version when I have 0.3x.
https://sampwiki.blast.hk/wiki/EditAttachedObject
This is the code I use, but anyways whenever I try to save my edited object this callback isn't called when it actually says otherwise in SA-MP wiki. Any help would be appreciated. By the way I am not sure also about my strcmp code tell me if it's right when I try to compare my name with another string, thanks.
Код:
public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ) { SetPlayerAttachedObject(playerid, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ);; for(new i = 0; i < 15; i++) { new file[368], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); if(strcmp(name, oInfo[i][OOwner], true)) { SendClientMessage(playerid, GREEN, "Attached object edition saved."); oInfo[i][OffsetX] = fOffsetX; oInfo[i][OffsetY] = fOffsetY; oInfo[i][OffsetZ] = fOffsetZ; oInfo[i][RotX] = fRotX; oInfo[i][RotY] = fRotY; oInfo[i][RotZ] = fRotZ; oInfo[i][ScaleX] = fScaleX; oInfo[i][ScaleY] = fScaleY; oInfo[i][ScaleZ] = fScaleZ; SavePObject(playerid, i); } } return 1; }
This is the code I use, but anyways whenever I try to save my edited object this callback isn't called when it actually says otherwise in SA-MP wiki. Any help would be appreciated. By the way I am not sure also about my strcmp code tell me if it's right when I try to compare my name with another string, thanks.