List of levels - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: List of levels (
/showthread.php?tid=448936)
List of levels -
Fernado Samuel - 06.07.2013
I want to make a command which should show the admins in a particular level.
Suppose, in my server total 5 admin levels and i want to make a cmd like /adminlvl1
So that it will show the admins of level 1.I'm using mysql r6
Re: List of levels -
Donvalley - 07.07.2013
so do you mean something like this? just a example
pawn Код:
if (strcmp(cmd, "/adminlvl1", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_DBLUE, "~Level 1 Admins~");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin]==1)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s", sendername, PlayerInfo[i][pAdmin]);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}
}
}
return 1;
}
Re: List of levels -
Fernado Samuel - 07.07.2013
I mean offline admins on the list.
Re: List of levels -
RedFusion - 07.07.2013
What sort of saving system do you use?
Re: List of levels -
Fernado Samuel - 07.07.2013
Quote:
Originally Posted by RedFusion
What sort of saving system do you use?
|
MySQL R6
Re: List of levels -
RedFusion - 07.07.2013
And what's the name of your database, tables and columns?
Re: List of levels -
Fernado Samuel - 07.07.2013
Quote:
Originally Posted by RedFusion
And what's the name of your database, tables and columns?
|
I'm currently use like this
#define SQL_HOST "localhost"
#define SQL_USER "root"
#define SQL_PASS ""
#define SQL_DB "pdata"
Can you give me the code ? so that i will set those information
Re: List of levels -
RedFusion - 07.07.2013
That's no tables or columns, i don't even know MySQL but i thought someone else maybe could help you if the required information is on here. Like columns, tables, and so on
Re: List of levels -
Konstantinos - 07.07.2013
I don't know your table name and the fields, but I'm going to give you an example. You can do the rest by yourself, since I never used R6, only R7+.
pawn Код:
"SELECT name FROM users WHERE admin = 1"
Re: List of levels -
Fernado Samuel - 07.07.2013
But whats the whole code related to this? can ya show me?