Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float fWeaponDamage[55] =
- {
- 1.0, // 0 - Fist
- 1.0, // 1 - Brass knuckles
- 1.0, // 2 - Golf club
- 1.0, // 3 - Nitestick
- 1.0, // 4 - Knife
- 1.0, // 5 - Bat
- 1.0, // 6 - Shovel
- 1.0, // 7 - Pool cue
- 1.0, // 8 - Katana
- 1.0, // 9 - Chainsaw
- 1.0, // 10 - Dildo
- 1.0, // 11 - Dildo 2
- 1.0, // 12 - Vibrator
- 1.0, // 13 - Vibrator 2
- 1.0, // 14 - Flowers
- 1.0, // 15 - Cane
- 82.5, // 16 - Grenade
- 0.0, // 17 - Teargas
- 1.0, // 18 - Molotov
- 9.9, // 19 - Vehicle M4 (custom)
- 46.2, // 20 - Vehicle minigun (custom)
- 0.0, // 21
- 8.25, // 22 - Colt 45
- 13.2, // 23 - Silenced
- 46.2, // 24 - Deagle
- 49.5,//3.3, // 25 - Shotgun
- 49.5,//3.3, // 26 - Sawed-off
- 39.6,//4.95, // 27 - Spas
- 6.6, // 28 - UZI
- 8.25, // 29 - MP5
- 9.900001, // 30 - AK47
- 9.900001, // 31 - M4
- 6.6, // 32 - Tec9
- 24.750001, // 33 - Cuntgun
- 41.25, // 34 - Sniper
- 82.5, // 35 - Rocket launcher
- 82.5, // 36 - Heatseeker
- 1.0, // 37 - Flamethrower
- 46.2, // 38 - Minigun
- 82.5, // 39 - Satchel
- 0.0, // 40 - Detonator
- 0.33, // 41 - Spraycan
- 0.33, // 42 - Fire extinguisher
- 0.0, // 43 - Camera
- 0.0, // 44 - Night vision
- 0.0, // 45 - Infrared
- 0.0, // 46 - Parachute
- 0.0, // 47 - Fake pistol
- 2.64, // 48 - Pistol whip (custom)
- 9.9, // 49 - Vehicle
- 330.0, // 50 - Helicopter blades
- 82.5, // 51 - Explosion
- 1.0, // 52 - Car park (custom)
- 1.0, // 53 - Drowning
- 165.0 // 54 - Splat
- };
- if (!tick_done)
- {
- tick = GetTickCount64();
- tick_done = true;
- }
- if (GetTickCount64() - tick > 700) //replace 700 with your delay.
- {
- static int current_tick = 0;
- stBulletData BulletData;
- parameters->ResetReadPointer();
- parameters->Read(packetId);
- parameters->Read((PCHAR)&BulletData, sizeof(stBulletData));
- int weaponid = pSAMP->getPlayers()->pLocalPlayer->byteCurrentWeapon;
- for (int i = 0; i < SAMP_MAX_PLAYERS; i++)
- {
- if (pSAMP->getPlayers()->pRemotePlayer[i] == nullptr)
- continue;
- if (pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData == nullptr)
- continue;
- if (!pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fActorHealth)
- continue;
- float damage_t = pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fActorHealth / fWeaponDamage[pSAMP->getPlayers()->pLocalPlayer->byteCurrentWeapon];
- for (int z = 0; z < round(damage_t) + 1; z++)
- {
- BulletData.byteType = 1;
- BulletData.fOrigin[0] = pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fOnFootPos[0];
- BulletData.fOrigin[1] = pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fOnFootPos[1];
- BulletData.fOrigin[2] = pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fOnFootPos[2];
- BulletData.fTarget[0] = pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fOnFootPos[0];
- BulletData.fTarget[1] = pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fOnFootPos[1];
- BulletData.fTarget[2] = pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fOnFootPos[2];
- if (pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->bytePlayerState == PLAYER_STATE_ONFOOT)
- {
- BulletData.fCenter[0] = (1.0f / 2) - ((rand() % (int)(1.0f * 10.0f) / 100.0f));
- BulletData.fCenter[1] = (1.0f / 2) - ((rand() % (int)(1.0f * 10.0f) / 100.0f));
- BulletData.fCenter[2] = 0.50f - ((rand() % 100) / 100.0f);
- }
- else
- {
- BulletData.fCenter[0] = 0.0f;
- BulletData.fCenter[1] = 0.0f;
- BulletData.fCenter[2] = 0.56f - ((rand() % 5) / 100.0f);
- }
- BulletData.sTargetID = i;
- BulletData.byteWeaponID = weaponid;
- BitStream bsGiveDamage;
- bsGiveDamage.Write(false);
- bsGiveDamage.Write((USHORT)i);
- bsGiveDamage.Write((float)fWeaponDamage[weaponid]);
- bsGiveDamage.Write((int)weaponid);
- bsGiveDamage.Write((rand() % 7) + 3);
- pSAMP->sendRPC(RPC_GiveTakeDamage, &bsGiveDamage, HIGH_PRIORITY, RELIABLE_SEQUENCED, NULL, false);
- parameters->Reset();
- parameters->Write((BYTE)ID_BULLET_SYNC);
- parameters->Write((PCHAR)&BulletData, sizeof(stBulletData));
- pSAMP->sendPacket(parameters);
- }
- }
- tick = 0;
- tick_done = false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement