їGetAttachedObjectPos?
#6

Quote:
Originally Posted by _Zume
Посмотреть сообщение
Intenta poniendo esto en un include y aсadiйndolo a tu cуdigo:

PHP код:
CMD:attachpos(playeridparams[])
{
    if(
sscanf(params"d"params[0]))
        return 
1;
    new 
Float:pPas[3];
    
GetPlayerAttachedObjectPos(playeridparams[0], pPas[0], pPas[1], pPas[2]);
    
    
SendClientMessageEx(playerid, -1"%.2f, %.2f, %.2f"pPas[0], pPas[1], pPas[2]);
    return 
1;

PHP код:
/*
    * Funciones [Adicionales] Attachements.
        GetPlayerAttachedObjectScale(playerid, index, &Float:ScaleX, &Float:ScaleY, &Float:ScaleZ);
        GetPlayerAttachedObjectRot(playerid, index, &Float:RotX, &Float:RotY, &Float:RotZ);
        GetPlayerAttachedObjectPos(playerid, index, &Float:PosX, &Float:PosY, &Float:PosZ);
    
*/
    
enum z_playerAttachements
{
    
Exists,
    
ModelID,
    
BoneID,
    
pMaterialColor1,    pMaterialColor2,
    
Float:pOffsetX,     Float:pOffsetY,     Float:pOffsetZ,
    
Float:pRotX,         Float:pRotY,         Float:pRotZ,
    
Float:pScaleX,         Float:pScaleY,        Float:pScaleZ
};
new
    
playerAttachements[MAX_PLAYERS][MAX_PLAYER_ATTACHED_OBJECTS][z_playerAttachements];
public 
OnPlayerConnect(playerid)
{
    for(new 
0MAX_PLAYER_ATTACHED_OBJECTSi++)
        
RemovePlayerAttachedObjectExZ(playeridi);
    
#if defined z_OnPlayerConnect
      
return z_OnPlayerConnect(playerid);
    
#else
      
return 1;
    
#endif
}
public 
OnPlayerEditAttachedObjectplayeridresponseindexmodelidboneidFloat:fOffsetXFloat:fOffsetYFloat:fOffsetZFloat:fRotXFloat:fRotYFloat:fRotZFloat:fScaleXFloat:fScaleYFloat:fScaleZ )
{
    
SetPlayerAttachedObjectExZ(playeridindexmodelidboneidfOffsetXfOffsetYfOffsetZfRotXfRotYfRotZfScaleXfScaleYfScaleZplayerAttachements[playerid][index][pMaterialColor1], playerAttachements[playerid][index][pMaterialColor2]);
    
    
#if defined z_OnPlayerEditAttachedObject
      
return z_OnPlayerEditAttachedObjectplayeridresponseindexmodelidboneidfOffsetXfOffsetYfOffsetZfRotXfRotYfRotZfScaleXfScaleYfScaleZ );
    
#else
      
return 1;
    
#endif
}
stock RemovePlayerAttachedObjectExZ(playeridindex)
{
    
playerAttachements[playerid][index][Exists] = 0;
    
RemovePlayerAttachedObject(playeridindex);
}
stock SetPlayerAttachedObjectExZ(playeridindexmodelidboneFloat:fOffsetX 0.0Float:fOffsetY 0.0Float:fOffsetZ 0.0Float:fRotX 0.0Float:fRotY 0.0Float:fRotZ 0.0Float:fScaleX 1.0Float:fScaleY 1.0Float:fScaleZ 1.0materialcolor1 0materialcolor2 0)
{
    
playerAttachements[playerid][index][Exists] = 1;
    
playerAttachements[playerid][index][ModelID] = modelid;
    
playerAttachements[playerid][index][BoneID] = bone;
    
playerAttachements[playerid][index][pOffsetX] = fOffsetX;
    
playerAttachements[playerid][index][pOffsetY] = fOffsetY;
    
playerAttachements[playerid][index][pOffsetZ] = fOffsetZ;
    
playerAttachements[playerid][index][pRotX] = fRotX;
    
playerAttachements[playerid][index][pRotY] = fRotY;
    
playerAttachements[playerid][index][pRotZ] = fRotZ;
    
playerAttachements[playerid][index][pScaleX] = fScaleX;
    
playerAttachements[playerid][index][pScaleY] = fScaleY;
    
playerAttachements[playerid][index][pScaleZ] = fScaleZ;
    
playerAttachements[playerid][index][pMaterialColor1] = materialcolor1;
    
playerAttachements[playerid][index][pMaterialColor2] = materialcolor2;
    
SetPlayerAttachedObject(playeridindexmodelidbonefOffsetXfOffsetYfOffsetZfRotXfRotYfRotZfScaleXfScaleYfScaleZmaterialcolor1materialcolor2);
}
stock GetPlayerAttachedObjectPos(playeridindex, &Float:PosX, &Float:PosY, &Float:PosZ)
{
    
PosX playerAttachements[playerid][index][pOffsetX];
    
PosY playerAttachements[playerid][index][pOffsetY];
    
PosZ playerAttachements[playerid][index][pOffsetZ];
    return 
1;
}
stock GetPlayerAttachedObjectRot(playeridindex, &Float:RotX, &Float:RotY, &Float:RotZ)
{
    
RotX playerAttachements[playerid][index][pRotX];
    
RotY playerAttachements[playerid][index][pRotY];
    
RotZ playerAttachements[playerid][index][pRotZ];
    return 
1;
}
stock GetPlayerAttachedObjectScale(playeridindex, &Float:ScaleX, &Float:ScaleY, &Float:ScaleZ)
{
    
ScaleX playerAttachements[playerid][index][pScaleX];
    
ScaleY playerAttachements[playerid][index][pScaleY];
    
ScaleZ playerAttachements[playerid][index][pScaleZ];
    return 
1;
}
#if defined _ALS_RemovePlayerAttachedObject
  #undef RemovePlayerAttachedObject
#else
  #define _ALS_RemovePlayerAttachedObject
#endif
#if defined _ALS_SetPlayerAttachedObject
  #undef SetPlayerAttachedObject
#else
  #define _ALS_SetPlayerAttachedObject
#endif
#if defined _ALS_OnPlayerConnect
  #undef OnPlayerConnect
#else
  #define _ALS_OnPlayerConnect
#endif
#if defined _ALS_OnPlayerEditAttachedObject
  #undef OnPlayerEditAttachedObject
#else
  #define _ALS_OnPlayerEditAttachedObject
#endif
#define OnPlayerConnect                     z_OnPlayerConnect
#define OnPlayerEditAttachedObject          z_OnPlayerEditAttachedObject
#define SetPlayerAttachedObject              SetPlayerAttachedObjectExZ
#define RemovePlayerAttachedObject          RemovePlayerAttachedObjectExZ
#if defined z_OnPlayerConnect
  
forward z_OnPlayerConnect(playerid);
#endif
#if defined z_OnPlayerEditAttachedObject
  
forward z_OnPlayerEditAttachedObject(playeridresponseindexmodelidboneidFloat:fOffsetXFloat:fOffsetYFloat:fOffsetZFloat:fRotXFloat:fRotYFloat:fRotZFloat:fScaleXFloat:fScaleYFloat:fScaleZ );
#endif 
Las funciones para obtener los datos estбn en los comentarios.
Buenнsimo, muchas gracias. No creo que haya algъn tipo de comentario que alcance a describir un agradecimiento, pero en el fondo se le tiene un gran aprecio a este tipo de comentarios.
Reply


Messages In This Thread
їGetAttachedObjectPos? - by Ecologic - 13.07.2015, 05:06
Respuesta: їGetAttachedObjectPos? - by Swedky - 13.07.2015, 05:44
Respuesta: їGetAttachedObjectPos? - by OTACON - 13.07.2015, 06:02
Respuesta: їGetAttachedObjectPos? - by Zume - 13.07.2015, 06:38
Respuesta: їGetAttachedObjectPos? - by OTACON - 13.07.2015, 07:05
Respuesta: їGetAttachedObjectPos? - by Ecologic - 13.07.2015, 15:24

Forum Jump:


Users browsing this thread: 1 Guest(s)