09.07.2012, 16:48
(
Последний раз редактировалось Bombo; 15.10.2016 в 13:03.
Причина: New webmoney number
)
GLOBAL PLAYER SEARCH
Input:/find iljon
/find c3dr1c
/find redtom
Output:

Example: botinform.com:7797
pwn:
Код:
//1.1 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 InsertPlayer(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, "Global search by 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, "InsertPlayer"); //insert player in database
SendClientMessage(playerid, 9324500, "Type for search: /find nick");
return 1;
}
public OnPlayerSpawn(playerid)
{
SendClientMessage(playerid, 9324500, "Type for search: /find nick");
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
//command "/help"
if(strcmp(cmd, "/help", true) == 0)
{
SendClientMessage(playerid, 9324500, "/find [nick] - global search!");
return 1;
}
//command /find [nick]
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;
}
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] != ' ') //take playerid for answer
{
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); //answer
j = 0;
continue;
}
j++;
}
}
public InsertPlayer(index, code, data[])
{
new tmp[1024];
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] != ' ') //take playerid for answer
{
num[k] = data[k];
k++;
}
playerid = strval(num);
for(i = k+1, j = 0; i < 6; ++i)
{
tmp[j] = data[i];
}
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); //answer
j = 0;
continue;
}
j++;
}
}
Код HTML:
<html> <head> <title>SA:MP Search</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /> </head> <body> <div align=center> <h2>SEARCH BY NICK</h2> <FORM action="http://botinform.com:9797" method="post"> <P> Nick: <INPUT type="text" name="Search"> <INPUT type="submit" value="Search"> <INPUT type="hidden" name="Browser"> <INPUT type="hidden" name="Uname" value="test"> <INPUT type="hidden" name="Pwd" value="test"> </P> </FORM> </div> </body> </html>
Ask me (pm) for full version.
You can support this project:
Z841169965648 E226595298971 R211309231066

