Author Topic: GetPlayerStat ammo after ForceWeapon  (Read 1598 times)

0 Members and 1 Guest are viewing this topic.

Offline Neosano

  • Camper
  • ***
  • Posts: 253
  • IIAWAK!
GetPlayerStat ammo after ForceWeapon
« on: June 29, 2008, 09:55:56 am »
Code: [Select]
function OnPlayerDamage(Victim,Shooter: Byte;Damage: Integer):integer;
begin
result := Damage;
ForceWeapon(Shooter,GetPlayerStat(Shooter,'Primary'),GetPlayerStat(Shooter,'Secondary'),GetPlayerStat(Shooter,'ammo')+1);
end;
Here is what i have got after testing it(I used minimi):
I had 40 ammo, I shot the dummy once, and my ammo went down to 39 then bounced back to 40. After that, my ammo decreased normally when I carried on shooting it. Switching weapons or shooting in the air forces it to work again. And when my ammo is at 1, and I punch the dummy with the weapon, the weapon reloads instantly.

I attached the video with that bug made by Danmer
KAWAAAAAAAIIIIIIIIII

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: GetPlayerStat ammo after ForceWeapon
« Reply #1 on: June 29, 2008, 11:17:41 am »
Code: [Select]
function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
  writeln('');
  writeln('before: ' + inttostr(GetPlayerStat(shooter,'ammo')));
  forceweapon(shooter,GetPlayerStat(shooter,'primary'),GetPlayerStat(shooter,'secondary'),GetPlayerStat(shooter,'ammo')+1);
  writeln('after: ' + inttostr(GetPlayerStat(shooter,'ammo')));
 
 
end;
both values (before and after) were the same. It works fine for a couple of first shots (gives you one bullet if you hit someone), but after that starts to screw up. Also if you run around between the shots or shoot air every second time, it works too...
« Last Edit: June 29, 2008, 11:19:27 am by danmer »

Offline Neosano

  • Camper
  • ***
  • Posts: 253
  • IIAWAK!
Re: GetPlayerStat ammo after ForceWeapon
« Reply #2 on: June 29, 2008, 12:22:31 pm »
looks like your ammo doesn't change (in getplayerstat) after ForceWeapon
KAWAAAAAAAIIIIIIIIII