YashasSamaga

Untitled

Aug 8th, 2015
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.41 KB | None | 0 0
  1. /*foreach(Player, i)
  2. {
  3. switch(PlayerInfo[i][Team])
  4. {
  5. case TEAM_USA: tcount[TEAM_USA]++;
  6. case TEAM_UK: tcount[TEAM_UK]++;
  7. case TEAM_GER: tcount[TEAM_GER]++;
  8. case TEAM_ARAB: tcount[TEAM_ARAB]++;
  9. case TEAM_RUS: tcount[TEAM_RUS]++;
  10. case TEAM_BALKAN: tcount[TEAM_BALKAN]++;
  11. case TEAM_TURKEY: tcount[TEAM_TURKEY]++;
  12. case TEAM_TERROR: tcount[TEAM_TERROR]++;
  13. case TEAM_CIVIL: tcount[TEAM_CIVIL]++;
  14. }
  15. }*/
  16.  
  17. public OnPlayerDisconnect(playerid,reason)
  18. {
  19. if(PlayerInfo[playerid][Team] != TEAM_NONE) TeamInfo[PlayerInfo[playerid][Team]][team_count]--;
  20. return 1;
  21. }
  22. // need to update the teams in /setteam
  23.  
  24. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  25. {
  26. static str[128];
  27. for(new i=0; i < 100; i++) SendClientMessage(playerid, WHITE, " ");
  28.  
  29. SendDeathMessageToPlayer(playerid, 202, 202, 202);
  30. SendDeathMessageToPlayer(playerid, 202, 202, 202);
  31. SendDeathMessageToPlayer(playerid, 202, 202, 202);
  32. SendDeathMessageToPlayer(playerid, 202, 202, 202);
  33. SendDeathMessageToPlayer(playerid, 202, 202, 202);
  34. SendDeathMessageToPlayer(playerid, 202, 202, 202);
  35.  
  36. //if(_:clickedid == INVALID_TEXT_DRAW) return SelectTextDraw(playerid, 0xFF0000FF);
  37.  
  38. new total = GetPlayerPoolSize();
  39. for(new x=1; x < sizeof(TeamInfo); x++)
  40. {
  41. if(clickedid == TeamInfo[x][team_td])
  42. {
  43.  
  44. if(TeamInfo[x][team_count] > (total/4) && total > 20) return SendClientMessage(playerid, RED, "This team is full."), 1;
  45. if(PlayerInfo[playerid][Team] != TEAM_NONE) TeamInfo[PlayerInfo[playerid][Team]][team_count]--;
  46. SetPlayerTeam(playerid, x);
  47. PlayerInfo[playerid][Team] = x;
  48. TeamInfo[x][team_count]++;
  49.  
  50. format(str,sizeof(str), "Team set: %s.", TeamName(PlayerInfo[playerid][Team]));
  51. SendClientMessage(playerid, GREY, str);
  52.  
  53. PlayerPlaySound(playerid, 1149, 0.0, 0.0, 0.0);
  54.  
  55. if(x == TEAM_TERROR)
  56. {
  57. PlayerInfo[playerid][Class] = SUICIDER;
  58. CancelSelectTextDraw(playerid);
  59. ChosenClass[playerid] = false, ChosenTeam[playerid] = false;
  60. for(new y=0; y < sizeof(OutLook); y++) TextDrawHideForPlayer(playerid, OutLook[y]);
  61. for(new y=1; y < sizeof(TeamInfo); y++) TextDrawHideForPlayer(playerid, TeamInfo[y][team_td]);
  62. for(new y=1; y < sizeof(ClassInfo); y++) TextDrawHideForPlayer(playerid, ClassInfo[y][class_td]);
  63. SetSpawnInfo(playerid, TEAM_TERROR, 144, -88.0120, 1378.4677, 10.2734, 0, 0, 0, 0, 0, 0, 0);
  64. PlayerPlaySound(playerid, 1184, 0.0, 0.0, 0.0);
  65. TogglePlayerSpectating(playerid, false);
  66. }
  67. else ChosenTeam[playerid] = true, PlayerInfo[playerid][Class] = ASSAULT;
  68. return 1; //Player choose a Team TD so needn't check the Class TD
  69. }
  70. }
  71.  
  72. for(new x=1; x < sizeof(ClassInfo)-1; x++)
  73. {
  74. if(clickedid == ClassInfo[x][class_td])
  75. {
  76. if(!ChosenTeam[playerid]) return SendClientMessage(playerid, RED, "You need to choose your team before choosing your class.");
  77. if(x == DONATOR && PlayerInfo[playerid][VIP] < 5) return SendClientMessage(playerid, RED, "You need VIP level 5 to use Donator class.");
  78. if(PlayerInfo[playerid][Rank] < ClassInfo[x][class_rank])
  79. {
  80. format(str,sizeof(str), "You need rank %d (%d score) for %s class.", ClassInfo[x][class_rank], Ranks[ClassInfo[x][class_rank]][rank_score], ClassName(x));
  81. return SendClientMessage(playerid, RED, str);
  82. }
  83. PlayerInfo[playerid][Class] = x;
  84. PlayerPlaySound(playerid, 1149, 0.0, 0.0, 0.0);
  85.  
  86. format(str,sizeof(str), "Class set: %s.", ClassName(PlayerInfo[playerid][Class]));
  87. SendClientMessage(playerid, GREY, str);
  88. //------------------------------------------------------------------
  89.  
  90. CancelSelectTextDraw(playerid);
  91. ChosenClass[playerid] = false, ChosenTeam[playerid] = false;
  92. for(new y=0; y < sizeof(OutLook); y++) TextDrawHideForPlayer(playerid, OutLook[y]);
  93. for(new y=1; y < sizeof(TeamInfo); y++) TextDrawHideForPlayer(playerid, TeamInfo[y][team_td]);
  94. for(new y=1; y < sizeof(ClassInfo); y++) TextDrawHideForPlayer(playerid, ClassInfo[y][class_td]);
  95.  
  96. switch(PlayerInfo[playerid][Team])
  97. {
  98. case TEAM_USA: SetSpawnInfo(playerid, PlayerInfo[playerid][Team], 287, -253.7154, 2603.2998, 62.8582, 0, 0, 0, 0, 0, 0, 0);
  99. case TEAM_UK: SetSpawnInfo(playerid, PlayerInfo[playerid][Team], 285, -136.3097, 1116.5957, 20.1966, 0, 0, 0, 0, 0, 0, 0);
  100. case TEAM_GER: SetSpawnInfo(playerid, PlayerInfo[playerid][Team], 121, -1394.5361, 498.3870, 18.2344, 0, 0, 0, 0, 0, 0, 0);
  101. case TEAM_ARAB: SetSpawnInfo(playerid, PlayerInfo[playerid][Team], 143, -741.9535, 1586.3195, 27.1244, 0, 0, 0, 0, 0, 0, 0);
  102. case TEAM_RUS: SetSpawnInfo(playerid, PlayerInfo[playerid][Team], 179, -1483.3645, 2626.5925, 58.7813, 0, 0, 0, 0, 0, 0, 0);
  103. case TEAM_BALKAN: SetSpawnInfo(playerid, PlayerInfo[playerid][Team], 250, 950.7467, 2361.2383, 10.8203, 0, 0, 0, 0, 0, 0, 0);
  104. case TEAM_TURKEY: SetSpawnInfo(playerid, PlayerInfo[playerid][Team], 122, -2279.4128, 2288.3809, 4.9645, 0, 0, 0, 0, 0, 0, 0);
  105. case TEAM_CIVIL: SetSpawnInfo(playerid, NO_TEAM, 288, 2592.2097, 2790.6689, 11.3685, 0, 0, 0, 0, 0, 0, 0), SetPlayerTeam(playerid, NO_TEAM);
  106. }
  107. PlayerPlaySound(playerid, 1184, 0.0, 0.0, 0.0);
  108. TogglePlayerSpectating(playerid, false);
  109. break;
  110. }
  111. }
  112. return 1;
  113. }
Advertisement
Add Comment
Please, Sign In to add comment