Client CmD
#2

Fixed up your code
  1. ShowPlayerDialog() doesn't need to be called 13 times (put it outside the loop)
  2. You need to add the string to the string
pawn Code:
CMD:client(playerid, params[])
{
    if(pInfo[playerid][pAdminLevel] >= 1)
    {

        new AdminDutyMsg[128], targetid;
        format(AdminDutyMsg, sizeof(AdminDutyMsg), ""COL_WHITE"["COL_CADMIN"ADMIN"COL_WHITE"]"COL_CGREY" %s > client > %s" ,PlayerName(playerid), PlayerName(targetid));
        SendMessageToAllAduty(-1,AdminDutyMsg);
        new count = 0;
        new ammo, weaponid, weapon[24], string[128], id;
        if(!sscanf(params, "u", id))
        {
                for (new c = 0; c < 13; c++)
                {
                    GetPlayerWeaponData(id, c, weaponid, ammo);
                    if (weaponid != 0 && ammo != 0)
                    {
                        count++;
                    }
                }
                SendClientMessage(playerid, COLOR_ORANGE, "||=============WEAPONS AND AMMO===========||");

                if(count > 0)
                {
                    for (new c = 0; c < 13; c++)
                    {
                        GetPlayerWeaponData(id, c, weaponid, ammo);
                        if (weaponid != 0 && ammo != 0)
                        {
                            GetWeaponName(weaponid, weapon, 24);
                            format(string, sizeof(string), "%sWeapons: %s  Ammo: %d\n", string, weapon, ammo);
                        }
                    }
                    ShowPlayerDialog(playerid,DIALOG_ADMINS,DIALOG_STYLE_MSGBOX,"Client",string,"Close","");
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "This player has no weapons!");
                }
                return 1;
        }
        else return SendClientMessage(playerid, COLOR_GREY, "USAGE: /cw [ID]");
    }
    else return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to do this");
}
Reply


Messages In This Thread
Client CmD - by arlindi - 29.04.2015, 20:30
Re: Client CmD [+REP] - by zeax - 29.04.2015, 20:36
Re: Client CmD - by arlindi - 29.04.2015, 20:39
Re: Client CmD - by Konstantinos - 29.04.2015, 20:39
Re: Client CmD - by arlindi - 29.04.2015, 20:46
Re: Client CmD - by arlindi - 29.04.2015, 21:11
Re: Client CmD - by arlindi - 30.04.2015, 11:28
Re: Client CmD - by arlindi - 30.04.2015, 17:36

Forum Jump:


Users browsing this thread: 1 Guest(s)