29.04.2015, 20:30
PHP 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), "Weapons: %s Ammo: %d\n", 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");
}
This command was work sucsessfull
But i am try to change it from SendClientMessage To Dialog
I want to get weapons i dialog
But it gave mee just the first Weapon and ammo
Thanks