25.12.2013, 13:50
pawn Код:
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 (fScaleX > 2.0) fScaleX = 2.0;
if (fScaleY > 2.0) fScaleY = 2.0;
if (fScaleZ > 2.0) fScaleZ = 2.0;
new slot = slotselection[playerid];
if (response)
{
new string[64];
PlayerToyInfo[playerid][slotselection[playerid]][ptPosX] = fOffsetX;
PlayerToyInfo[playerid][slotselection[playerid]][ptPosY] = fOffsetY;
PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ] = fOffsetZ;
PlayerToyInfo[playerid][slotselection[playerid]][ptRotX] = fRotX;
PlayerToyInfo[playerid][slotselection[playerid]][ptRotY] = fRotY;
PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ] = fRotZ;
PlayerToyInfo[playerid][slotselection[playerid]][ptScaleX] = fScaleX;
PlayerToyInfo[playerid][slotselection[playerid]][ptScaleY] = fScaleY;
PlayerToyInfo[playerid][slotselection[playerid]][ptScaleZ] = fScaleZ;
return 1;
}
else
{
RemovePlayerAttachedObject(playerid, slotselection[playerid]);
if(PlayerToyInfo[playerid][slotselection[playerid]][ptModelID] != 0) SetPlayerAttachedObject(playerid, slotselection[playerid], PlayerToyInfo[playerid][slotselection[playerid]][ptModelID], PlayerToyInfo[playerid][slotselection[playerid]][ptBone], PlayerToyInfo[playerid][slotselection[playerid]][ptPosX], PlayerToyInfo[playerid][slotselection[playerid]][ptPosY], PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ], PlayerToyInfo[playerid][slotselection[playerid]][ptRotX], PlayerToyInfo[playerid][slotselection[playerid]][ptRotY], PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ], PlayerToyInfo[playerid][slotselection[playerid]][ptScaleX], PlayerToyInfo[playerid][slotselection[playerid]][ptScaleY], PlayerToyInfo[playerid][slotselection[playerid]][ptScaleZ]);
}
return 1;
}

