31.01.2014, 17:14
Tipo se eu pulo varias vezes o aviso aparece pra mim e pra outra pessoa, se eu sou kickado outras pessoas sгo kickadas ou seja ta tudo estranho nesse FS criado pelo CyNiC, se eu fiz o BH й pra eu ser avisado/kickado, oq hб de errado?
Obs: Tem uma variavel '' count '' no FS e tbm tem uma variavel ''count'' no gm, serб isso? Pois tentei mudar o count pra count2 do FS e nгo adiantou...
Obs: Tem uma variavel '' count '' no FS e tbm tem uma variavel ''count'' no gm, serб isso? Pois tentei mudar o count pra count2 do FS e nгo adiantou...
pawn Код:
/*
////////////////////////////////////////////////////////////////////////////////
• Insanity Anti-Bunny Hopping •
- Description
The filterscript avoid the use of Bunny Hopping in your server sending a message to the ao admins
online or kicking the player(you can configure it), if you use the GodFather,
you can use CallRemoteFunction to send a message to admins and/or call the function KickLog.
- Author
Allan Jader (CyNiC)
- Note
You can change how much you want the filterscript, leaving the credit to creator.
////////////////////////////////////////////////////////////////////////////////
*/
//Extern
#include <a_samp>
//Message Color
#define COLOR_WHITE 0xFFFFFFAA
//Configuration
#define MODE 0 // Mode 0: SEND A MESSAGE TO ADMINS / Mode 1: KICK THE PLAYER
#define MAX_WARNINGS 3
//Variables
new oldanim[MAX_PLAYERS][32],
PlayerSequence[MAX_PLAYERS][100],
count,
pTimer[MAX_PLAYERS];
//Forwards
forward CheckBunnyHopping(playerid);
forward ResetPlayer(playerid);
//Functions
public OnFilterScriptInit()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
pTimer[i]=SetTimerEx("CheckBunnyHopping",100,true,"d",i);
}
}
return 1;
}
public OnPlayerConnect(playerid)
{
pTimer[playerid]=SetTimerEx("CheckBunnyHopping",100,true,"d",playerid);
return 1;
}
public OnPlayerDisconnect(playerid)
{
KillTimer(pTimer[playerid]);
return 1;
}
public CheckBunnyHopping(playerid)
{
new animlib[32];
new animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
if(strcmp(oldanim[playerid],animname,true) != 0)
{
strcat(PlayerSequence[playerid],oldanim[playerid],100);
count++;
if(count >= 3 && GetPVarInt(playerid,"HasSended") == 0)
{
if(strfind(PlayerSequence[playerid],"JUMP_LAUNCH",true) != -1
&& strfind(PlayerSequence[playerid],"JUMP_LAND",true) != -1
&& strfind(PlayerSequence[playerid],"JUMP_GLIDE",true) != -1)
{
new string[80];
count=0;
format(PlayerSequence[playerid],1,"");
#if MODE == 0
format(string,80,"{FF0000}[x] O(a) jogador(a) %s estб fazendo bunnyhopp!",GetNick(playerid));
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerAdmin(i))
{
SendClientMessage(i,COLOR_WHITE,string);
}
}
#else
if(GetPVarInt(playerid,"Warnings") == MAX_WARNINGS)
{
format(string,80,"{FF0000}[ INFO ] O(a) jogador(a) %s foi expulso por fazer BunnyHopp!",GetNick(playerid));
SendClientMessageToAll(COLOR_WHITE,string);
Kick(playerid);
return 1;
}
#endif
SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[x] Vocк estб fazendo bunnyhopp, pare ou serб kickado!");
SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[x] BunnyHopp й quando vocк fica pulando sem parar, pare com isso!");
SetPVarInt(playerid,"HasSended",1);
SetPVarInt(playerid,"Warnings",GetPVarInt(playerid,"Warnings")+1);
SetTimerEx("ResetPlayer",5000,false,"d",playerid);
}
format(PlayerSequence[playerid],1,"");
count=0;
}
}
format(oldanim[playerid],32,"%s",animname);
return 1;
}
public ResetPlayer(playerid) return SetPVarInt(playerid,"HasSended",0);
GetNick(playerid) {
new N[MAX_PLAYER_NAME];
GetPlayerName(playerid, N, sizeof N);
return N;
}