Posts: 871
Threads: 114
Joined: May 2014
Hello i changed my serfer from INI to Database
Now i want to create /aka [IP] to get the accounts of dheese ip
Thank you i need help
Fast
I allso will need something next after will help mee
REMEMBER +REP
Posts: 871
Threads: 114
Joined: May 2014
I didnt undertand this can you give mee an example with commands ?
Posts: 871
Threads: 114
Joined: May 2014
Up
Please someone is good with this help mee
Posts: 1,351
Threads: 35
Joined: Sep 2011
Reputation:
0
1. new field in database, preferably in users table called "ip"
2. when the player logs in / registers the ip would be updated to that value
3. make the command with a parameter (zcmd & sscanf is a good way to do that)
4. on the command, use the SELECT to count the amount of rows first
5. retrieve the rows and the other stuff you want to have (score, name, last login etc.)
6. once that's all done add it into a dialog or use SendClientMessage to each one that was found
7. go and test it
I'm not doing it for you, steps are the best way to learn.
Posts: 871
Threads: 114
Joined: May 2014
I have already created pIP
But i dont know how to make command
Please DanishHaq Help mee
Posts: 871
Threads: 114
Joined: May 2014
PHP код:
CMD:searchip(playerid, params[])
{
if(pInfo[playerid][pLogged] == 1)
{
new Query[256];
if (!strlen(params)) return SendClientMessage(playerid,-1,""chat" /searchip [IP]");
format(Query, sizeof(Query), "SELECT * FROM `users` WHERE pIP = '%s'", escstring(params));
mysql_query(Query);
mysql_store_result();
if(!mysql_num_rows())
{
new string[200];
format(string, sizeof(string), ""chat" Nobody account founded with %s IP!", params);
mysql_free_result();
return SendClientMessage(playerid,-1,string);
}
else if(mysql_num_rows() != 0)
{
format(Query, sizeof(Query), "UPDATE `banlog` SET `pAccountLock` = 0 WHERE Name = '%s'", escstring(params));
mysql_query(Query);
mysql_store_result();
new string[200];
format(string, sizeof(string), ""chat" %s Is founded", params);
SendClientMessage(playerid, 0x66FF33, string);
}
}
return 1;
}
I created this
It work when the ip dont exist
But i want to show accounts with dhat ip