Please help me in writing the function

Hossi_Bad

Участник
Автор темы
83
24
Версия MoonLoader
.026-beta
Hello everyone, don't be tired

I wrote a hack gun for a CNR server. But when I gave myself a weapon, I was kicked from the server

I added the following script to my hack gun:

function ev.onSendPlayerSync(data)
if Dgun then
data.weapon = 0
end
end

When I added this script, I did not get kicked from the server.. but when I shoot the player, the player is not damaged.

What functions should I add to my script to damage the player?

please help
 

Sleash

Активный
82
155
samp.events:
-- playerId = 'uint16', damage = 'float', weapon = 'int32', bodypart ='int32'
OUTCOMING_RPCS[RPC.GIVETAKEDAMAGE]            = {{'onSendGiveDamage', 'onSendTakeDamage'}, handler.rpc_send_give_take_damage_reader, handler.rpc_send_give_take_damage_writer}
or try give weapon this way
Lua:
local bs = raknetNewBitStream()
raknetBitStreamWriteInt32(bs, weaponId)
raknetBitStreamWriteInt32(bs, ammo)
raknetEmulRpcReceiveBitStream(22, bs)
raknetDeleteBitStream(bs)
 
  • Bug
  • Эм
Реакции: qdIbp и chapo

Hossi_Bad

Участник
Автор темы
83
24
samp.events:
-- playerId = 'uint16', damage = 'float', weapon = 'int32', bodypart ='int32'
OUTCOMING_RPCS[RPC.GIVETAKEDAMAGE]            = {{'onSendGiveDamage', 'onSendTakeDamage'}, handler.rpc_send_give_take_damage_reader, handler.rpc_send_give_take_damage_writer}
or try give weapon this way
Lua:
local bs = raknetNewBitStream()
raknetBitStreamWriteInt32(bs, weaponId)
raknetBitStreamWriteInt32(bs, ammo)
raknetEmulRpcReceiveBitStream(22, bs)
raknetDeleteBitStream(bs)


Hello dear friend

I added these 2 scripts to my cheat, but the cheat didn't work.

Please tell me how to add these 2 scripts to my cheat?
 

Sleash

Активный
82
155
Lua:
function GiveWeapon(weaponId, ammo)
    local bs = raknetNewBitStream()
    raknetBitStreamWriteInt32(bs, weaponId)
    raknetBitStreamWriteInt32(bs, ammo)
    raknetEmulRpcReceiveBitStream(22, bs)
    raknetDeleteBitStream(bs)
end
GiveWeapon(24, 100) -- give you 100 ammo Desert Eagle
Lua:
function require('samp.events').onSendGiveDamage(playerId, damage, weapon, bodypart)
    sampAddChatMessage('You damage player '..playerId..'. Damage: '..damage..' hp') -- seems to be so
end
 
  • Влюблен
Реакции: Hossi_Bad

Hossi_Bad

Участник
Автор темы
83
24
Lua:
function GiveWeapon(weaponId, ammo)
    local bs = raknetNewBitStream()
    raknetBitStreamWriteInt32(bs, weaponId)
    raknetBitStreamWriteInt32(bs, ammo)
    raknetEmulRpcReceiveBitStream(22, bs)
    raknetDeleteBitStream(bs)
end
GiveWeapon(24, 100) -- give you 100 ammo Desert Eagle
Lua:
function require('samp.events').onSendGiveDamage(playerId, damage, weapon, bodypart)
    sampAddChatMessage('You damage player '..playerId..'. Damage: '..damage..' hp') -- seems to be so
end


Thank you very much dear friend

good luck