/factions new dialog
#1

I need your help!
This command, i want to work on new dialog ( DIALOG_TAB_LIST ). How can i put. Sorry, but my english is dust. )
pawn Код:
CMD:members(playerid, params[])
{
   if(playerVariables[playerid][pGroupRank] >= 6)
   {
      new aim[1500];
      format(aim, 256,"{FFB300}%s {FFFFFF}members: \n",groupVariables[playerVariables[playerid][pGroup]][gGroupName]);
      new memid;
      new stringg[256];
      mysql_format(handle, stringg, sizeof(stringg), "SELECT * FROM `playeraccounts` WHERE `playerGroup` = %d ORDER BY playerGroupRank DESC",playerVariables[playerid][pGroup]);
      new test[256], query[256], test2[256], test3[256], days[256];
      new Cache: result12 = mysql_query (handle, stringg);
      for ( new i, j = cache_get_row_count ( ); i != j; ++i )
      {
         cache_get_field_content(i, "playerName", query);
         format(Selected[memid][snume],24, query);
         cache_get_field_content(i, "playerGroupRank", test);
         cache_get_field_content(i, "playerCarWeapon3", test2);
         cache_get_field_content(i, "playerLastLogin", test3);
         cache_get_field_content(i, "playerDays", days);
         new id = GetPlayerID(Selected[memid][snume]);
         if(id != INVALID_PLAYER_ID)
         {
             format(aim, sizeof(aim), "%s%s - Rank: %s - FW: %s/3 - online right now - %s days\n",aim,query, test,test2, days);
         }
         else
         {
                format(aim, sizeof(aim), "%s%s - Rank: %s - %s/3 FW - %s - %s days\n",aim,query, test,test2, test3, days);
         }
         memid ++;
      }
      cache_delete(result12);
      ShowPlayerDialog(playerid,DIALOG_MEMBERS,DIALOG_STYLE_LIST,"Faction members",aim,"Select","Exit");
   }
   return 1;
}
I look like.
http://i.imgur.com/3aelSXK.png
Reply
#2

here is an example just format member and other thinks to string thru loop and that string use for dialog show, in example case: listitems
Код:
new listitems[] = "Rank-Name\tLast Login\tFW\tDays In Faction\n2 - RaydeNN.\t2015-06-10 16:02:45\t0/3 Fw\t22 days";
ShowPlayerDialog(playerid,9999,DIALOG_STYLE_TABLIST_HEADERS,"Faction Members",listitems,"Select","Exit");
Reply
#3

Quote:
Originally Posted by Dusan01
Посмотреть сообщение
here is an example just format member and other thinks to string thru loop and that string use for dialog show, in example case: listitems
Код:
new listitems[] = "Rank-Name\tLast Login\tFW\tDays In Faction\n2 - RaydeNN.\t2015-06-10 16:02:45\t0/3 Fw\t22 days";
ShowPlayerDialog(playerid,9999,DIALOG_STYLE_TABLIST_HEADERS,"Faction Members",listitems,"Select","Exit");
I don't understand.. Please, i want to look with %s.. I don't know work on this dialog. Help me!
Reply
#4

then try it like this:
Код:
CMD:members(playerid, params[])
{
   if(playerVariables[playerid][pGroupRank] >= 6)
   {
      new aim[1500];
	  new dialogtab[128];
      new memid;
      new stringg[256];
      mysql_format(handle, stringg, sizeof(stringg), "SELECT * FROM `playeraccounts` WHERE `playerGroup` = %d ORDER BY playerGroupRank DESC",playerVariables[playerid][pGroup]);
      new test[256], query[256], test2[256], test3[256], days[256];
      new Cache: result12 = mysql_query (handle, stringg);
	  format(dialogtab, sizeof(dialogtab), "Rank-Name\tLast Login\tFW\tDays In Faction\n");
      for ( new i, j = cache_get_row_count ( ); i != j; ++i )
      {
         cache_get_field_content(i, "playerName", query);
         format(Selected[memid][snume],24, query);
         cache_get_field_content(i, "playerGroupRank", test);
         cache_get_field_content(i, "playerCarWeapon3", test2);
         cache_get_field_content(i, "playerLastLogin", test3);
         cache_get_field_content(i, "playerDays", days);
         new id = GetPlayerID(Selected[memid][snume]);
         if(id != INVALID_PLAYER_ID)
         {
             format(aim, sizeof(aim), "%s%s - Rank: %s - FW: %s/3 - online right now - %s days\n",aim,query, test,test2, days);
         }
         else
         {
                format(aim, sizeof(aim), "%s%s - Rank: %s - %s/3 FW - %s - %s days\n",aim,query, test,test2, test3, days);
         }
         memid ++;
      }
      cache_delete(result12);
	  strcat(aim, dialogtab);
      ShowPlayerDialog(playerid,DIALOG_MEMBERS,DIALOG_STYLE_TABLIST_HEADERS,"Faction members",aim,"Select","Exit");
   }
   return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)