08.04.2012, 01:36
hi,
i want to make a cmd for admins to check players gun data.
Would this work?
i want to make a cmd for admins to check players gun data.
Would this work?
pawn Код:
dcmd_checkp(playerid,params[])
{
if(Spieler[playerid][AdminLevel] > 0)
{
new pID, weaposL[192];
if(sscanf(params, "u",pID))return SendClientMessage(playerid,0xFF0000FF,"Usage: /checkp [ID]");
new weapons[13][2];
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(pID, i, weapons[i][0], weapons[i][1]);
format(weaposL, sizeof weaposL, "%s WeaponID: %d | Ammo: %d\r\n", weaposL, weapons[i][0], weapons[i][1]);
}
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX,"{EE0000}Weapons", weaposL, "Ok", "Ok");
}else return SendClientMessage(playerid, 0xFF0000FF, "You are not admin!");
return 1;
}