Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <cstrike>
  4.  
  5. public OnPluginStart()
  6. {
  7. AddCommandListener(Command_JoinTeam, "jointeam");
  8. }
  9.  
  10. public Action:Command_JoinTeam(client, const String:command[], args)
  11. {
  12. decl String:TeamNumber[3];
  13. GetCmdArg(1, TeamNumber, sizeof(TeamNumber));
  14. new Team = StringToInt(TeamNumber);
  15. if(Team!=CS_TEAM_CT&&Team!=CS_TEAM_T&&Team!=CS_TEAM_SPECTATOR)
  16. {
  17. PrintCenterText(client, "Auto-Join is disabled.");
  18. ClientCommand(client, "play buttons/button11.wav");
  19. UTIL_TeamMenu(client);
  20. return Plugin_Handled;
  21. }
  22. if(Team==CS_TEAM_T&&GetTeamClientCount(CS_TEAM_T)>=1)
  23. {
  24. PrintCenterText(client, "Only one terrorist please.");
  25. ClientCommand(client, "play buttons/button11.wav");
  26. UTIL_TeamMenu(client);
  27. return Plugin_Handled;
  28. }
  29. return Plugin_Continue;
  30. }
  31.  
  32. UTIL_TeamMenu(client)
  33. {
  34. new clients[1];
  35. new Handle:bf;
  36. clients[0] = client;
  37.  
  38. bf = StartMessage("VGUIMenu", clients, 1);
  39. BfWriteString(bf, "team"); // panel name
  40. BfWriteByte(bf, 1); // bShow
  41. BfWriteByte(bf, 0); // count
  42. EndMessage();
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement