Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: habi on Feb 08, 2020, 06:15 PM

Title: ammo problem
Post by: habi on Feb 08, 2020, 06:15 PM
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.
Title: Re: ammo problem
Post by: D4rkR420R on Feb 09, 2020, 01:27 AM
Try adding that code inside that VC:MP callback to onPlayerEnteringVehicle.
Title: Re: ammo problem
Post by: NicusorN5 on Feb 09, 2020, 11:32 AM
Try player.SetWeapon(wepid,0)
Title: Re: ammo problem
Post by: habi on Feb 09, 2020, 02:14 PM
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
Title: Re: ammo problem
Post by: Sebastian on Feb 12, 2020, 01:09 AM
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.
Title: Re: ammo problem
Post by: Xmair on Feb 12, 2020, 06:31 AM
player.Slot = 5;