Advertisement
SHUFEN

Untitled

May 28th, 2016
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. public int SteamWorks_OnClientGroupStatus(int authid, int groupid, bool isMember, bool isOfficer)
  2. {
  3.  
  4. int client = GetUserFromAuthID(authid);
  5.  
  6. if (client == -1)
  7. {
  8. return -1;
  9. }
  10.  
  11. if(isMember || isOfficer)
  12. {
  13. b_InGroup[client] = true;
  14. return 1;
  15. }
  16. return -1;
  17. }
  18.  
  19. public int GetUserFromAuthID(int authid)
  20. {
  21. for (int i = 1; i <= MaxClients; i++)
  22. {
  23. if(IsClientInGame(i)) {
  24. char charauth[64];
  25. GetClientAuthId(i, AuthId_Steam3, charauth, sizeof(charauth));
  26.  
  27. char charauth2[64];
  28. IntToString(authid, charauth2, sizeof(charauth2));
  29.  
  30. if(StrContains(charauth, charauth2, false) > -1)
  31. {
  32. return i;
  33. }
  34. }
  35. }
  36.  
  37. return -1;
  38. }
  39.  
  40. public Action Cmd_CheckGroup(int client, int args)
  41. {
  42. if(!IsClientInGame(client))
  43. return Plugin_Handled;
  44.  
  45. if (IsClientJoinedGroup(client))
  46. {
  47. PrintToChat(client, " \x10[\x09pŠ\x10] \x05You are a community member!!");
  48. }
  49. else {
  50. PrintToChat(client, " \x10[\x09pŠ\x10] \x05You are not a community member.");
  51. }
  52.  
  53. return Plugin_Handled;
  54. }
  55.  
  56. bool IsClientJoinedGroup(int client) {
  57. if(b_InGroup[client])
  58. return true;
  59.  
  60. return false;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement