0x32789
Expert
Hi guys, I added fake bullets sender, it sends them but they dont tend to damage players, I just see bullets going to them but no damage or headshot sound(not even sometimes).
The server has no anticheat against fake bullet or rapid fire, I tried command&kill 0.3.7 cleo it still works and others too, why not this?
this is my function:
NOTE: it also shows sent 5/5 peace bullets to player
and this is my sendfakebullettoplayer
The server has no anticheat against fake bullet or rapid fire, I tried command&kill 0.3.7 cleo it still works and others too, why not this?
this is my function:
Code:
void cmd_peacemaker(char *params)
{
int playerid, requests;
if (!strlen(params) || sscanf(params, "%d%d", &playerid, &requests) < 2)
return addMessageToChatWindow("USAGE: /.peacemaker [playerid] [requests]");
addMessageToChatWindow("[INFO] Sending peace requests, Make sure your holding a gun.");
int count;
count = 0;
for ( int v = 0; v < requests; v++ )
{
count++;
g_RakClient->SendFakeBulletToPlayer(playerid);
}
addMessageToChatWindow("[INFO] Sent %d/%d peace bullets to player id %d.", count,requests,playerid);
}
and this is my sendfakebullettoplayer
Code:
void RakClient::SendFakeBulletToPlayer(int PlayerID)
{
actor_info *self = actor_info_get(ACTOR_SELF, NULL);
actor_info *target = getGTAPedFromSAMPPlayerID(PlayerID);
if(self != NULL && target != NULL)
{
if(g_Players->iIsListed[PlayerID] != 1)
return;
stBulletData bsSync;
memset(&bsSync, 0, sizeof(stBulletData));
bsSync.bHitType = (BYTE)BULLET_HIT_TYPE_PLAYER;
bsSync.iHitID = (unsigned short)PlayerID;
vect3_copy(&self->base.matrix[4 * 3], bsSync.fHitOrigin);
vect3_copy(&target->base.matrix[4 * 3], bsSync.fHitTarget);
bsSync.fCenterOfHit[0] = (float)0x7FFFFFFF;
bsSync.fCenterOfHit[1] = (float)0x7FFFFFFF;
bsSync.fCenterOfHit[2] = (float)0x7FFFFFFF;
BitStream bsSend;
bsSend.Write((BYTE)ID_BULLET_SYNC);
bsSend.Write((PCHAR)&bsSync, sizeof(stBulletData));
g_RakClient->Send(&bsSend, HIGH_PRIORITY, UNRELIABLE_SEQUENCED, 0);
CVector vecOrigin = CVector(bsSync.fHitOrigin[0], bsSync.fHitOrigin[1], bsSync.fHitOrigin[2]);
CVector vecDirection = CVector(bsSync.fHitTarget[0], bsSync.fHitTarget[1], bsSync.fHitTarget[2]);
CColPoint* pColPoint;
CEntitySAInterface *pCollisionEntity = NULL;
bool bCollision = GTAfunc_ProcessLineOfSight( &vecOrigin, &vecDirection, &pColPoint, &pCollisionEntity, 0, 0, 0, 0, 0, 0, 0, 0 );
pPedSelf->GetWeapon(pPedSelf->GetCurrentWeaponSlot())->DoBulletImpact(0, 0, &vecOrigin, &vecDirection, 0, 0);
}
}