Guest User

Untitled

a guest
Feb 2nd, 2013
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. #include <a_samp>
  2. #include <core>
  3. #include <float>
  4.  
  5. #pragma tabsize 0
  6.  
  7. main()
  8. {
  9. print("\n----------------------------------");
  10. print(" Bare Script\n");
  11. print("----------------------------------\n");
  12. }
  13.  
  14. public OnPlayerConnect(playerid)
  15. {
  16. GameTextForPlayer(playerid,"~w~SA-MP: ~r~Bare Script",5000,5);
  17. return 1;
  18. }
  19.  
  20. public OnPlayerCommandText(playerid, cmdtext[])
  21. {
  22. new idx;
  23. new cmd[256];
  24.  
  25. cmd = strtok(cmdtext, idx);
  26.  
  27. if(strcmp(cmd, "/yadayada", true) == 0) {
  28. return 1;
  29. }
  30. if(strcmp(cmd, "/freeze", true) == 0) {
  31. TogglePlayerControllable(playerid, false);
  32. return 1;
  33. }
  34. if(strcmp(cmd, "/unfreeze", true) == 0) {
  35. TogglePlayerControllable(playerid, true);
  36. return 1;
  37. }
  38.  
  39. if(strcmp(cmd, "/wep", true) == 0) {
  40. GivePlayerWeapon(playerid, 31, 2000);
  41. GivePlayerWeapon(playerid, 24, 2000);
  42. GivePlayerWeapon(playerid, 34, 2000);
  43. return 1;
  44. }
  45.  
  46. return 0;
  47. }
  48.  
  49. public OnPlayerSpawn(playerid)
  50. {
  51. SetPlayerInterior(playerid,0);
  52. TogglePlayerClock(playerid,0);
  53. return 1;
  54. }
  55.  
  56. public OnPlayerDeath(playerid, killerid, reason)
  57. {
  58. return 1;
  59. }
  60.  
  61. SetupPlayerForClassSelection(playerid)
  62. {
  63. SetPlayerInterior(playerid,14);
  64. SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
  65. SetPlayerFacingAngle(playerid, 270.0);
  66. SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
  67. SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
  68. }
  69.  
  70. public OnPlayerRequestClass(playerid, classid)
  71. {
  72. SetupPlayerForClassSelection(playerid);
  73. return 1;
  74. }
  75.  
  76. public OnGameModeInit()
  77. {
  78. SetGameModeText("Bare Script");
  79. ShowPlayerMarkers(1);
  80. ShowNameTags(1);
  81. AllowAdminTeleport(1);
  82.  
  83. AddPlayerClass(265,1958.3783,1343.1572,15.3746,270.1425,0,0,0,0,-1,-1);
  84.  
  85. return 1;
  86. }
  87.  
  88. strtok(const string[], &index)
  89. {
  90. new length = strlen(string);
  91. while ((index < length) && (string[index] <= ' '))
  92. {
  93. index++;
  94. }
  95.  
  96. new offset = index;
  97. new result[20];
  98. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  99. {
  100. result[index - offset] = string[index];
  101. index++;
  102. }
  103. result[index - offset] = EOS;
  104. return result;
  105. }
Advertisement
Add Comment
Please, Sign In to add comment