[Tool/Web/Other] SetPlayerAttachedObject - Aim Fix
#13

Quote:
Originally Posted by Dr.Einstein
Посмотреть сообщение
Borntobie, you're using PlayerInfo instead of pAttachments. If you just copy and paste the entire thing without changing it, just like I have it in my server, it will work fine.
I still do not understand ... I edit this script so that it works right away )
Quote:

#include <a_samp>

//This isn't a filterscript, nor an include. You must add this to your gamemode, etc..
//Change all SetPlayerAttachedObject(...) with SetPlayerAttachedObjectE(...), except the one I have not.
//Change all RemovePlayerAttachedObject(...) with RemovePlayerAttachedObjectE(...), except the one I have not.
//You are done. Be nice and do good work, return0 aka Einstein
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define RELEASED(%0) \
(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))

enum pATTACHMENTS
{
Exists,
ModelID,
BoneID,
FloatOffsetX,
FloatOffsetY,
FloatOffsetZ,
FloatRotX,
FloatRotY,
FloatRotZ,
FloatScaleX,
FloatScaleY,
FloatScaleZ
};
new pAttachments[MAX_PLAYERS][10][pATTACHMENTS];
new Attachments[MAX_PLAYERS];



public OnplayerConnect(playerid)
{
Attachments[playerid] = 0;
for(new i = 0; i < 10; i++)
pAttachments[playerid][i][Exists] = 0;
return 1;
}

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 )
{
SetPlayerAttachedObjectE(playerid,index,modelid,bo neid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ, fScaleX,fScaleY,fScaleZ);
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(!IsPlayerInAnyVehicle(playerid))
{
if(PRESSED(KEY_HANDBRAKE))
{
if(GetPlayerWeapon(playerid) == WEAPON_ROCKETLAUNCHER || GetPlayerWeapon(playerid) == WEAPON_SNIPER
|| GetPlayerWeapon(playerid) == WEAPON_CAMERA || GetPlayerWeapon(playerid) == WEAPON_HEATSEEKER)
{
for(new i=0; i<10; i++)
{
RemovePlayerAttachedObject(playerid, i);
}
}
PlayerInfo[playerid][Attachments][2] = 1;
}
if(RELEASED(KEY_HANDBRAKE))
{
for(new i=0; i<10; i++)
{
RemovePlayerAttachedObject(playerid, i);
if(pAttachments[playerid][i][Exists])SetPlayerAttachedObject(playerid,i,pAttachments[playerid][i][ModelID],pAttachments[playerid][i][BoneID],
pAttachments[playerid][i][pOffsetX],pAttachments[playerid][i][pOffsetY],pAttachments[playerid][i][pOffsetZ],
pAttachments[playerid][i][pRotX],pAttachments[playerid][i][pRotY],pAttachments[playerid][i][pRotZ],
pAttachments[playerid][i][pScaleX],pAttachments[playerid][i][pScaleY],pAttachments[playerid][i][pScaleZ]);
}
}
}
return 1;
}

stock RemovePlayerAttachedObjectE(playerid, index)
{
pAttachments[playerid][index][Exists] = 0;
RemovePlayerAttachedObject(playerid, index);
}
stock SetPlayerAttachedObjectE(playerid,index,modelid,bo neid,
Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ,
Float:fRotX, Float:fRotY, Float:fRotZ,
Float:fScaleX, Float:fScaleY, Float:fScaleZ )
{
pAttachments[playerid][index][Exists] = 1;
pAttachments[playerid][index][ModelID] = modelid;
pAttachments[playerid][index][BoneID] = boneid;
pAttachments[playerid][index][pOffsetX] = fOffsetX;
pAttachments[playerid][index][pOffsetY] = fOffsetY;
pAttachments[playerid][index][pOffsetZ] = fOffsetZ;
pAttachments[playerid][index][pRotX] = fRotX;
pAttachments[playerid][index][pRotY] = fRotY;
pAttachments[playerid][index][pRotZ] = fRotZ;
pAttachments[playerid][index][pScaleX] = fScaleX;
pAttachments[playerid][index][pScaleY] = fScaleY;
pAttachments[playerid][index][pScaleZ] = fScaleZ;

SetPlayerAttachedObject(playerid,index,modelid,bon eid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,f ScaleX,fScaleY,fScaleZ);
}

stock IsPlayerAiming(playerid) {
new anim = GetPlayerAnimationIndex(playerid);
if (((anim >= 1160) && (anim <= 1163)) || (anim == 1167) || (anim == 1365) ||
(anim == 1643) || (anim == 1453) || (anim == 220)) return 1;
return 0;
}

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)