/admins in Dialog List -
Neon1 - 23.05.2015
Hy
Pls help me on /admins how to create on dialog i'm easy scripter :/ (sry for my bad english)
dcmd_admins(playerid,params[])
{
#pragma unused params
new count = 0;
new string[128];
new ChangeColor;
SendClientMessage(playerid, green, " ");
SendClientMessage(playerid, green, "___________ |- Online Adminok -| ___________");
SendClientMessage(playerid, green, " ");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(AccInfo[i][Level] >= 1 && AccInfo[i][Hide] == 0)
{
if(AccInfo[i][Level] > 5)
{
AdmRank = "Professional Admin";
ChangeColor = Color_Professional_Admin;
}
if(IsPlayerAdmin(i))
{
AdmRank = "RCON Adminisztrбtor";
ChangeColor = Color_RCON_Administrator;
}
else
{
switch(AccInfo[i][Level])
{
case 1: {
AdmRank = "Kezdő Moderбtor";
ChangeColor = Color_Basic_Moderator;
}
case 2: {
AdmRank = "Moderбtor";
ChangeColor = Color_Moderator;
}
case 3: {
AdmRank = "Mester Moderбtor";
ChangeColor = Color_Master_Moderator;
}
case 4: {
AdmRank = "Adminisztrбtor";
ChangeColor = Color_Administrator;
}
case 5: {
AdmRank = "Mester Adminisztrбtor";
ChangeColor = Color_Master_Administrator;
}
}
}
switch(AccInfo[i][OnDuty])
{
case 0: AdmDuty = "Jбtйk!";
case 1: AdmDuty = "On Duty!";
}
format(string, 128, "Szint: %d - %s (Id:%i) | %s | %s",AccInfo[i][Level], PlayerName2(i),i,AdmRank,AdmDuty);
SendClientMessage(playerid, ChangeColor, string);
count++;
}
}
}
if (count == 0)
SendClientMessage(playerid,red,"Nincs Admin a Szerveren!");
SendClientMessage(playerid, green, " _______________________________________");
return 1;
}
Re: /admins in Dialog List -
Konstantinos - 23.05.2015
Assuming "AdmRank" is declared as global string and removing the colors:
PHP код:
dcmd_admins(playerid, params[])
{
#pragma unused params
new count, string[512];
for (new i = 0; i < MAX_PLAYERS; i++) if (IsPlayerConnected(i)) // foreach(new i : Player)
{
if (!AccInfo[i][Hide])
{
switch (AccInfo[i][Level])
{
case 0: continue;
case 1: AdmRank = "Kezdő Moderбtor";
case 2: AdmRank = "Moderбtor";
case 3: AdmRank = "Mester Moderбtor";
case 4: AdmRank = "Adminisztrбtor";
case 5: AdmRank = "Mester Adminisztrбtor";
default:
{
if (IsPlayerAdmin(i)) AdmRank = "RCON Adminisztrбtor";
else AdmRank = "Professional Admin";
}
}
format(string, sizeof (string), "%sSzint: %d - %s (Id:%i) | %s | %s", string, AccInfo[i][Level], PlayerName2(i), i, AdmRank, (!AccInfo[i][OnDuty]) ? ("Jбtйk!") : ("On Duty!"));
count++;
}
}
if (!count) SendClientMessage(playerid, red, "Nincs Admin a Szerveren!");
else ShowPlayerDialog(playerid, 285, DIALOG_STYLE_MSGBOX, "___________ |- Online Adminok -| ___________", string, "Close", "");
return 1;
}
Re: /admins in Dialog List -
Neon1 - 23.05.2015
thanks :3