admin cmd -
KNIGHT786 - 02.01.2017
hi guys this is admin command to see who admin is online in server
but it only shows only to lv 6 admin not lv 7 admin i want to show also lv 7 admin online
Код:
COMMAND:admins(playerid, params[])
{
if (playerData[playerid][playerScore] >= 50)
{
new count = 1, string[828];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && playerData[i][playerLevel] >= 1 && playerData[i][playerLevel] < 7)
{
// If admin level is higher than 1, here it goes...
format(string, sizeof(string), "%s%s(%i) - Level: %i\n", string, playerData[i][tempAdminName], i, playerData[i][playerLevel]);
count ++;
}
}
if(count != 1)
{
// Show admins that are presently online, along with their rank
ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Administrators", string, "OK", "");
}
else
{
// No admins online - Either this or nothing, either way the user will know admins are offline...
ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Admins", "There are no administrators present.", "OK", "");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{FF0404}[ERROR] {FFFF00}You must have at least 50 score to view the admin list.");
}
return 1;
}
also that lv 7 admin name as Community Owner
lv 6 Server Manager
lv 5 Head Adminstrator
lv 4 Lead Adminstrator
lv 3 Adminstrator
lv 2 Junior Adminstrator
lv 1 Trial Adminstrator
plzz send me code that inlcude all this plz
Re: admin cmd -
BiosMarcel - 02.01.2017
Normally u don't even deserve help in this case
PHP код:
COMMAND:admins(playerid, params[])
{
if (playerData[playerid][playerScore] >= 50)
{
new count = 1, string[828];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && playerData[i][playerLevel] >= 1 && playerData[i][playerLevel] <= 7)
{
// If admin level is higher than 1, here it goes...
format(string, sizeof(string), "%s%s(%i) - Level: %i\n", string, playerData[i][tempAdminName], i, playerData[i][playerLevel]);
count ++;
}
}
if(count != 1)
{
// Show admins that are presently online, along with their rank
ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Administrators", string, "OK", "");
}
else
{
// No admins online - Either this or nothing, either way the user will know admins are offline...
ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Admins", "There are no administrators present.", "OK", "");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{FF0404}[ERROR] {FFFF00}You must have at least 50 score to view the admin list.");
}
return 1;
}
Re: admin cmd -
KNIGHT786 - 02.01.2017
ok if u dont wanna help then dont help any other help me
Re: admin cmd -
BiosMarcel - 02.01.2017
Quote:
Originally Posted by KNIGHT786
ok if u dont wanna help then dont help any other help me
|
First of all your sentence doesn't make much sense.
Second, i did help you, since i needed 1 second
Third, you don't deserve the help, because you don't understand your "own" code (probably not your own)
Re: admin cmd -
KNIGHT786 - 02.01.2017
i know you are a good scripter than me but dont think that if u dont want to help then no one help me so leave this topic if u dont wanna help i dont need your suggestions.
next time dont reply if u dont want to help
Re: admin cmd -
Banditul18 - 02.01.2017
He help you, but you don't know how to read the code
Respuesta: admin cmd -
HidroDF - 02.01.2017
Marcel has solved your problem, just see this line:
Код:
// Your line:
if(IsPlayerConnected(i) && playerData[i][playerLevel] >= 1 && playerData[i][playerLevel] < 7)
// Marcel's line
if(IsPlayerConnected(i) && playerData[i][playerLevel] >= 1 && playerData[i][playerLevel] <= 7)
Your old code has < 7 that is less (<) than 7, he adds an equal sign (=), and the code is now less (<) or equals (=) than 7.
You also can do:
Код:
if(IsPlayerConnected(i) && playerData[i][playerLevel] >= 1 && playerData[i][playerLevel] < 8)
Check if the playerLevel is less (<) than 8: 1, 2, 3, 4, 5, 6 or 7 because the anterior condition (playerData[i][playerLevel] >= 1) check if level is 1 or upper.
Check this for futher help:
https://sampwiki.blast.hk/wiki/Control_Structures#if
Re: admin cmd -
KNIGHT786 - 03.01.2017
omg sorry i didnt see thnx for helping but can u aslo help me for this.At online adins it show these
lv 7 admin Community Owner
lv 6 Server Manager
lv 5 Head Adminstrator
lv 4 Lead Adminstrator
lv 3 Adminstrator
lv 2 Junior Adminstrator
lv 1 Trial Adminstrator