WTFCS Community | Gaming community @ since 2011

Full Version: [Tutorial] Anti Joypad
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Sall all!
Cu toti cred ca am auzit de joypad sau AIM. Ei... bine este destul de folosit si aduce un avantaj ridicat fata de playerii care nu il folosesc!
In acest tutorial o sa va spun cum sa creati un FileScript Anti-Joypad!

Ce aveti de facut? pai nu mare lucru:

Deschidem pawno new project si scriem:


#define MAX_AIM_TICKS 3
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid) {
if(damagedid == INVALID_PLAYER_ID || !CheckFireArm(GetPlayerWeapon(playerid)) || GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID) return 1;
new count = GetPVarInt(playerid, "aimcount"), ticks = GetPVarInt(playerid, "aimtick"), currtick = GetTickCount();
if(currtick - ticks <= 10000 && count + 1 >= MAX_AIM_TICKS) {
new msg[144], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(msg, 144, "%s[%i] a primit kick pentru suspectarea in folosirea Aim / Joypad.", name, playerid);
// In loc de : a primit kick pentru suspectarea in folosirea Aim / Joypad
// puteti pune ori ce mesaj doriti! Acest mesaj va fi afisat tuturor dupa ce este depistat si scos cheaterul!
SendClientMessageToAll(-1, msg);
Kick(playerid); // Daca doriti ca playerul sa fie banat in loc de kick scrieti ban!
}
else if(currtick - ticks > 10000) {
DeletePVar(playerid, "aimcount");
DeletePVar(playerid, "aimtick");
count = 0;
currtick = GetTickCount();
}
SetPVarInt(playerid, "aimcount", count + 1);
SetPVarInt(playerid, "aimtick", currtick);
return 1;
}

CheckFireArm(weaponid) {
switch(weaponid) {
case 16..39, 41..43: return 1;
default: return 0;
}
return 0;
}

PENTRU PLAYERI INCEPATORI O SA PUN CEEA CE TREBUIE SCRIS IN PAWNO MAI JOS PENTRU A PUTEA FI LUAT CU COPY PASTE SI CUM AM ZIS MAI SUS PUTETI MODIFICA KICK CU BAN! EU AM FACUT SCRIPTUL CU INTENTIA DE KICK!

Pawno code:

#define MAX_AIM_TICKS 3
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid) {
if(damagedid == INVALID_PLAYER_ID || !CheckFireArm(GetPlayerWeapon(playerid)) || GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID) return 1;
new count = GetPVarInt(playerid, "aimcount"), ticks = GetPVarInt(playerid, "aimtick"), currtick = GetTickCount();
if(currtick - ticks <= 10000 && count + 1 >= MAX_AIM_TICKS) {
new msg[144], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(msg, 144, "%s[%i] a primit kick pentru suspectarea in folosirea Aim / Joypad.", name, playerid);
SendClientMessageToAll(-1, msg);
Kick(playerid);
}
else if(currtick - ticks > 10000) {
DeletePVar(playerid, "aimcount");
DeletePVar(playerid, "aimtick");
count = 0;
currtick = GetTickCount();
}
SetPVarInt(playerid, "aimcount", count + 1);
SetPVarInt(playerid, "aimtick", currtick);
return 1;
}

CheckFireArm(weaponid) {
switch(weaponid) {
case 16..39, 41..43: return 1;
default: return 0;
}
return 0;
}