ammo problem

Started by habi, Feb 08, 2020, 06:15 PM

Previous topic - Next topic

habi

hi when entering a vehicle, change weapon to driveby type. this is the idea.

function onPlayerEnterVehicle( player, vehicle, door )
{
local wepid = player.GetWeaponAtSlot( 5);
local ammo =  player.GetAmmoAtSlot(5);
if(wepid != 0 )player.SetWeapon( wepid, ammo );
}
but this is not working correctly in game, the ammo increases when entering vehicle.

D4rkR420R

Try adding that code inside that VC:MP callback to onPlayerEnteringVehicle.

NicusorN5

Try player.SetWeapon(wepid,0)

habi

#3
guys first of all, i left the problem. ie. what to us if the poorplayer get little ammo

and i think it was problem with bug.
Quote from: DarkRaZoR^ on Feb 09, 2020, 01:27 AMTry adding that code inside that VC:MP callback to onPlayerEnteringVehicle.
tried and found not working still

Quote from: Athanatos on Feb 09, 2020, 11:32 AMTry player.SetWeapon(wepid,0)
if we do that, weapon itself gone.

bug, i mean, with vcmp
ie. player.GetAmmoAtSlot

Sebastian

I faced this problem too, and yeah - seems like we cannot get the ammo of player's weapon while in a car.
But I think this was happening only for passengers - don't know about driver.

Xmair

#5
player.Slot = 5;

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD