15.04.2015, 18:18
Hello...when i edit a Attached Object an other player don't see the edited object..Other player see object at spawn position but me i see edited object..
Код:
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) { if(GetIntVar(playerid, "EditingPolice") == 1) { if(response) { RemoveVar(playerid, "EditingPolice"); RemovePlayerAttachedObject(playerid, index); SetPlayerAttachedObject(playerid, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ); } else { SetIntVar(playerid, "EditingPolice", 1); SCM(playerid, COLOR_WHITE, "Please press on the SAVE button to continue."); EditAttachedObject(playerid, index); } } if(GetIntVar(playerid, "EditingOwnedToy") == 1) { new i = GetIntVar(playerid, "ToySlotEditing"); if(response) { PlayerToys[playerid][i][ptOffsetX] = fOffsetX; PlayerToys[playerid][i][ptOffsetY] = fOffsetY; PlayerToys[playerid][i][ptOffsetZ] = fOffsetZ; PlayerToys[playerid][i][ptRotX] = fRotX; PlayerToys[playerid][i][ptRotY] = fRotY; PlayerToys[playerid][i][ptRotZ] = fRotZ; PlayerToys[playerid][i][ptScaleX] = fScaleX; PlayerToys[playerid][i][ptScaleY] = fScaleY; PlayerToys[playerid][i][ptScaleZ] = fScaleZ; UpdatePlayerToy(playerid, i, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ); RemoveVar(playerid, "ToySlotEditing"); RemoveVar(playerid, "EditingOwnedToy"); RemovePlayerAttachedObject(playerid, i); SetPlayerAttachedObject(playerid, i, modelid, boneid, PlayerToys[playerid][i][ptOffsetX], PlayerToys[playerid][i][ptOffsetY], PlayerToys[playerid][i][ptOffsetZ], PlayerToys[playerid][i][ptRotX], PlayerToys[playerid][i][ptRotY], PlayerToys[playerid][i][ptRotZ], PlayerToys[playerid][i][ptScaleX], PlayerToys[playerid][i][ptScaleY], PlayerToys[playerid][i][ptScaleZ]); } else { RemovePlayerAttachedObject(playerid, i); SetPlayerAttachedObject(playerid, i, modelid, boneid, PlayerToys[playerid][i][ptOffsetX], PlayerToys[playerid][i][ptOffsetY], PlayerToys[playerid][i][ptOffsetZ], PlayerToys[playerid][i][ptRotX], PlayerToys[playerid][i][ptRotY], PlayerToys[playerid][i][ptRotZ], PlayerToys[playerid][i][ptScaleX], PlayerToys[playerid][i][ptScaleY], PlayerToys[playerid][i][ptScaleZ]); RemoveVar(playerid, "ToySlotEditing"); RemoveVar(playerid, "EditingOwnedToy"); } } if(GetIntVar(playerid, "JustBoughtToy") == 1) { new i = GetIntVar(playerid, "ToySlotEditing"); if(response) { RemovePlayerAttachedObject(playerid, i); PlayerToys[playerid][i][ptOffsetX] = fOffsetX; PlayerToys[playerid][i][ptOffsetY] = fOffsetY; PlayerToys[playerid][i][ptOffsetZ] = fOffsetZ; PlayerToys[playerid][i][ptRotX] = fRotX; PlayerToys[playerid][i][ptRotY] = fRotY; PlayerToys[playerid][i][ptRotZ] = fRotZ; PlayerToys[playerid][i][ptScaleX] = fScaleX; PlayerToys[playerid][i][ptScaleY] = fScaleY; PlayerToys[playerid][i][ptScaleZ] = fScaleZ; UpdatePlayerToy(playerid, i, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ); SetPlayerAttachedObject(playerid, i, modelid, boneid, PlayerToys[playerid][i][ptOffsetX], PlayerToys[playerid][i][ptOffsetY], PlayerToys[playerid][i][ptOffsetZ], PlayerToys[playerid][i][ptRotX], PlayerToys[playerid][i][ptRotY], PlayerToys[playerid][i][ptRotZ], PlayerToys[playerid][i][ptScaleX], PlayerToys[playerid][i][ptScaleY], PlayerToys[playerid][i][ptScaleZ]); RemoveVar(playerid, "ToyModelBuying"); RemoveVar(playerid, "ToyBoneBuying"); RemoveVar(playerid, "ToyPriceBuying"); RemoveVar(playerid, "ToyNameBuying"); RemoveVar(playerid, "ToySlotEditing"); RemoveVar(playerid, "JustBoughtToy"); } else { RemovePlayerToyFromSlot(playerid, i); format(msg, sizeof(msg), "You have canceled the item buying, and got your ${00FF40}%d {FFFFFF}back.", GetIntVar(playerid, "ToyPriceBuying")); SCM(playerid, -1, msg); GiveCash(playerid, GetIntVar(playerid, "ToyPriceBuying")); RemovePlayerAttachedObject(playerid, i); RemoveVar(playerid, "ToyModelBuying"); RemoveVar(playerid, "ToyBoneBuying"); RemoveVar(playerid, "ToyPriceBuying"); RemoveVar(playerid, "ToyNameBuying"); RemoveVar(playerid, "ToySlotEditing"); RemoveVar(playerid, "JustBoughtToy"); } } return 1; }