SAMP Gitlab CI Test
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
910 B

  1. //------------------------------------------------
  2. #include <a_samp>
  3. #include <a_http>
  4. forward MyHttpResponse(index, response_code, data[]);
  5. //------------------------------------------------
  6. public OnFilterScriptInit()
  7. {
  8. print("\n--HTTP Test Loaded.\n");
  9. return 1;
  10. }
  11. //------------------------------------------------
  12. public MyHttpResponse(index, response_code, data[])
  13. {
  14. new showdata[256+1];
  15. format(showdata, 256, "Index: %d ResponseCode: %d Data: %s", index, response_code, data);
  16. SendClientMessage(index, 0xFFFFFFFF, showdata);
  17. }
  18. //------------------------------------------------
  19. public OnPlayerCommandText(playerid, cmdtext[])
  20. {
  21. new cmd[256+1];
  22. if(strcmp("/httptest", cmd, true) == 0)
  23. {
  24. HTTP(playerid, HTTP_GET, "sa-mp.com/return.txt", "", "MyHttpResponse");
  25. return 1;
  26. }
  27. return 0;
  28. }
  29. //------------------------------------------------