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.

94 lines
1.7 KiB

5 years ago
5 years ago
  1. #include <a_samp>
  2. #include <core>
  3. #include <float>
  4. #pragma tabsize 0
  5. main()
  6. {
  7. print("\n----------------------------------");
  8. print(" Bare Script -- TEST\n");
  9. print("----------------------------------\n");
  10. }
  11. public OnPlayerConnect(playerid)
  12. {
  13. GameTextForPlayer(playerid,"~w~SA-MP: ~r~Testscript für GitLab CI",5000,5);
  14. return 1;
  15. }
  16. public OnPlayerCommandText(playerid, cmdtext[])
  17. {
  18. new idx;
  19. new cmd[256];
  20. cmd = strtok(cmdtext, idx);
  21. if(strcmp(cmd, "/yadayada", true) == 0) {
  22. return 1;
  23. }
  24. return 0;
  25. }
  26. public OnPlayerSpawn(playerid)
  27. {
  28. SetPlayerInterior(playerid,0);
  29. TogglePlayerClock(playerid,0);
  30. return 1;
  31. }
  32. public OnPlayerDeath(playerid, killerid, reason)
  33. {
  34. return 1;
  35. }
  36. SetupPlayerForClassSelection(playerid)
  37. {
  38. SetPlayerInterior(playerid,14);
  39. SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
  40. SetPlayerFacingAngle(playerid, 270.0);
  41. SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
  42. SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
  43. }
  44. public OnPlayerRequestClass(playerid, classid)
  45. {
  46. SetupPlayerForClassSelection(playerid);
  47. return 1;
  48. }
  49. public OnGameModeInit()
  50. {
  51. SetGameModeText("Bare Script");
  52. ShowPlayerMarkers(1);
  53. ShowNameTags(1);
  54. AllowAdminTeleport(1);
  55. AddPlayerClass(265,1958.3783,1343.1572,15.3746,270.1425,0,0,0,0,-1,-1);
  56. return 1;
  57. }
  58. strtok(const string[], &index)
  59. {
  60. new length = strlen(string);
  61. while ((index < length) && (string[index] <= ' '))
  62. {
  63. index++;
  64. }
  65. new offset = index;
  66. new result[20];
  67. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  68. {
  69. result[index - offset] = string[index];
  70. index++;
  71. }
  72. result[index - offset] = EOS;
  73. return result;
  74. }