30.04.2015, 20:09
PHP код:
CMD:client(playerid, params[])
{
if(pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to do this");
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 ammo, weaponid, weapon[24], string[128],string1[128],string2[128], id,count;
if( sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /cw [ID]");
for (new c = 0; c < 13; c++)
{
GetPlayerWeaponData(id, c, weaponid, ammo);
if (weaponid == 0 && ammo == 0) continue;
count++;
}
if(count==0) return SendClientMessage(playerid, COLOR_GREY, "This player has no weapons!");
format(string, sizeof(string), "Players:%s(%d)\nDatabase ID:%d\nWeapons:",PlayerName(targetid),targetid,pInfo[playerid][ID]);
for (new c = 0; c < 13; c++)
{
GetPlayerWeaponData(id, c, weaponid, ammo);
if (weaponid == 0 && ammo == 0) continue;
GetWeaponName(weaponid, weapon, 24);
format(string1, sizeof(string1), "%s %s(%d)\n", string, weapon, ammo);
}
format(string2, sizeof(string2), "%s \n VirtualWorld:%d Interior:%d",string1,GetPlayerVirtualWorld(targetid),GetPlayerInterior(targetid));
return ShowPlayerDialog(playerid,DIALOG_ADMINS,DIALOG_STYLE_MSGBOX,"Viewing Client Info",string2,"Close","");
}
I dont have erors just an little bug
He show mee just 1 Weapon and if i have 2 or 3 or 4
He show mee just the first weapon
I want all weapons
Thank you +REP FOR YOU