09.06.2018, 04:48
Hello guys, I'm trying to make two commands for admins
1st: /stafflist (Which will get the name of all the admins and there levels)
2nd: /aka (which will get the name of all the players which are on the same IP)
Idk the query to make
I know that the query for a regular thing without sending it to client is
But how to echo it
Those are the cmds i tried to make
1st: /stafflist (Which will get the name of all the admins and there levels)
2nd: /aka (which will get the name of all the players which are on the same IP)
Idk the query to make
I know that the query for a regular thing without sending it to client is
PHP код:
SELECT * FROM `playerdata` WHERE playerLevel >= 1
Those are the cmds i tried to make
PHP код:
{
new message[2500], sql[200], value[100][50];
if(playerData[playerid][playerScore] >= 50)
{
format(sql, sizeof(sql), "SELECT * FROM `playerdata` WHERE playerLevel >= 1");
mysql_query(sql);
mysql_store_result();
if(mysql_num_rows())
{
mysql_fetch_row(value[5], "playerLevel");
mysql_fetch_row(value[0], "playerName");
format(message, sizeof(message), "%s{0000BB}%s", message, value[0]);
format(message, sizeof(message), "%sLevel: %s", message, value[5]);
ShowPlayerDialog(playerid, 10000, DIALOG_STYLE_MSGBOX, "Staff List", message, "Close", "");
}
}
else
{
SendClientMessage(playerid, -1, "{FF0000}[ERROR] {FF0000}You must have 50 score in order to view the stafflist.");
}
return 1;
}
PHP код:
COMMAND:aka(playerid, params[])
{
if(playerData[playerid][playerLoggedIn])
{
if(playerData[playerid][playerLevel] >= 1)
{
new
pIP[40],
otherID,
str[130],
str1[130],
// row[200],
value[100][50]
;
if(sscanf(params, "u", otherID))
{
SendClientMessage(playerid, -1, "{FF0000}[ERROR] {FFFFFF}Usage: /aka <playername/id>");
}
else
{
if(IsPlayerConnected(otherID))
{
if(playerData[otherID][playerLoggedIn])
{
GetPlayerIp(otherID, pIP, sizeof(pIP));
format(str, sizeof(str), "SELECT `playerName`,`playerIP` FROM `playerdata` where `playerIP` = %s", pIP);
mysql_query(str);
mysql_fetch_row(value[0], "playerName");
format(str1, sizeof(str1), "{AFAFAF}[SERVER] {FFFFFF}The AKA on the IP %s are: %s\n", pIP, value[0]);
ShowPlayerDialog(playerid, 123, DIALOG_STYLE_LIST," {FFFFFF}-{00FF00}Accounts On Player Ip", str1, "Okay", "");
mysql_free_result();
}
else
{
SendClientMessage(playerid, -1, "{FF0000}[ERROR] {FFFFFF}That player is not logged in.");
}
}
else
{
SendClientMessage(playerid, -1, "That player is not logged in.");
}
}
}
else
{
SendClientMessage(playerid, -1, "{FF0000}[ERROR]{FFFFFF} You're not authorized to use this command.");
}
}
else
{
SendClientMessage(playerid, -1, "{FF0000}[ERROR] {FFFFFF}You must be logged in to use commands.");
}
return 1;
}