Get player ammo
#1

Hi guys, I have a simple question, but I can't find out how to do it. I want to get the player ammo for certain weapon and return it in a message.
Example message is:
Код:
The player has 7 ammo of AK-47.
Thanks in advance.
Reply
#2

pawn Код:
New Weapon, Ammo, String[128], WepName[32], pName[MAX_PLAYER_NAME];
GetPlayerWeapon(playerid, Weapon);
GetPlayerAmmo(playerid, Ammo);
GetWeaponName(Weapon, WepName, sizeof(wepName);
GetPlayerName(playerid, pName, sizeof(pName);
format(String, sizeof(string), "%s has %d ammo of %s", pName, Ammo, WepName);
SendClientMessage(playerid, Color, String);
GetPlayerWeaponData Might be helpful too
Reply
#3

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
pawn Код:
New Weapon, Ammo, String[128], WepName[32], pName[MAX_PLAYER_NAME];
GetPlayerWeapon(playerid, Weapon);
GetPlayerAmmo(playerid, Ammo);
GetWeaponName(Weapon, WepName, sizeof(wepName);
GetPlayerName(playerid, pName, sizeof(pName);
format(String, sizeof(string), "%s has %d ammo of %s", pName, Ammo, WepName);
SendClientMessage(playerid, Color, String);
GetPlayerWeaponData Might be helpful too
Ok, thank you for the fast response. REP+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)