MistarA

Untitled

Nov 29th, 2019
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.17 KB | None | 0 0
  1. #include <a_samp>
  2. #include <core>
  3. #include <float>
  4. #include <zcmd>
  5.  
  6.  
  7. #pragma tabsize 0
  8.  
  9.  
  10. #define COLOR_LIGHTRED 0xFF6347AA // 0xB33C3CAA
  11. #define COL_RED "{B33C3C}"
  12. new Text3D:deathlabel[MAX_PLAYERS];
  13. new bool:isAlive[MAX_PLAYERS];
  14. new bool:stopanimAllowed[MAX_PLAYERS];
  15. new Float:Deadx[MAX_PLAYERS], Float:Deady[MAX_PLAYERS], Float:Deadz[MAX_PLAYERS];
  16. new deadvw[MAX_PLAYERS];
  17. new deadint[MAX_PLAYERS];
  18. new oldskin[MAX_PLAYERS];
  19. new killed[MAX_PLAYERS];
  20.  
  21. enum pInfo
  22. {
  23. pWeapon1,
  24. pWeapon2,
  25. pWeapon3,
  26. pWeapon4,
  27. pWeapon5,
  28. pWeapon6,
  29. pWeapon7,
  30. pWeapon8,
  31. pWeapon9,
  32. pWeapon10,
  33. pWeapon11,
  34. pWeapon12,
  35. pWeapon13,
  36. pWeapon14
  37. }
  38.  
  39. enum E_SHOT_INFO
  40. {
  41. Chest,
  42. Crotch,
  43. LArm,
  44. RArm,
  45. LLeg,
  46. RLeg,
  47. Head,
  48. Misc
  49. }
  50. new sInfo[MAX_PLAYERS][E_SHOT_INFO];
  51. forward ResetPlayerStats(playerid);
  52. forward OperationDone(playerid);
  53.  
  54. main()
  55. {
  56. print("\n----------------------------------");
  57. print(" Bare Script\n");
  58. print("----------------------------------\n");
  59. }
  60.  
  61. public OnPlayerConnect(playerid)
  62. {
  63. GameTextForPlayer(playerid,"~w~SA-MP: ~r~Bare Script",5000,5);
  64. ResetPlayerStats(playerid);
  65. return 1;
  66. }
  67.  
  68. public OnPlayerCommandText(playerid, cmdtext[])
  69. {
  70. new idx;
  71. new cmd[256];
  72.  
  73. cmd = strtok(cmdtext, idx);
  74.  
  75. if(strcmp(cmd, "/yadayada", true) == 0) {
  76. return 1;
  77. }
  78.  
  79. return 0;
  80. }
  81.  
  82. public OnPlayerSpawn(playerid)
  83. {
  84. SetPlayerInterior(playerid,0);
  85. TogglePlayerClock(playerid,0);
  86. sInfo[playerid][Misc] = 0;
  87. sInfo[playerid][Head] = 0;
  88. sInfo[playerid][Chest] = 0;
  89. sInfo[playerid][Crotch] = 0;
  90. sInfo[playerid][LArm] = 0;
  91. sInfo[playerid][RArm] = 0;
  92. sInfo[playerid][LLeg] = 0;
  93. sInfo[playerid][RLeg] = 0;
  94.  
  95. isAlive[playerid] == true;
  96.  
  97.  
  98. if(isAlive[playerid] == false)
  99. {
  100. SetPlayerPos(playerid, Deadx[playerid], Deady[playerid], Deadz[playerid]);
  101. SetPlayerInterior(playerid, deadint[playerid]);
  102. SetPlayerVirtualWorld(playerid, deadvw[playerid]);
  103. stopanimAllowed[playerid] = false;
  104. SendClientMessage(playerid, COLOR_LIGHTRED, "You're currently brutally wounded. If no-one helps you, you will die. /acceptdeath if you wish to give up.");
  105. TogglePlayerControllable(playerid,0);
  106. SetTimerEx("LoadDeathAnim", 1000, false, "i", playerid);
  107. SetPlayerSkin(playerid, oldskin[playerid]);
  108. for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, true);
  109.  
  110. new string[400];
  111. new holder[400];
  112.  
  113.  
  114. if(sInfo[playerid][Misc] > 0)
  115. {
  116. format(string, sizeof(string), ""COL_RED"%d bruises on their body.\n", sInfo[playerid][Misc]);
  117. strcat(holder, string, sizeof(holder));
  118. }
  119. if(sInfo[playerid][Head] > 0)
  120. {
  121. format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the head.\n", sInfo[playerid][Head]);
  122. strcat(holder, string, sizeof(holder));
  123. }
  124. if(sInfo[playerid][Chest] > 0)
  125. {
  126. format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the chest.\n", sInfo[playerid][Chest]);
  127. strcat(holder, string, sizeof(holder));
  128. }
  129. if(sInfo[playerid][Crotch] > 0)
  130. {
  131. format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the crotch.\n", sInfo[playerid][Crotch]);
  132. strcat(holder, string, sizeof(holder));
  133. }
  134. if(sInfo[playerid][LArm] > 0)
  135. {
  136. format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the left arm.\n", sInfo[playerid][LArm]);
  137. strcat(holder, string, sizeof(holder));
  138. }
  139. if(sInfo[playerid][RArm] > 0)
  140. {
  141. format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the right arm.\n", sInfo[playerid][RArm]);
  142. strcat(holder, string, sizeof(holder));
  143. }
  144. if(sInfo[playerid][LLeg] > 0)
  145. {
  146. format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the left leg.\n", sInfo[playerid][LLeg]);
  147. strcat(holder, string, sizeof(holder));
  148. }
  149. if(sInfo[playerid][RLeg] > 0)
  150. {
  151. format(string, sizeof(string), ""COL_RED"%d gun shot wound(s) in the right leg.\n", sInfo[playerid][RLeg]);
  152. strcat(holder, string, sizeof(holder));
  153. }
  154. deathlabel[playerid] = Create3DTextLabel(holder, -1, Deadx[playerid], Deady[playerid], Deadz[playerid], 10.0, 0, 0);
  155. }
  156.  
  157. return 1;
  158. }
  159.  
  160. public OnPlayerDeath(playerid, killerid, reason)
  161. {
  162. isAlive[playerid] = false;
  163. return 1;
  164. }
  165.  
  166. SetupPlayerForClassSelection(playerid)
  167. {
  168. SetPlayerInterior(playerid,14);
  169. SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
  170. SetPlayerFacingAngle(playerid, 270.0);
  171. SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
  172. SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
  173. }
  174.  
  175. public OnPlayerRequestClass(playerid, classid)
  176. {
  177. SetupPlayerForClassSelection(playerid);
  178. return 1;
  179. }
  180.  
  181.  
  182. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
  183. {
  184. new Float:HP;
  185. GetPlayerHealth(playerid, HP);
  186. if(weaponid == 4) SetPlayerHealth(playerid, HP-30);
  187. if(weaponid == 22) SetPlayerHealth(playerid, HP-25);
  188. if(weaponid == 32) SetPlayerHealth(playerid, HP-25);
  189. if(weaponid == 28) SetPlayerHealth(playerid, HP-25);
  190. if(weaponid == 30) SetPlayerHealth(playerid, HP-30);
  191. if(weaponid == 31) SetPlayerHealth(playerid, HP-21);
  192. if(weaponid == 34) SetPlayerHealth(playerid, HP-70);
  193. if(weaponid == 29) SetPlayerHealth(playerid, HP-25);
  194.  
  195. if(weaponid == 25) SetPlayerHealth(playerid, HP-40);
  196.  
  197. if(!IsPlayerConnected(playerid)) return 0;
  198. if(!IsPlayerConnected(issuerid)) return 0;
  199.  
  200. if(issuerid != INVALID_PLAYER_ID)
  201. {
  202. if(weaponid == 0 || weaponid == 1 || weaponid == 2 || weaponid == 3 || weaponid == 4 || weaponid == 5 ||
  203. weaponid == 6 || weaponid == 7 || weaponid == 8 || weaponid == 15)
  204. {
  205. sInfo[playerid][Misc] += 1;
  206. SendClientMessage(playerid, -1, "ai tras in misc si i-ai luat ");
  207. }
  208. }
  209. if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
  210. {
  211. SetPlayerHealth(playerid, 0.0);
  212. SendClientMessage(playerid, -1, "ai tras in cap cu sniper si i-ai luat ");
  213. }
  214. if(issuerid != INVALID_PLAYER_ID && bodypart == 3)
  215. {
  216. if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
  217. weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
  218. {
  219. sInfo[playerid][Chest] += 1;
  220. SendClientMessage(playerid, -1, "ai tras in chest si i-ai luat ");
  221. }
  222. }
  223. else
  224. {
  225. SendClientMessage(playerid, -1, "nu ia damage");
  226. }
  227. if(issuerid != INVALID_PLAYER_ID && bodypart == 4)
  228. {
  229. if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
  230. weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
  231. {
  232. sInfo[playerid][Crotch] += 1;
  233. SendClientMessage(playerid, -1, "ai tras in croatch si i-ai luat ");
  234. }
  235. }
  236. else
  237. {
  238. SendClientMessage(playerid, -1, "nu ia damage");
  239. }
  240. if(issuerid != INVALID_PLAYER_ID && bodypart == 5)
  241. {
  242. if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
  243. weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
  244. {
  245. sInfo[playerid][LArm] += 1;
  246. SendClientMessage(playerid, -1, "ai tras in l arm si i-ai luat ");
  247. }
  248. }
  249. else
  250. {
  251. SendClientMessage(playerid, -1, "nu ia damage");
  252. }
  253. if(issuerid != INVALID_PLAYER_ID && bodypart == 6)
  254. {
  255. if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
  256. weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
  257. {
  258. sInfo[playerid][RArm] += 1;
  259. SendClientMessage(playerid, -1, "ai tras in arm r si i-ai luat ");
  260. }
  261. }
  262. else
  263. {
  264. SendClientMessage(playerid, -1, "nu ia damage");
  265. }
  266. if(issuerid != INVALID_PLAYER_ID && bodypart == 7)
  267. {
  268. if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
  269. weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
  270. {
  271. sInfo[playerid][LLeg] += 1;
  272. SendClientMessage(playerid, -1, "ai tras in picor light si i-ai luat ");
  273. }
  274. }
  275. else
  276. {
  277. SendClientMessage(playerid, -1, "nu ia damage");
  278. }
  279. if(issuerid != INVALID_PLAYER_ID && bodypart == 8)
  280. {
  281. if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
  282. weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
  283. {
  284. sInfo[playerid][RLeg] += 1;
  285. SendClientMessage(playerid, -1, "ai tras in picior right si i-ai luat ");
  286. }
  287. }
  288. else
  289. {
  290. SendClientMessage(playerid, -1, "nu ia damage");
  291. }
  292. if(issuerid != INVALID_PLAYER_ID && bodypart == 9)
  293. {
  294. if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
  295. weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
  296. {
  297. SetPlayerHealth(playerid, HP-70);
  298. sInfo[playerid][Head] += 1;
  299. SendClientMessage(playerid, -1, "ai tras in cap si i-ai luat");
  300. }
  301. }
  302. else
  303. {
  304. SendClientMessage(playerid, -1, "nu ia damage");
  305. }
  306. return 1;
  307. }
  308.  
  309. public OnGameModeInit()
  310. {
  311. SetGameModeText("Bare Script");
  312. ShowPlayerMarkers(1);
  313. ShowNameTags(1);
  314. AllowAdminTeleport(1);
  315.  
  316. AddPlayerClass(265,1958.3783,1343.1572,15.3746,270.1425,0,0,0,0,-1,-1);
  317.  
  318. return 1;
  319. }
  320.  
  321.  
  322. public ResetPlayerStats(playerid)
  323. {
  324. sInfo[playerid][Misc] = 0;
  325. sInfo[playerid][Head] = 0;
  326. sInfo[playerid][Chest] = 0;
  327. sInfo[playerid][Crotch] = 0;
  328. sInfo[playerid][LArm] = 0;
  329. sInfo[playerid][RArm] = 0;
  330. sInfo[playerid][LLeg] = 0;
  331. sInfo[playerid][RLeg] = 0;
  332. isAlive[playerid] = true;
  333. }
  334.  
  335. strtok(const string[], &index)
  336. {
  337. new length = strlen(string);
  338. while ((index < length) && (string[index] <= ' '))
  339. {
  340. index++;
  341. }
  342.  
  343. new offset = index;
  344. new result[20];
  345. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  346. {
  347. result[index - offset] = string[index];
  348. index++;
  349. }
  350. result[index - offset] = EOS;
  351. return result;
  352. }
  353.  
  354. public OperationDone(playerid)
  355. {
  356. // FadeColorForPlayer(playerid,0,0,0,255,0,0,0,0,15,0);
  357. SendClientMessage(playerid, -1, "You have been treated at the hospital. The hospital bill is $50.");
  358. SetPlayerPos(playerid, 2034.1787,-1401.6705,17.2949);
  359. GivePlayerMoney(playerid, -50);
  360. SetPlayerHealth(playerid, 90.0);
  361. ClearAnimations(playerid);
  362. TogglePlayerControllable(playerid, 1);
  363. SetPlayerInterior(playerid, 0);
  364. SetPlayerVirtualWorld(playerid, 0);
  365. ResetPlayerWeapons(playerid);
  366. return 1;
  367. }
  368.  
  369. CMD:acceptdeath(playerid, params[])
  370. {
  371. if(isAlive[playerid] == false)
  372. {
  373. SendClientMessage(playerid, COLOR_LIGHTRED, "You have been rushed to the hospital and are undergoing an operation.");
  374. SetPlayerPos(playerid, -211.3207,-1759.6207,676.7153);
  375. SetPlayerInterior(playerid, 3);
  376. SetPlayerVirtualWorld(playerid, 0);
  377. // FadeColorForPlayer(playerid,0,0,0,0,0,0,0,255,15,0);
  378. SetTimerEx("OperationDone", 15000, false, "i", playerid);
  379. isAlive[playerid] = true;
  380. //ApplyPlayerAnimation(playerid,"CRACK","crckdeth1",4.1,1,1,1,1,1,1);
  381. Delete3DTextLabel(deathlabel[playerid]);
  382. sInfo[playerid][Chest] = 0;
  383. sInfo[playerid][Head] = 0;
  384. sInfo[playerid][Crotch] = 0;
  385. sInfo[playerid][RLeg] = 0;
  386. sInfo[playerid][LLeg] = 0;
  387. sInfo[playerid][RArm] = 0;
  388. sInfo[playerid][LArm] = 0;
  389. killed[playerid] = 0;
  390. }
  391. else
  392. {
  393. SendClientMessage(playerid, -1, "nu merge bos");
  394. }
  395. return 1;
  396. }
  397. CMD:m4(playerid, params[])
  398. {
  399.  
  400. GivePlayerWeapon(playerid, 31, 999);
  401. return 1;
  402. }
  403. CMD:sniper(playerid, params[])
  404. {
  405.  
  406. GivePlayerWeapon(playerid, 34, 999);
  407. return 1;
  408. }
  409. CMD:grenade(playerid, params[])
  410. {
  411. GivePlayerWeapon(playerid,16,999);
  412. return 1;
  413. }
Advertisement
Add Comment
Please, Sign In to add comment