Command
#1

Hey guys can some1 help me how to create a command to see every single player who exist on my DB accounts with rank 7 ?

like /rank and give me a list with every user

StR_Marian

John_Smith

can some1 help me i don't know how to do it
Reply
#2

What type of database are you using?
Reply
#3

sql , users is the table with all account's and clans with all the clans from server
Reply
#4

Simply include this MySQL query in your /rank command:
Код:
SELECT * FROM users WHERE rank='7'
It will return all user accounts where rank is equal to 7. If you need help creating the command can you let me know both if you are using a command processor (such as zcmd) and what version of MySQL you are using.
Reply
#5

yea i need help in creating the comand i realy don't know how to add this line , i use zcmd and mysql version 5.1

and in my users table is CRank not only Rank , Rank is only for faction leader :P
Reply
#6

PHP код:
COMMAND:rank(playeridparams[])
{
  if(
playerData[playerid][playerLevel] >= 1// your admin system here
  
{
 
    new 
query[200], pname[24];
    
format(querysizeof(query),"SELECT username(whatever you called users row) FROM `playerdata`(what ever you called the table) WHERE CRank = 7 LIMIT 1");
    
mysql_query(query);
    
mysql_store_result();
    new 
rows mysql_num_rows(); 
   if(
rows == 1)
    {
      while(
mysql_fetch_row(query))
      {
        
mysql_fetch_field("playerName"pname);
        new 
string[128];
        
format(stringsizeof(string),"Username: %s  ",pname);
        
SendClientMessage(playerid0xFF0000FFstring);
      }
      
    }
    if(!
rows)
    {
      
SendClientMessage(playerid0xFF0000FF,"SERVER: No players found with rank = 7");
    }
  }
  else return 
SendClientMessage(playerid0xFF0000FF,"You are not authorized to use this command!");
  
mysql_free_result();
  return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)