SHARE
TWEET

Untitled

a guest Sep 18th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function ListGangMembers(playerid)
  2. {
  3.     new rows = cache_num_rows(), memberName[MAX_PLAYER_NAME], memberType, typeName[30], list_dialog_members[500];
  4.  
  5.     list_dialog_members = "Username\tType\tStatus";
  6.  
  7.     if(rows)
  8.     {
  9.         for(new i = 0; i < rows; i ++)
  10.         {
  11.             cache_get_value(i, "Username", memberName);
  12.             cache_get_value(i, "gangLeader", memberType);
  13.  
  14.             switch(memberType)
  15.             {
  16.                 case 0: typeName = "Member";
  17.                 case 1: typeName = "Leader";
  18.             }
  19.  
  20.             new name[MAX_PLAYER_NAME], bool:connected;
  21.  
  22.             foreach(new j : Player)
  23.             {
  24.                 GetPlayerName(j, name, sizeof(name)+1);
  25.                 if(!strcmp(name, memberName)) connected = true;
  26.             }
  27.  
  28.             if(connected) format(dialog, sizeof(dialog), "%s\n%s\t%s\t"GREEN"Online"WHITE, list_dialog_members, memberName, typeName);
  29.             else format(dialog, sizeof(dialog), "%s\n%s\t%s\t"RED"Offline"WHITE, list_dialog_members, memberName, typeName);
  30.         }
  31.         SPD(playerid, DIALOG_UNUSED, DIALOG_STYLE_TABLIST_HEADERS, "Gang Members", list_dialog_members, "Close", "");
  32.     }
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top