11.05.2015, 07:18
I'm making a command that compares the weapon data that a player has to the weapon data their account has (for anti weapon hacking checking), but when I try to show what GetPlayerWeaponData shows, it doesn't work.
Anyone know what could be wrong?
pawn Код:
CMD:checkweapons(playerid, params[])
{
if(GetPVarInt(playerid, "LoggedIn") == 0) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You need to be logged in to use this command.");
new string[256], id;
if(Player[playerid][AdminLevel] >= 2)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_GREY, "[Server Command]: /checkweapons [playerid]");
new weapons[13][2];
for(new i=0; i<13; i++)
{
GetPlayerWeaponData(id, i, weapons[i][0], weapons[i][1]);
format(string, sizeof(string), "Slot %i: %i", i, weapons[i][0]);
}
ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Player's Client-Side Weapons", string, "OK", "");
format(string, sizeof(string), "%s's account weapons:", GetName(id));
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Slot 1: {FFFFFF}%i{C0C0C0} - Slot 2: {FFFFFF}%i{C0C0C0} - Slot 3: {FFFFFF}%i{C0C0C0} - Slot 4: {FFFFFF}%i{C0C0C0} - Slot 5: {FFFFFF}%i{C0C0C0} - Slot 6: {FFFFFF}%i{C0C0C0}", Player[id][Weapon1], Player[id][Weapon2], Player[id][Weapon3], Player[id][Weapon4], Player[id][Weapon5], Player[id][Weapon6]);
SendClientMessage(playerid, COLOR_GREY, string);
format(string, sizeof(string), "Slot 7: {FFFFFF}%i{C0C0C0} - Slot 8: {FFFFFF}%i{C0C0C0} - Slot 9: {FFFFFF}%i{C0C0C0} - Slot 10: {FFFFFF}%i{C0C0C0} - Slot 11: {FFFFFF}%i{C0C0C0} - Slot 12: {FFFFFF}%i{C0C0C0}", Player[id][Weapon7], Player[id][Weapon8], Player[id][Weapon9], Player[id][Weapon10], Player[id][Weapon11], Player[id][Weapon12]);
SendClientMessage(playerid, COLOR_GREY, string);
SendClientMessage(playerid, COLOR_LIGHTRED, "Note: If their client-side weapons don't match their account weapons, they are weapon hacking.");
}
else return SendClientMessage(playerid, COLOR_GREY, ADMIN);
return 1;
}