Multi dintre playerii SA-MP posibil inca nustiu ce inseamna de a abuza de C-Bug. Asa ca avem un sistem anti c-bug.
Stand si reflectand asupra acestei probleme,totusi am gasit solutia impotriva acestui abuz ce ofera un avantaj considerabil unor playeri mai "destepti".
Astfel,in cazul codului meu,de fiecare data cand playerul va abuza de C-Bug,acestuia i se va scoate 25% HP (viata) si va fi avertizat cu un mesaj. Deja dumneavoastra puteti modifica usor sanctiunea intr-un simplu slap,kick,jail,etc.
Codul sub forma unui FilterScript:
#include <a_samp>
#define C_BUG_TIME 5
#define COLOR_RED 0xAA3333AA
#define COLOR_LIGHTRED 0xFF6347AA
#undef MAX_PLAYERS
#define MAX_PLAYERS 200
new P_CBUG_TICKS[MAX_PLAYERS];
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if(newkeys & KEY_FIRE && oldkeys & KEY_CROUCH && IsCbugWeapon(playerid))
{
P_CBUG_TICKS[playerid] ++;
if(P_CBUG_TICKS[playerid] > C_BUG_TIME)
{
new str2[128];
format(str2, sizeof(str2), "Jucatorul %s abuzeaza de C-Bug!", playername);
SendClientMessageToAll(COLOR_RED, str2);
SendClientMessage(playerid,COLOR_LIGHTRED,"Atentie! Va rugam sa nu abuzati de C-Bug pentru a nu fi sanctionat!");
P_CBUG_TICKS[playerid] = 0;
new Float:Health; GetPlayerHealth(playerid,Health); SetPlayerHealth(playerid,Health-25);
}
}
return 1;
}
stock IsCbugWeapon(playerid)
{
new weaponID = GetPlayerWeapon(playerid);
if(weaponID == 22 || weaponID == 24 || weaponID == 25 || weaponID == 27)
{
return 1;
}
return 0;
}