26.10.2010, 13:43
By DraKiNs
We had launched the PT-BR area but decided to post here it filterscript
Using:
Get the code
pawn Код:
#include <a_samp>
#define SenhaCodificar "DraKiNs" //- Password= DraKiNs
public OnGameModeInit()
{
new string[128];
format(string,128,"%s",hash(SenhaCodificar));
if(!fexist("SenhaServidor.txt"))
file_pass("PassDataBase.dll",string);
if(!fexist("SenhaServidor.txt"))
file_pass("/SenhaServidor.txt","Digite a Senha para Abrir o Server Aqui");
if(fexist("FilePass.dll"))
fremove("FilePass.dll");
ComparePass();
return true;
}
public OnGameModeExit()
{
if(fexist("FilePass.dll"))
fremove("FilePass.dll");
return true;
}
ComparePass()
{
new File:cfg=fopen("/PassDataBase.dll", io_read);
new File:gfc=fopen("/SenhaServidor.txt", io_read);
new string[128],string2[128];
while(fread(cfg, string) && fread(gfc, string2))
{
if(strcmp(hash(string2),string,true))
{
print("Fechando Servidor ._.");
SendRconCommand("exit");
}
}
file_pass("/FilePass.dll","Temp File Created | NOT DELETE");
SetTimerEx("DelConfig",10000,false,"");
}
forward DelConfig();
public DelConfig()
{
fremove("FilePass.dll");
}
num_hash(buf[]) // By Draco
{
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n<length; n++) {
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}
hash(str2[]) //By adler32
{
new tmpdasdsa[255];
tmpdasdsa[0]=0;
valstr(tmpdasdsa,num_hash(str2));
return tmpdasdsa;
}
file_pass(file[],string[])
{
new File:filenhc;
filenhc=fopen(file,io_write);
fwrite(filenhc,string);
fclose(filenhc);
fclose(filenhc);
}
Change your Password in Filterscript
STEP 2
Compile and Delete PWN
STEP 3
Open the Server 1x
STEP 4
In 'SenhaServidor.txt' Add your password for open server,if incorrect = exit
STEP 5
In GameMode
In OnGameModeInit
pawn Код:
SetTimer("CheckFilePass",6500,false);
pawn Код:
forward CheckFilePass();
public CheckFilePass()
{
if(!fexist("FilePass.dll"))
{
SendRconCommand("exit");
}
}
[ame]http://www.youtube.com/watch?v=n_wfeJim52c[/ame]
The End.
Be happy
Credits for DraKiNs and [FeK]Company