18.12.2010, 12:58
Hello guys, I have a bug to report at GetPlayerWeaponData(playerid, slot, weapon, ammo);
Description:
The function returns wrong values when you make a drive-by (e.g. At a bike).
Reproduce:
Get this into a FS:
Whatever, thats just to give you a weapon, and check the ammo.
Now you do this:
Connect to the server and spawn, then type /give and /check:
Now shoot a rocket, and /check:
Now an UZI shot, and /check:
Now you switch your weapon to Rocket again, and you take a bike and take it as driver.
Then your weapon will be automatically the UZI, as rocket launcher is not a drive-by weapon.
Now make some shots with the UZI, and /check again:
Leave the bike, and do /check:
(Note: You should now hold the Rocket again, when you have left the bike.)
Enter it as driver again, and /check:
(Note: Still holding the Rocket.)
Same thing goes on again: ...
If you have any questions, or if you don't understand a part, just ask.
I'd appreciate it, if someone could confirm this, by checking it.
And I hope that this will be fixed in future releases.
Regards,
Jeffry
Description:
The function returns wrong values when you make a drive-by (e.g. At a bike).
Reproduce:
Get this into a FS:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/give", cmdtext, true) == 0)
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,28,500);
GivePlayerWeapon(playerid,35,500);
return 1;
}
if (strcmp("/check", cmdtext, true) == 0)
{
new weap, ammo;
GetPlayerWeaponData(playerid,4,weap,ammo);
new weap2, ammo2;
GetPlayerWeaponData(playerid,7,weap2,ammo2);
new string[128], string2[128];
format(string, 128, "Uzi: %d ammo", ammo);
format(string2, 128, "Rockets: %d ammo", ammo2);
SendClientMessage(playerid,0x0000FFFF, string);
SendClientMessage(playerid,0x0000FFFF, string2);
print(string); print(string2);
return 1;
}
return 0;
}
Now you do this:
Connect to the server and spawn, then type /give and /check:
Код:
[14:44:46] Uzi: 500 ammo [14:44:46] Rockets: 500 ammo
Код:
[14:44:54] Uzi: 500 ammo [14:44:54] Rockets: 499 ammo
Код:
[14:44:57] Uzi: 498 ammo [14:44:57] Rockets: 499 ammo
Then your weapon will be automatically the UZI, as rocket launcher is not a drive-by weapon.
Now make some shots with the UZI, and /check again:
Код:
[14:45:09] Uzi: 498 ammo [14:45:09] Rockets: 468 ammo
(Note: You should now hold the Rocket again, when you have left the bike.)
Код:
[14:45:19] Uzi: 445 ammo [14:45:19] Rockets: 499 ammo
(Note: Still holding the Rocket.)
Код:
[14:45:25] Uzi: 445 ammo [14:45:25] Rockets: 445 ammo
Код:
[14:45:41] Uzi: 445 ammo [14:45:41] Rockets: 439 ammo
I'd appreciate it, if someone could confirm this, by checking it.
And I hope that this will be fixed in future releases.
Regards,
Jeffry