SA-MP Forums Archive
[FilterScript] ******** Perfil BETA - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+----- Forum: Lançamentos/Releases (https://sampforum.blast.hk/forumdisplay.php?fid=56)
+----- Thread: [FilterScript] ******** Perfil BETA (/showthread.php?tid=398258)

Pages: 1 2


******** Perfil BETA - ipsBruno - 08.12.2012

Demonstraзгo:

Gonзalo Rebelo



Gustavo Araujo!



Lucas Nicolas!



Codigo:

Esse й o filterscript:
pawn Code:
#include a_samp

// =============================================================================

#define URL_********            "brunosilva.net16.net/tubi.php?user=%s"
#define URL_INFORMACOES         "graph.********.com/%s/"

// =============================================================================



#if !defined HTTP_ERROR_BAD_HOST

        #include a_http

#endif

#if !defined MAX_TEXTS
    #define MAX_TEXTS 10000
#endif


#define function::%0(%1) forward %0(%1); public %0(%1)


new textID[MAX_TEXTS + 1];

// ===========================================================================

public OnFilterScriptInit() {

    printf("Visualizador de Imagem do Perfil do ******** !!");

    return true;
}


public OnFilterScriptExit()
{
    return true;
}

public OnPlayerSpawn(playerid) {

    SendClientMessage(playerid, -1, "[Info] Caso deseja ver a imagem do perfil /imagemfb [perfil] ..");

    return true;
}


public OnPlayerCommandText(playerid, cmdtext[])
{

    if(!strcmp(cmdtext[1], "deletarfb", true)) {
        for(new i; i < MAX_TEXTS-100; i++ ) {
            if(bool: textID[i])
            {
                TextDrawDestroy(Text: i);
            }
        }
        return true;
    }
   
    if(!strcmp(cmdtext[1], "imagemfb", true, 8))
    {
       
       
        if( !cmdtext[8] ) {
            return SendClientMessage(playerid, -1, "[Erro] Use corretamente: /imagemfb [perfil]");
        }

        OnPlayerCommandText(playerid, "/deletarfb");
        ********Check(playerid, cmdtext[10]);
       
        return true;
    }
   
    return false;
}


// ===========================================================================

forward ExTextDrawCreate(playerid,  x, y, cor);
public  ExTextDrawCreate(playerid,  x, y, cor) {

    new Text:id = TextDrawCreate(float(x)+320-70, float(y)+240-50, ".");
   
    if(_:id < MAX_TEXTS) {
        textID [_:id] = 1;
    }
   
   
   
    TextDrawColor(id, cor);
    TextDrawShowForPlayer(playerid, id);
   
    return true;
}

// ===========================================================================

function::********Check(playerid, nome[]) {

    SendClientMessage(playerid, -1, "[Info] Pegando informaзхes do ******** !! Aguarde !!");

    new link[0xff];
    format(link, 0xff, URL_********, nome);
    HTTP(playerid, HTTP_GET, link, "\0", "********TratarImagem");
   
   
    format(link, 0xff, URL_INFORMACOES, nome);
    HTTP(playerid, HTTP_GET, link, "\0", "********TratarInformacoes");
   
    return true;
}


#pragma dynamic 400000

function::********TratarInformacoes(playerid, c, data[]) {

    if(strlen(data) < 0xf || c != 200)
        return SendClientMessage(playerid, -1, "[Erro] Erro ao pegar informacoes!");


    /////////////////////////////////////////////////////////
    new genero[24];
    if(!strcmp(jsonGet(data, "gender"), "male")) {
        genero = "masculino";
    }
    else {
        genero = "feminino";
    }
   
    ////////////////////////////////////////////////////////
   
    new espaco[2]; espaco = " ";
   
    new dialog[1024];
    format(dialog, 1024,
   
        "\
        {FF0000}Foto:\n\n\
        %50s{FF0000}Nome: {FFFFFF}%s\n\
        %50s{FF0000}Pais: {FFFFFF}%s\n\
        %50s{FF0000}Gкnero: {FFFFFF}%s\n\n\n\n\
        "
,
       
        espaco, jsonGet(data, "name"),
        espaco, jsonGet(data, "locale"),
        espaco, genero
    );
   
    ShowPlayerDialog(playerid, 0xfff, DIALOG_STYLE_MSGBOX, "******** Info", dialog, "Fechar", "");
   
    return true;
}


function::********TratarImagem(playerid, c, data[]) {

    if(strlen(data) < 0xFF || c != 200)
        return SendClientMessage(playerid, -1, "[Erro] Erro ao baixar a imagem!");

    new array[8000][11];
   
    SendClientMessage(playerid, -1, "[Info] Carregando a imagem na tela !!");
   
    data[strfind(data, "<!--")] = EOS;
    split(data, array, '|');

    static
        pixel_c,
        pixel_x,
        pixel_y;
   
    for(new i; i < 8000; i += 3) {

        if(strlen(array[i])) {

            pixel_c = ((strval( array[i] ))) ;
            pixel_x = strval( array[i + 1] );
            pixel_y = strval( array[i + 2]);
     
            ExTextDrawCreate(playerid, pixel_x, pixel_y, pixel_c);
        }
    }
    return true;
}

//
// split function
//  pego na wiki !
//

function::split(const strsrc[], strdest[][], delimiter)
{
    new i, li;
    new aNum;
    new len;
    while(i <= strlen(strsrc))
    {
        if(strsrc[i] == delimiter || i == strlen(strsrc))
        {
            len = strmid(strdest[aNum], strsrc, li, i, 11);
            strdest[aNum][len] = 0;
            li = i+1;
            aNum++;
        }
        i++;
    }
    return 1;
}

//
// jsonGet
// pegar um dado json e filtra- lo
// por bruno da si lva
///

jsonGet(json[], jsonid[])
{
    //////////////////////////////

    new json_info[72];
    new json_value[72];
   
    format(json_info, 72, "\"%s\":\"", jsonid);
   
    new i = strfind(json, json_info);

    if(i != -1)
    {
        format(json_value, 56, "%s", json[i+ strlen(json_info)]);

        i = strfind(json_value, "\"");

        if(i != -1) {
            json_value[i] = EOS;
        }
    }
   
    return json_value;
   
    //////////////////////////////
}
Cуdigo PHP (esse vocк nгo precisa):
PHP Code:
<?php
    
//_____________________________________________________
    
$usuario $_GET['user'];
    
$imagem Redirect("http://graph.********.com/$usuario/picture");
    
$dados file_get_contents$imagem );
    
file_put_contents("imagem.jpg"$dados);
    
//_____________________________________________________
    
list($width$height) = getimagesize("imagem.jpg");
    
//________________________________________________
    
    
$img imagecreatefromjpeg("imagem.jpg");    
    for(
$w 0$w $width$w ++ ) {
        for(
$h 0$h $height$h ++ ) {
        
            
$dd imagecolorat($img$w$h); 
            
            
$r = ($dd >> 16) & 0xFF;
            
$g = ($dd >> 8) & 0xFF;
            
$b $dd 0xFF;
            
            echo   
RGBToHex($r,$g,$b) . "|$w|$h|";
        }
    }
    
//_____________________________________________________
    
function RGBToHex($r$g$b) {
        
$hex str_pad(dechex($r), 2"0"STR_PAD_LEFT);
        
$hex.= str_pad(dechex($g), 2"0"STR_PAD_LEFT);
        
$hex.= str_pad(dechex($b), 2"0"STR_PAD_LEFT);
 
        return 
hexdec($hex."FF");
    }
    
//_____________________________________________________
    // Thanks to: http://stackoverflow.com/questions/3519939/make-curl-follow-redirects
    
function Redirect($url) {
        
$ch curl_init();
        
        
curl_setopt($chCURLOPT_URL$url);
        
curl_setopt($chCURLOPT_HEADERtrue);
        
curl_setopt($chCURLOPT_FOLLOWLOCATIONfalse);
        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
$a curl_exec($ch);
        
curl_close$ch );
        
$headers explode("\n",$a);
        
$redir $url;
        
$j count($headers);
        for(
$i 0$i $j$i++){
        if(
strpos($headers[$i],"Location:") !== false){
                
$redir trim(str_replace("Location:","",$headers[$i]));
                break;
            }
        }
        return 
$redir;
    }
    
    
//_____________________________________________________
    
unlink("imagem.jpg");
?>

Use:
/imagefb [nome********]
/deletarfb

Exemplo:
/imagefb ipsBruno
/imagefb suyann.dacio
/imagefb aninhaahsilva


Cadк seu deus agora?


Espero que gostem!

Criado por Bruno da Silva
Funзгo redirect agradeзo a este tуpico
Quote:
Originally Posted by ipsBruno
View Post
Antes que eu me esqueзa!

Agradecimentos a Joгo Pedro por ter me criado o hosting lб na 000web



Re: ******** Perfil BETA - dPlaYer_ - 08.12.2012

Nice !


#
Porquк nгo tou ai? =(


Respuesta: ******** Perfil BETA - [NVC]iTrevaS - 08.12.2012

lol, muito bom, agora quero ver a prуxima versгo


Re: ******** Perfil BETA - humildadeforever - 08.12.2012

AFFF! Й muita inteligencia pra uma pessoa sу. Compartilha a sua comigo! Ficou muuuuito legal, parabйns.

OBS: Eu, Bruno e Garfield ali, que lindice \o/


Respuesta: ******** Perfil BETA - ipsBruno - 08.12.2012

Outro exemplo com grande lucas nicolas




Re: ******** Perfil BETA - mau.tito - 08.12.2012

Muita da Hora .
Parabens sempre projetos inovadores.


Respuesta: ******** Perfil BETA - [NVC]iTrevaS - 08.12.2012

A unica coisa ruim й que quando a foto do perfil estб na dialog fica muito escura D: Serб que nгo tem como a foto ficar por 'cima' da dialog ?


Respuesta: ******** Perfil BETA - ipsBruno - 08.12.2012

Quote:
Originally Posted by [NVC]iTrevaS
View Post
A unica coisa ruim й que quando a foto do perfil estб na dialog fica muito escura D: Serб que nгo tem como a foto ficar por 'cima' da dialog ?
Era o que eu tava tentando, eu pensei em fazer tudo de text draw mesmo, mas tenho preguiзa de entrar no jogo e criar um textdraw para as informaзхes. No caso sу fechar a janela :d


Re: ******** Perfil BETA - death1 - 08.12.2012

soah peзoas limdas, a ana (fankeira) eh a mas -q .
@topic
Ficou muito bom, parabйns!


Re: ******** Perfil BETA - Dolby - 08.12.2012

O ъnico que nгo saiu na print foi eu -Okay, depois quando eu nгo te ensinar a programar, nгo vб achar ruim ein! -q

GenialІ. xD


Respuesta: Re: ******** Perfil BETA - ipsBruno - 08.12.2012

Quote:
Originally Posted by Gustavo_Araujo
View Post
O ъnico que nгo saiu na print foi eu -Okay, depois quando eu nгo te ensinar a programar, nгo vб achar ruim ein! -q

GenialІ. xD
Aqui uma foto do Gustavo Araujo!




Respuesta: ******** Perfil BETA - [NVC]iTrevaS - 08.12.2012

Mesmo assim ficou top


Respuesta: ******** Perfil BETA - ipsBruno - 08.12.2012

Obrigado pessoal

Coloquei mais imagens!


pra que me pediu em privado, sim, a imagem й retirada direto do ******** ¬¬


Re: ******** Perfil BETA - RebeloX - 08.12.2012

Eu nгo apareзo why?

Estб muito bom Bruno, impressionante, estб de parabйns


Respuesta: ******** Perfil BETA - ipsBruno - 08.12.2012

Quote:
Originally Posted by dPlaYer_
View Post
Nice !


#
Porquк nгo tou ai? =(
Nгo tenho seu ********. Baixa lб e digita

/imagefb [seuperfil]


Re: ******** Perfil BETA - BreakDriFT - 08.12.2012

Bem legal, bom trabalho.


Respuesta: ******** Perfil BETA - ipsBruno - 08.12.2012

Gonзalo, adicionei seu perfil.


Respuesta: ******** Perfil BETA - [NVC]iTrevaS - 08.12.2012

Bruno, essa й retirada direto do perfil do ******** mesmo ?


Re: Respuesta: ******** Perfil BETA - RebeloX - 08.12.2012

Quote:
Originally Posted by ipsBruno
View Post
Gonзalo, adicionei seu perfil.
Obrigado bruno


Respuesta: ******** Perfil BETA - ipsBruno - 08.12.2012

Quote:
Originally Posted by [NVC]iTrevaS
View Post
Bruno, essa й retirada direto do perfil do ******** mesmo ?
Й retirada pelo meu site e ree-lida retornando em pixel. Coloquei o cуdigo php no post principal!

Quote:
Originally Posted by ipsBruno
View Post
Obrigado pessoal

Coloquei mais imagens!


pra que me pediu em privado, sim, a imagem й retirada direto do ******** ¬¬