19.03.2013, 20:05
Try this:
pawn Код:
new eWeaponNames[][32] =
{
{"Unarmed"}, {"Brass Knuckles"}, {"Golf Club"}, {"Night Stick"}, {"Knife"}, {"Baseball Bat"}, {"Shovel"}, {"Pool Cue"}, {"Katana"}, {"Chainsaw"},
{"Purple Dildo"}, {"Big White Vibrator"}, {"Medium White Vibrator"}, {"Small White Vibrator"}, {"Flowers"}, {"Cane"}, {"Grenade"}, {"Teargas"}, {"Molotov"},
{" "}, {" "}, {" "}, {"Colt 45"}, {"Colt 45 (Silenced)"}, {"Desert Eagle"}, {"Normal Shotgun"}, {"Sawnoff Shotgun"}, {"Combat Shotgun"}, {"Micro Uzi (Mac 10)"},
{"MP5"}, {"AK47"}, {"M4"}, {"Tec9"}, {"Country Rifle"}, {"Sniper Rifle"}, {"Rocket Launcher"}, {"Heat-Seeking Rocket Launcher"}, {"Flamethrower"}, {"Minigun"},
{"Satchel Charge"}, {"Detonator"}, {"Spray Can"}, {"Fire Extinguisher"}, {"Camera"}, {"Night Vision Goggles"}, {"Infrared Vision Goggles"}, {"Parachute"}, {"Fake Pistol"}
};
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: %s Ammo: %d", i, eWeaponNames[weaponData[i][0]], weaponData[i][1]);
SendClientMessage(playerid, COLOR_YELLOW, szString);
}
return 1;
}