explain http(); someone?
#1

What is the http function used for? ive read the samp wiki and it doesnt make much sense to me.
Reply
#2

it is a thing which connects you with a website. For Example

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/stevenpaul",cmdtext,true))
    {
        HTTP(playerid, HTTP_GET, "www.crimeliferoleplay.com/stevenpaul.txt", "", "MyHttpResponse");
        return 1;
    }
    return 0;
}
it reads the txt on the page
Reply
#3

What does it do once it reads the txt on the page? how does this benefit me/
Reply
#4

all explanation HERE
Reply
#5

Quote:
Originally Posted by Steven Paul
Посмотреть сообщение
all explanation HERE
he obv. doesnt understand what it means by reading the page. He wants to know how people use it, and how it benefits them. If you stop spamming and read the OP you will see that he already read the wiki.

OP: I've seen it been used for a country finder, dont know how though
Reply
#6

what data is getting replied?? if you rread my original post you will see that ive already read that page
Reply
#7

ok let me teach you ok, If i am good at that

pawn Код:
public OnGameModeInit()
{
   
    HTTP(0,HTTP_GET,"i-fair.eu/test.txt","","GetHostnameFromServer"); // This send's the signal through your web
    return 1; // This returns it
}
forward GetHostnameFromServer(response_code,data[]); // This will forward the call back

public GetHostnameFromServer(response_code,data[]) // This is the callback for it
{
    if(response_code == 200) // If the response code is 200
    {
         printf("Content : %s",data); // This will print if it all works
    }  
    else printf("Failure ! Reason = %d",response_code); // else Failure
    {
       return 1; // This will return
    }
}

Sorry. I am not good at HTTP function
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)