23.12.2014, 22:36
Hi
Can someone please help me with this problem I am having. The weapons on my server are saving and loading, but now trying to see if players are spawning weapons by comparing the weapons in each slot against the ones on the server side. For some reason if I spawn myself a weapon it doesn't warn me that I have spawned a weapon. It does however ban me if I am using a minigun, just doesnt warn admins about weapon spawning
Please can someone help.
Code:
Can someone please help me with this problem I am having. The weapons on my server are saving and loading, but now trying to see if players are spawning weapons by comparing the weapons in each slot against the ones on the server side. For some reason if I spawn myself a weapon it doesn't warn me that I have spawned a weapon. It does however ban me if I am using a minigun, just doesnt warn admins about weapon spawning
Please can someone help.
Code:
Код:
forward WepCheck(); public WepCheck() { new weapons[13][2], count, cheat, str[128]; for(new i = 0; i < MAX_PLAYERS; i++) { count = 0; cheat = 0; if(GetPlayerWeapon(i) == 38) { if(IsPlayerConnected(i)) { new reason[56], string[235], Query[500], pIpAddress[15]; format(reason, sizeof(reason), "Minigun"); format(string, sizeof(string), "ADMCMD: %s has been banned by Anti-Hack. Reason: %s", GetName(i), reason); SendClientMessageToAll(COLOR_RED, string); GetPlayerIp(i, pIpAddress, sizeof(pIpAddress)); strcat(Query,"INSERT INTO `bans`(`Name`,`Reason`,`BannedBy`,`IpAddress`,`Status`)"); strcat(Query," VALUES ('%s', '%s', 'Anti-Hack', '%s', '%s', 1)"); mysql_format(dbHandle, Query, sizeof(Query), Query, GetName(i), reason, pIpAddress); mysql_query(dbHandle, Query, false); Kick(i); format(string, sizeof(string), "ADMCMD: %s has been banned by Anti-Hack. Reason: %s", GetName(i), reason); Log("/logs/bans.txt", string); } } GetPlayerWeaponData(i, 0, weapons[0][0], weapons[0][1]); GetPlayerWeaponData(i, 0, weapons[1][0], weapons[1][1]); GetPlayerWeaponData(i, 0, weapons[2][0], weapons[2][1]); GetPlayerWeaponData(i, 0, weapons[3][0], weapons[3][1]); GetPlayerWeaponData(i, 0, weapons[4][0], weapons[4][1]); GetPlayerWeaponData(i, 0, weapons[5][0], weapons[5][1]); GetPlayerWeaponData(i, 0, weapons[6][0], weapons[6][1]); GetPlayerWeaponData(i, 0, weapons[7][0], weapons[7][1]); GetPlayerWeaponData(i, 0, weapons[8][0], weapons[8][1]); GetPlayerWeaponData(i, 0, weapons[9][0], weapons[9][1]); GetPlayerWeaponData(i, 0, weapons[10][0], weapons[10][1]); GetPlayerWeaponData(i, 0, weapons[11][0], weapons[11][1]); for(new c = 0; c <= 12; c++) { if(weapons[c][0] != gInfo[i][pGuns][c]) { cheat++; printf("weapon slot: %i", c); } count = c; } if(cheat >= 1) { format(str, sizeof(str), "%s [ID: %i] may possibly be weapon spawning", GetName(i), i); SendClientMessageToAdmins(COLOR_YELLOW, str, 1); } } return 1; }