19.03.2013, 19:47
This should do what you need it to:
Reference: https://sampwiki.blast.hk/wiki/GetPlayerWeaponData
pawn Код:
CMD:frisk(playerid, params[])
{
new
iID
;
if(sscanf(params, "u", iID))
return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /frisk [nick/id]"), 1;
if(iID == INVALID_PLAYER_ID)
return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid nickname/ID specified."), 1;
new
weaponData[13][2],
szString[128],
szName[MAX_PLAYER_NAME]
;
GetPlayerName(iID, szName, sizeof(szName));
format(szString, sizeof(szString), "* %s's weapon information:", szName);
SendClientMessage(playerid, COLOR_YELLOW, szString);
SendClientMessage(playerid, COLOR_YELLOW, " ");
for(new i = 0; i < 13; i++)
{
GetPlayerWeaponData(iID, i, weaponData[i][0], weaponData[i][1]);
format(szString, sizeof(szString), "- Slot ID: %d Weapon ID: %d Ammo: %d", i, weaponData[i][0], weaponData[i][1]);
SendClientMessage(playerid, COLOR_YELLOW, szString);
}
return 1;
}