a little help ok?

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
51
Location
LongForgotten <-> 0x32789
Hi, I'm trying to send fake bullets to a player, Whenever this function is called, It dosent give fake bullet to him, I used showcallbacks in ugbase.eu cheating allowed
I dont remember what it debugged but it said something like 255 and 0.0 all coords and illegal chars like (*!
Code:
void RakClient::SendFakeBulletToPlayer( int PlayerID )
{
	if ( !pRakClient )
		return;

    actor_info *self = actor_info_get(ACTOR_SELF, NULL);
    actor_info *target = getGTAPedFromSAMPPlayerID(PlayerID);

    if(self == NULL && target == NULL) return;

    if(g_Players->iIsListed[PlayerID] != 1) return;

    stBulletData bsSync;

    memset(&bsSync, 0, sizeof(stBulletData));

    bsSync.byteType = (BYTE)1;
    bsSync.sTargetID = PlayerID;

    vect3_copy(&self->base.matrix[4 * 3], bsSync.fOrigin);
    vect3_copy(&target->base.matrix[4 * 3], bsSync.fTarget);
    vect3_copy(&target->base.matrix[4 * 3], bsSync.fCenter);

    BitStream bsSend;

    bsSend.Write((BYTE)ID_BULLET_SYNC);
    bsSend.Write((PCHAR)&bsSync, sizeof(stBulletData));

    pRakClient->Send(&bsSend, HIGH_PRIORITY, UNRELIABLE_SEQUENCED, 0);
}

Are my offsets wrong or what? Why does it not send it properly?
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Probably because of the center offsets, those are suppose to be relative offsets. Also you're sending bullet packets with weapon id of 0(fists).
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Doesn't matter what you had in hands, you didn't copied the actual data, you initiated a stBulletData to 0, and the stBulletData contains a last byte parameter that is the weapon id.

Also if you fixed it, tell how you fixed, so in the future if anyone has the same problem they can learn from this post.
 
Top