Jump to content

CMD:STAFF


Ovii.Adv

Recommended Posts

sal baietii,am si eu o problema...

cu comanda /staff,cand dau /staff gen imi apar toate conturile inregistrate pe server

nu am facut ceva bine ?

ceva de genul arata cand dai /staff in joc

https://imgur.com/a/CpwSTv5

  1. CMD:staff(playerid)
  2. {
  3.     mysql_tquery(SQL, "SELECT `name`,`Admin`,`Helper` FROM `users` ORDER BY `id` DESC, `Admin` DESC, `Helper` DESC;", "showStaff", "d", playerid);
  4.     return 1;
  5. }
  6.  
  7. forward showStaff(playerid);
  8. public showStaff(playerid)
  9. {
  10.     if(cache_num_rows())
  11.     {
  12.         new staff_string[126], string_mare[300];
  13.         string_mare[0] = (EOS);
  14.  
  15.         strcat(string_mare, "Name\tAdmin level\nHelper level\n");
  16.  
  17.         for(new x; x < cache_num_rows(); x++)
  18.         {
  19.             new name[MAX_PLAYER_NAME]; cache_get_field_content(x, "name", name);
  20.             new admin = cache_get_field_content_int(x, "Admin");
  21.             new helper = cache_get_field_content_int(x, "Helper");
  22.  
  23.             format(staff_string, 126, "%s\t%d\t%d\n", name, admin, helper);
  24.             strcat(string_mare, staff_string);
  25.         }
  26.  
  27.         ShowPlayerDialog(playerid, 1, DIALOG_STYLE_TABLIST_HEADERS, "SERVER: List staff", string_mare, "Exit", "");
  28.     }
  29.     return 1;
  30. }
Link to comment
Share on other sites

mysql_tquery(SQL, "SELECT `name`,`Admin`,`Helper` FROM `users` WHERE `Admin` > '0' OR `Helper` > '0' ORDER BY `id` DESC, `Admin` DESC, `Helper` DESC;", "showStaff", "d", playerid); 

Incearca sa modifici linia a 3-a cu asta.

Facebook

YouTube

Discord: peiN#5187

Ofer servicii scripting de cea mai buna calitate. Ma puteti contacta prin PM / Facebook / Discord.

Link to comment
Share on other sites

La 08.10.2018 la 17:25, Ovii.Adv a spus:

sal baietii,am si eu o problema...

cu comanda /staff,cand dau /staff gen imi apar toate conturile inregistrate pe server

nu am facut ceva bine ?

ceva de genul arata cand dai /staff in joc

https://imgur.com/a/CpwSTv5

  1. CMD:staff(playerid)
  2. {
  3.     mysql_tquery(SQL, "SELECT `name`,`Admin`,`Helper` FROM `users` ORDER BY `id` DESC, `Admin` DESC, `Helper` DESC;", "showStaff", "d", playerid);
  4.     return 1;
  5. }
  6.  
  7. forward showStaff(playerid);
  8. public showStaff(playerid)
  9. {
  10.     if(cache_num_rows())
  11.     {
  12.         new staff_string[126], string_mare[300];
  13.         string_mare[0] = (EOS);
  14.  
  15.         strcat(string_mare, "Name\tAdmin level\nHelper level\n");
  16.  
  17.         for(new x; x < cache_num_rows(); x++)
  18.         {
  19.             new name[MAX_PLAYER_NAME]; cache_get_field_content(x, "name", name);
  20.             new admin = cache_get_field_content_int(x, "Admin");
  21.             new helper = cache_get_field_content_int(x, "Helper");
  22.  
  23.             format(staff_string, 126, "%s\t%d\t%d\n", name, admin, helper);
  24.             strcat(string_mare, staff_string);
  25.         }
  26.  
  27.         ShowPlayerDialog(playerid, 1, DIALOG_STYLE_TABLIST_HEADERS, "SERVER: List staff", string_mare, "Exit", "");
  28.     }
  29.     return 1;
  30. }
format(szQuery, sizeof(szQuery), "SELECT * FROM `users` WHERE `Admin`>'0' ORDER BY `users`.`Admin` ASC LIMIT 50");
					result = mysql_query(SQL, szQuery);
format(szQuery, sizeof(szQuery), "SELECT * FROM `users` WHERE `Helper`>'0' ORDER BY `users`.`Helper` ASC LIMIT 50");
					result = mysql_query(SQL, szQuery);	
incearac si in loc de cache_get_field_contentIn pune si cache_get_field_content fa  o diferenta

 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.