24.06.2012, 11:24
(
Last edited by Bombo; 15/10/2016 at 01:05 PM.
Reason: Поменялись кошельки WMR и WMZ
)
ПОИСК ИГРОКОВ ПО НИКУ, НА ВСЕХ СЕРВЕРАХ
Выглядит это следующим образом:
На команды
/find Wore1
/find swatt
/find DniX
будет получен следующий ответ:

ГЛОБАЛЬНЫЙ БАН ИГРОКОВ
Этот же скрипт позволяет забанить злостного читера так, чтобы он не смог зайти ни на один сервер (на котором установлен данный скрипт, разумеется)
Работает это так:
Допустим, на одном из серверов SA:MP выполняется команда
/gbanip 12.34.56.78
Тогда читер с ip-адресом 12.34.56.78 не зайдёт ни на один сервер с данным скриптом
Все команды глобального бана:
/gban [id]
/gbanip [ip]
/gunban [id]
/gunbanip [ip]
В скором времени добавлю бан по маске подсети и по нику, а также временный бан.
Смысл:
Отрезает читеров и спамеров, кочующих от сервака к серваку.
Всю работу выполняет удалённый сервер, т.ч. скрипт практически не занимает ресурсов.
Code:
//1.1b SA:MP GPS - Global Player Search by Bombo
#include <a_samp>
#include <a_http>
#include "../include/gl_common.inc"
forward FindPlayer(index, code, data[]);
forward CheckIP(index, code, data[]);
new UName[]="test";
new Pass[]="test";
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Global Player Search by Bombo");
print("--------------------------------------\n");
SendClientMessageToAll(9424500, "\n--------------------------------------");
SendClientMessageToAll(9424500, "Поиск игроков от Bombo");
SendClientMessageToAll(9424500, "--------------------------------------\n");
return 1;
}
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
new PlayerIP[16];
new PlayerName[48];
new http_msg[256];
new str_id[8];
GetPlayerIp(playerid, PlayerIP, sizeof(PlayerIP));
http_msg = "Playerid=";
valstr(str_id, playerid);
strcat(http_msg, str_id);
strcat(http_msg, "&CheckIP=");
strcat(http_msg, PlayerIP);
strcat(http_msg, "&Uname=");
strcat(http_msg, UName);
strcat(http_msg, "&Pwd=");
strcat(http_msg, Pass);
strcat(http_msg, "&PlayerName=");
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
strcat(http_msg, PlayerName);
HTTP(0, HTTP_POST, "botinform.com:9797", http_msg, "CheckIP"); //проверка на БАН
SendClientMessage(playerid, 9324500, "Для поиска игрока на всех серверах SAMP наберите: /find ник_игрока");
return 1;
}
public OnPlayerSpawn(playerid)
{
SendClientMessage(playerid, 9324500, "Для поиска игрока на всех серверах SAMP наберите: /find ник_игрока");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256+1];
new idx;
cmd = strtok(cmdtext, idx);
//if(!IsPlayerAdmin(playerid)) return 0; // this is an admin only script
//Команда "/help"
if(strcmp(cmd, "/help", true) == 0)
{
SendClientMessage(playerid, 9324500, "/find [ник_игрока] - поиск по всем серверам!");
if(IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, 9324500, "/gban [id] - бан по всем серверам с данным модом");
SendClientMessage(playerid, 9324500, "/gbanip [ip] - бан по ip на все сервера с данным модом");
SendClientMessage(playerid, 9324500, "/gunban [id] - разбан по всем серверам с данным модом");
SendClientMessage(playerid, 9324500, "/gunbanip [ip] - разбан по всем серверам с данным модом");
}
return 1;
}
//команда /find [ник]
if(strcmp(cmd, "/find", true) == 0)
{
new tmp[256];
new http_msg[512];
new str_id[8];
tmp = strtok(cmdtext,idx);
http_msg = "Playerid=";
valstr(str_id, playerid);
strcat(http_msg, str_id);
strcat(http_msg, "&Uname=");
strcat(http_msg, UName);
strcat(http_msg, "&Pwd=");
strcat(http_msg, Pass);
strcat(http_msg, "&Search=");
strcat(http_msg, tmp);
SendClientMessage(playerid, 9324500, "Searching...");
HTTP(0, HTTP_POST, "botinform.com:9797", http_msg, "FindPlayer");
return 1;
}
//команда "/gunban [player id]"
if(IsPlayerAdmin(playerid))
if(strcmp(cmd, "/gunban", true) == 0)
{
new tmp[256];
new nPlayerId;
new strPlayerIp[16];
new http_msg[512];
new str_id[8];
tmp = strtok(cmdtext,idx);
nPlayerId = strval(tmp);
GetPlayerIp(nPlayerId, strPlayerIp, sizeof(strPlayerIp));
http_msg = "Playerid=";
valstr(str_id, playerid);
strcat(http_msg, str_id);
strcat(http_msg, "&Uname=");
strcat(http_msg, UName);
strcat(http_msg, "&Pwd=");
strcat(http_msg, Pass);
strcat(http_msg, "&GUnban=");
strcat(http_msg, strPlayerIp);
SendClientMessage(playerid, 9324500, "Banning...");
HTTP(0, HTTP_POST, "botinform.com:9797", http_msg, "FindPlayer");
return 1;
}
//команда "/gunbanip [ip]"
if(IsPlayerAdmin(playerid))
if(strcmp(cmd, "/gunbanip", true) == 0)
{
new tmp[256];
new http_msg[512];
new str_id[8];
tmp = strtok(cmdtext,idx);
http_msg = "Playerid=";
valstr(str_id, playerid);
strcat(http_msg, str_id);
strcat(http_msg, "&Uname=");
strcat(http_msg, UName);
strcat(http_msg, "&Pwd=");
strcat(http_msg, Pass);
strcat(http_msg, "&GUnban=");
strcat(http_msg, tmp);
SendClientMessage(playerid, 9324500, "Unbanning...");
HTTP(0, HTTP_POST, "botinform.com:9797", http_msg, "FindPlayer");
return 1;
}
//команда "/gbanip [ip] [ник]"
if(IsPlayerAdmin(playerid))
if(strcmp(cmd, "/gbanip", true) == 0)
{
new tmp[256];
new http_msg[512];
new str_id[8];
new strPlayerIp[16];
new strPlayerName[24];
new strAdminName[24];
tmp = strtok(cmdtext,idx);
http_msg = "Playerid=";
valstr(str_id, playerid);
strcat(http_msg, str_id);
strcat(http_msg, "&Uname=");
strcat(http_msg, UName);
strcat(http_msg, "&Pwd=");
strcat(http_msg, Pass);
strcat(http_msg, "&GBan=");
strcat(http_msg, tmp);
strcat(http_msg, "&AdminIP=");
GetPlayerIp(playerid, strPlayerIp, sizeof(strPlayerIp));
strcat(http_msg, strPlayerIp);
strcat(http_msg, "&PlayerName=");
strPlayerName = strtok(cmdtext,idx);
strcat(http_msg, strPlayerName);
strcat(http_msg, "&Admin=");
GetPlayerName(playerid, strAdminName, sizeof(strAdminName));
strcat(http_msg, strAdminName);
SendClientMessage(playerid, 9324500, "Banning...");
HTTP(0, HTTP_POST, "botinform.com:9797", http_msg, "FindPlayer");
return 1;
}
//команда "/gban [player id]"
if(IsPlayerAdmin(playerid))
if(strcmp(cmd, "/gban", true) == 0)
{
new tmp[256];
new nPlayerId;
new strPlayerIp[16];
new http_msg[512];
new str_id[8];
new strPlayerName[24];
new strAdminName[24];
tmp = strtok(cmdtext,idx);
nPlayerId = strval(tmp);
http_msg = "Playerid=";
valstr(str_id, playerid);
strcat(http_msg, str_id);
strcat(http_msg, "&Uname=");
strcat(http_msg, UName);
strcat(http_msg, "&Pwd=");
strcat(http_msg, Pass);
strcat(http_msg, "&GBan=");
GetPlayerIp(nPlayerId, strPlayerIp, sizeof(strPlayerIp));
strcat(http_msg, strPlayerIp);
strcat(http_msg, "&AdminIP=");
GetPlayerIp(playerid, strPlayerIp, sizeof(strPlayerIp));
strcat(http_msg, strPlayerIp);
strcat(http_msg, "&Admin=");
GetPlayerName(playerid, strAdminName, sizeof(strAdminName));
strcat(http_msg, strAdminName);
strcat(http_msg, "&PlayerName=");
GetPlayerName(nPlayerId, strPlayerName, sizeof(strPlayerName));
strcat(http_msg, strPlayerName);
SendClientMessage(playerid, 9324500, "Banning...");
HTTP(0, HTTP_POST, "botinform.com:9797", http_msg, "FindPlayer");
return 1;
}
return 0;
}
public FindPlayer(index, code, data[])
{
new tmp[256];
new len,i,j,k;
new playerid;
new num[8];
// printf("%s", data);
for(i = 0; i < sizeof(num); ++i)
num[i] = '\0';
k = 0;
while(data[k] != ' ') //забираем playerid из начала сообщения
{
num[k] = data[k];
k++;
}
playerid = strval(num);
len = strlen(data);
for(i = k+1, j = 0; i < len; ++i)
{
tmp[j] = data[i];
if(tmp[j] == '\n' || tmp[j] == '\0')
{
tmp[j] = '\0';
if(tmp[j-1] == '\r')
tmp[j-1] = '\0';
SendClientMessage(playerid, 11240000, tmp); //пересылаем ответ от сервера в чат
j = 0;
continue;
}
j++;
}
}
public CheckIP(index, code, data[])
{
new tmp[1024];
new len,i,j,k;
new playerid;
new num[8];
new banned;
// printf("%s", data);
for(i = 0; i < sizeof(num); ++i)
num[i] = '\0';
k = 0;
while(data[k] != ' ') //забираем playerid из начала сообщения
{
num[k] = data[k];
k++;
}
playerid = strval(num);
for(i = k+1, j = 0; i < 6; ++i)
{
tmp[j] = data[i];
}
if(strcmp(tmp, "banned",true,6) == 0)
banned = true;
else
banned = false;
len = strlen(data);
for(i = k+1, j = 0; i < len; ++i)
{
tmp[j] = data[i];
if(tmp[j] == '\n' || tmp[j] == '\0')
{
tmp[j] = '\0';
SendClientMessage(playerid, 11240000, tmp); //пересылаем ответ от сервера в чат
j = 0;
continue;
}
j++;
}
// если игрок глобально забанен, ему кик:
if(banned)
Kick(playerid);
}
Желающие потестить в полном объёме обратитесь ко мне за логином и паролем, в личку (поля UName[] и Pass[] в самом начале скрипта, если кто не просёк). Эта мера вынужденная, дабы не захламили/не повесили мне сервак.
Да, кстати, аренда сервера денюшку стоит, т.ч.:
R211309231066
Z841169965648,
E226595298971
буду весьма признателен
Опробовать поиск можно здесь: botinform.com:7797, либо так:
HTML Code:
<html> <head> <title>Поиск игроков</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /> </head> <body> <div align=center> <h2>ПОИСК ПО НИКУ</h2> <FORM action="http://botinform.com:9797" method="post"> <P> Введите ник: <INPUT type="text" name="Search"> <INPUT type="submit" value="Поиск"> <INPUT type="hidden" name="Browser"> <INPUT type="hidden" name="Uname" value="test"> <INPUT type="hidden" name="Pwd" value="test"> </P> </FORM> </div> </body> </html>


