Advertisement
Guest User

Untitled

a guest
Aug 5th, 2016
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.48 KB | None | 0 0
  1. new pickup_Cash[MAX_PLAYERS][2];
  2.  
  3. #include <YSI\y_hooks>
  4.  
  5. hook OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) {
  6. if(hittype == BULLET_HIT_TYPE_VEHICLE) {
  7. for(new driver = 0; driver < MAX_PLAYERS; driver++) {
  8. if(GetPlayerVehicleID(driver) == hitid && GetPlayerVehicleSeat(driver) == 0) {
  9. if(GetPlayerTeam(driver) == GetPlayerTeam(playerid))
  10. GameTextForPlayer(driver, "~r~Don't hurt your teammate.", 3000, 4);
  11. else {
  12. SetVehicleHealth(hitid, 0);
  13. }
  14. break;
  15. }
  16. }
  17. }
  18. }
  19.  
  20. hook OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart) {
  21. if(GetPlayerTeam(issuerid) == GetPlayerTeam(playerid)) {
  22. GameTextForPlayer(issuerid, "~r~Don't hurt your teammate.", 3000, 4);
  23. new Float:health;
  24. GetPlayerHealth(playerid, health);
  25. SetPlayerHealth(playerid, health+amount);
  26. }
  27. }
  28.  
  29. hook OnPlayerDeath(playerid, killerid) {
  30. SetTimerEx("death", 1000, false, "ii", playerid, killerid);
  31. }
  32.  
  33. forward death(playerid, killerid);
  34. public death(playerid, killerid) {
  35. SetPlayerScore(playerid, GetPlayerScore(playerid)-1);
  36. SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
  37.  
  38. GivePlayerMoney(playerid, -50);
  39. GivePlayerMoney(killerid, 50);
  40.  
  41. switch(Account[playerid][Team]) {
  42. case TEAM_GROVE: { //Grove Street Family
  43. Account[playerid][Team] = TEAM_GROVE;
  44. SetPlayerColor(playerid, COLOR_GROVE);
  45. SetSpawnInfo(playerid, TEAM_GROVE, Account[playerid][Skin], 2512.9407, -1665.5356, 13.5741, 94.9650, 5, 1, 22, 500, 0, 0);
  46. SpawnPlayer(playerid);
  47. }
  48. case TEAM_BALLAS: { //Ballas
  49. Account[playerid][Team] = TEAM_BALLAS;
  50. SetPlayerColor(playerid, COLOR_BALLAS);
  51. SetSpawnInfo(playerid, TEAM_BALLAS, Account[playerid][Skin], 1895.5793, -1179.3634, 23.7991, 251.3599, 5, 1, 22, 500, 0, 0);
  52. SpawnPlayer(playerid);
  53. }
  54. case TEAM_VAGOS: { //Vagos
  55. Account[playerid][Team] = TEAM_VAGOS;
  56. SetPlayerColor(playerid, COLOR_VAGOS);
  57. SetSpawnInfo(playerid, TEAM_VAGOS, Account[playerid][Skin], 2791.8083, -1944.4026, 13.5469, 89.6026, 5, 1, 22, 500, 0, 0);
  58. SpawnPlayer(playerid);
  59. }
  60. case TEAM_AZTECAS: { //Aztecas
  61. Account[playerid][Team] = TEAM_AZTECAS;
  62. SetPlayerColor(playerid, COLOR_AZTECAS);
  63. SetSpawnInfo(playerid, TEAM_AZTECAS, Account[playerid][Skin], 1677.5970, -2112.8743, 13.5469, 271.7175, 5, 1, 22, 500, 0, 0);
  64. SpawnPlayer(playerid);
  65. }
  66. case TEAM_BIKERS: { //Bikers
  67. Account[playerid][Team] = TEAM_BIKERS;
  68. SetPlayerColor(playerid, COLOR_BIKERS);
  69. SetSpawnInfo(playerid, TEAM_BIKERS, Account[playerid][Skin], 681.0756, -475.5904, 16.3359, 178.6481, 5, 1, 22, 500, 0, 0);
  70. SpawnPlayer(playerid);
  71. }
  72. case TEAM_SHERIFF: { //Sheriffs
  73. Account[playerid][Team] = TEAM_SHERIFF;
  74. SetPlayerColor(playerid, COLOR_SHERIFF);
  75. SetSpawnInfo(playerid, TEAM_SHERIFF, Account[playerid][Skin], 630.8612, -571.7091, 16.3359, 269.6975, 5, 1, 22, 500, 0, 0);
  76. SpawnPlayer(playerid);
  77. }
  78. case TEAM_POLICE: { //Police
  79. Account[playerid][Team] = TEAM_POLICE;
  80. SetPlayerColor(playerid, COLOR_POLICE);
  81. SetSpawnInfo(playerid, TEAM_POLICE, Account[playerid][Skin], 1544.7908, -1675.7611, 13.5591, 88.5267, 5, 1, 22, 500, 0, 0);
  82. SpawnPlayer(playerid);
  83. }
  84. }
  85. ShowPlayerDialog(playerid, DIALOG_NOTICE, DIALOG_STYLE_MSGBOX, \
  86. ""COL_LBLUE"Los Angeles Gangsta"COL_DEF": Notice", \
  87. "Aw.. It seems like you died..\n\
  88. You lost all your weapons, "COL_DOLLAR"$200"COL_DEF" and a score.\n\
  89. But don't worry, you got a 9MM and a bat, enjoy.", \
  90. "Close", "");
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement