Frisk command
#5

This should do what you need it to:

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;
}
Reference: https://sampwiki.blast.hk/wiki/GetPlayerWeaponData
Reply


Messages In This Thread
Frisk command - by zT KiNgKoNg - 19.03.2013, 19:39
Re: Frisk command - by Jstylezzz - 19.03.2013, 19:42
Re: Frisk command - by zT KiNgKoNg - 19.03.2013, 19:45
Re: Frisk command - by Stanford - 19.03.2013, 19:46
Re: Frisk command - by Scenario - 19.03.2013, 19:47
Re: Frisk command - by zT KiNgKoNg - 19.03.2013, 20:00
Re: Frisk command - by Scenario - 19.03.2013, 20:05
Re: Frisk command - by zT KiNgKoNg - 19.03.2013, 20:13
Re: Frisk command - by Joshman543 - 19.03.2013, 21:02

Forum Jump:


Users browsing this thread: 3 Guest(s)