Автор: _KR]ee[D__
1. Читер телепортирует к себе 100500 авто? Решение есть:
Code: Select all
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2) SetPVarInt(playerid,"AC_MCS",GetTickCount());
else if(oldstate == 2) if((GetTickCount() - GetPVarInt(playerid,"AC_MCS")) <= 250) return Kick(playerid);
return 1;
}
2. Убирает флуд смены мест.
Code: Select all
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if((newstate == 2 && oldstate == 3) || (newstate == 3 && oldstate == 2)) return Kick(playerid);
return 1;
}
3. Не пускает больше 2х соединений на сервер с одного IP
Code: Select all
public OnPlayerConnect(playerid)
{
new ip[2][16];
GetPlayerIp(playerid,ip[0],16);
for(new i, m = GetMaxPlayers(), x; i != m; i++)
{
if(!IsPlayerConnected(i) || i == playerid) continue;
GetPlayerIp(i,ip[1],16);
if(!strcmp(ip[0],ip[1],true)) x++;
if(x > 2) return Kick(i);
}
return 1;
}
4. Убирает краш сервера путем флуда в киллчат:
Code: Select all
public OnPlayerSpawn(playerid)
{
SetPVarInt(playerid,"K_Times",0);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SetPVarInt(playerid,"K_Times",GetPVarInt(playerid,"K_Times") + 1);
if(GetPVarInt(playerid,"K_Times") > 1) return Kick(playerid);
return 1;
}
5. Убирает баг подмены диалогов через ArtMoney:
Code: Select all
//в начало после инклудов (обязательно!!!)
SPSD(playerid, dialogid, style, caption[], info[], button1[], button2[])
{
SetPVarInt(playerid,"DialogID",dialogid);
return ShowPlayerDialog(playerid,dialogid,style,caption,info,button1,button2);
}
#define ShowPlayerDialog SPSD
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(GetPVarInt(playerid,"DialogID") != dialogid) return Kick(playerid);
return 0;
}
public OnPlayerConnect(playerid)
{
SetPVarInt(playerid,"DialogID",-1);
return 1;
}