31.01.2011, 16:04
What is the http function used for? ive read the samp wiki and it doesnt make much sense to me.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/stevenpaul",cmdtext,true))
{
HTTP(playerid, HTTP_GET, "www.crimeliferoleplay.com/stevenpaul.txt", "", "MyHttpResponse");
return 1;
}
return 0;
}
all explanation HERE
|
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
}
}