CMD:admins(playerid,params[]) { new count = 0, string[256], AdmRank[500]; SendClientMessage(playerid,red,""); SendClientMessage(playerid,COLOR_ORANGE,"»»Online Admins»»"); new ChangeColor; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][Level] > 0) { if(PlayerInfo[i][Level] == 1) { AdmRank = "Junior Admin"; ChangeColor = Color_Trial_Admin; } else if(PlayerInfo[i][Level] == 2) { AdmRank = "Senior Admin"; ChangeColor = Color_Server_Admin; } else if(PlayerInfo[i][Level] == 3) { AdmRank = "Head Admin"; ChangeColor = Color_Senior_Admin; } else if(PlayerInfo[i][Level] == 4) { AdmRank = "Management(Server Team)"; ChangeColor = Color_Lead_Admin; } else if(PlayerInfo[i][Level] == 5) { AdmRank = "Server Owner(Rcon Admin)"; ChangeColor = Color_Global_Admin; } else if(PlayerInfo[i][Level] == 6) { AdmRank = "Community Developer/Scripter"; ChangeColor = Color_Server_Owner; } else if(PlayerInfo[i][Level] >= 7) { AdmRank = "Community Owner"; ChangeColor = Color_RCON_Administrator; } else if(PlayerInfo[i][Level] >= 8) { AdmRank = "Community Owner"; ChangeColor = Color_RCON_Administrator; } new Name[MAX_PLAYER_NAME]; GetPlayerName(i,Name,sizeof(Name)); { format(string, sizeof(string), "Level: %d | Name: %s (ID:%i) | Rank: %s", PlayerInfo[i][Level], Name, i, AdmRank); SendClientMessage(playerid,ChangeColor,string); count++; } } } } if(count == 0) SendClientMessage(playerid,red,"No Admins online!"); SendClientMessage(playerid,COLOR_ORANGE,"________________________"); return 1; }
CMD:vips(playerid, params[]) { #pragma unused params new count = 0, string[800]; for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { if(PlayerInfo[i][dRank] >= 1) { format(string, 500, "%s %s [ID:%i] | DonorLevel: %d\n", string, PlayerName2(i), i, PlayerInfo[i][dRank]); //We are appending the string, so put %s before any new data is added, //and that parameter actually refers to the string itself. count++; } } } if (count == 0) ShowPlayerDialog(playerid, 800, DIALOG_STYLE_MSGBOX, "{F81414}=Online Donators=", "{00FFEE}No Donators Online\n{00FF00}_____", "Close", ""); else ShowPlayerDialog(playerid, 800, DIALOG_STYLE_MSGBOX, "{F81414}=Online Donators=", string, "Close", ""); return 1; }
CMD:moderators(playerid, params[]) { new count = 0, string[256]; SendClientMessage(playerid, blue,"Current online moderators:"); for(new i = 0; i < MAX_PLAYERS; i ++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][Helper] == 1) { format(string, sizeof(string),"Moderator: [%d]%s", i, PlayerName2(i)); SendClientMessage(playerid, blue, string); count++; } } } if(count == 0) { SendClientMessage(playerid, blue,"No moderators are online right now!"); } return 1; }
strcat(string, "bla..");
strcat(string, "asdj");
if(PlayerInfo[playerid][pAdmin] == 1)
{
AdmRank[playerid] = "Junior Admin";
ChangeColor[playerid] = Color_Trial_Admin;
strcat(string, "{ChangeColor} %s %s \n",AdmRank, GetPlayerName(playerid));
}
ShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_MSGBOX, "Admins", string, "OK", "");
new AdmRank[MAX_PLAYERS];
new ChangeColor[MAX_PLAYERS];
Originally Posted by WatchDog
Hi Can You Do Changes In One Of The Code And Show Me
Here Is The Linkhttps://sampforum.blast.hk/showthread.php?tid=607842 |
CMD:moderators(playerid, params[])
{
new count = 0, string[256];
//SendClientMessage(playerid, blue,"Current online moderators:");
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][Helper] == 1)
{
strcat(string,"Moderator: [%d]%s \n\r", i, PlayerName2(i));
count++;
}
ShowPlayerDialog(playerid, 542, DIALOG_STYLE_MSGBOX, "Current online Moderators: ", string, "OK", "");
//ShowPlayerDialog(playerid, DIALOG ID, DIALOG STYLE, HEADING, MESSAGE, BUTTON 1, BUTTON 2);
}
}
if(count == 0)
{
ShowPlayerDialog(playerid, 542, DIALOG_STYLE_MSGBOX, "Current Online Moderators: ", "No Mods Online!", "OK", "");
}
return 1;
}
CMD:admins(playerid, params[]) // By CuervO_NegrO
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] <= 1338)
{
new admtext[64];
if(PlayerInfo[i][pAdmin] == 1338) { admtext = "Raven's Roleplay Director"; }
else if(PlayerInfo[i][pAdmin] == 1337) { admtext = "Executive Director"; }
else if(PlayerInfo[i][pAdmin] == 6) { admtext = "Head Administrator"; }
else if(PlayerInfo[i][pAdmin] == 5) { admtext = "Senior Administrator"; }
else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Administrator"; }
else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Senior Moderator"; }
else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Moderator"; }
else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Administrative Assitant"; }
else { admtext = "Undefined Rank"; }
}
GetPlayerName(i, sendername, sizeof(sendername));
if(PlayerInfo[i][pAdminDuty] == 0 )
{
strcat*string, "%s - %s \n\r" , admtext, sendername);
ShowPlayerDialog(playerid, 3652, DIALOG_STYLE_MSGBOX, "Online Admins:", string, "OK", ""); //Change Dialog Ids according to your server
}
else if(PlayerInfo[i][pAdminDuty] == 1)
{
strcat(string, "%s - %s (On Duty) \n\r", admtext, sendername);
ShowPlayerDialog(playerid, 3652, DIALOG_STYLE_MSGBOX, "Online Admins":, string, "OK", ""); // Change Dialog Ids According to your server.
}
}
}
}
return 1;
}
CMD:moderators(playerid, params[])
{
new count = 0, string[256];
//SendClientMessage(playerid, blue,"Current online moderators:");
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][Helper] == 1)
{
strcat(string,"Moderator: [%d]%s \n\r", i, PlayerName2(i));
count++;
}
}
}
ShowPlayerDialog(playerid, 542, DIALOG_STYLE_MSGBOX, "Current online Moderators: ", string, "OK", "");
//ShowPlayerDialog(playerid, DIALOG ID, DIALOG STYLE, HEADING, MESSAGE, BUTTON 1, BUTTON 2);
if(count == 0)
{
ShowPlayerDialog(playerid, 542, DIALOG_STYLE_MSGBOX, "Current Online Moderators: ", "No Mods Online!", "OK", "");
}
return 1;
}
Try this:
PHP Code:
I found Raven's Roleplay script and thats the code. i already converted it into ZCMD, you just have to change your variables in it to use. Hope it helps. EDIT: i fixed /mods command. here: PHP Code:
|
CMD:admins(playerid, params[])
{
new string[128], bool:count = false, rank[35], status[15];
SendClientMessage(playerid, COLOR_ORANGE_RED, " ");
LOOP_PLAYERS(i)
{
if(IsPlayerGAdmin(i) || IsPlayerAdmin(i))
{
if(! count) SendClientMessage(playerid, COLOR_ORANGE_RED, "- Online Administrators -");
if(GetPVarType(playerid, "GAdmin_Onduty") != PLAYER_VARTYPE_NONE) status = "On Duty";
else status = "Playing";
if(! strcmp(ReturnPlayerName(i), "Frelan")) rank = "Server Owner & Developer";
else if(! strcmp(ReturnPlayerName(i), "_zionis_")) rank = "Server Co - Owner";
else if(IsPlayerAdmin(i)) rank = "RCON Admin";
else
{
switch(GetPlayerGAdminLevel(i))
{
case 1: rank = "Newbie Admin";
case 2: rank = "Junior Admin";
case 3: rank = "Pro Admin";
case 4: rank = "Lead Admin";
case 5: rank = "Master Admin";
case 6: rank = "Senior Admin";
default: rank = "Server Owner";
}
}
format(string, sizeof(string), "%s [%i] | Rank: %s | Level %i | Status: %s", ReturnPlayerName(i), i, rank, GetPlayerGAdminLevel(i), status);
SendClientMessage(playerid, COLOR_ORANGE_RED, string);
count = true;
}
}
if(! count) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: No admin on-duty currently.");
return 1;
}
Hello, can you make this /admins command to Dialog Box?
Code: PHP Code:
|
CMD:admins(playerid, params[])
{
new string[128], bool:count = false, rank[35], status[15], diastring[1500];
SendClientMessage(playerid, COLOR_ORANGE_RED, " ");
LOOP_PLAYERS(i)
{
if(IsPlayerGAdmin(i) || IsPlayerAdmin(i))
{
if(! count) SendClientMessage(playerid, COLOR_ORANGE_RED, "- Online Administrators -");
if(GetPVarType(playerid, "GAdmin_Onduty") != PLAYER_VARTYPE_NONE) status = "On Duty";
else status = "Playing";
if(! strcmp(ReturnPlayerName(i), "Frelan")) rank = "Server Owner & Developer";
else if(! strcmp(ReturnPlayerName(i), "_zionis_")) rank = "Server Co - Owner";
else if(IsPlayerAdmin(i)) rank = "RCON Admin";
else
{
switch(GetPlayerGAdminLevel(i))
{
case 1: rank = "Newbie Admin";
case 2: rank = "Junior Admin";
case 3: rank = "Pro Admin";
case 4: rank = "Lead Admin";
case 5: rank = "Master Admin";
case 6: rank = "Senior Admin";
default: rank = "Server Owner";
}
}
format(string, sizeof(string), "%s [%i] | Rank: %s | Level %i | Status: %s\n", ReturnPlayerName(i), i, rank, GetPlayerGAdminLevel(i), status);
strcat(diastring, string);
ShowPlayerDialog(playerid, 5689, DIALOG_STYLE_MSGBOX, "- Online Administrators -", diastring, "Ok", "");//lol rand id change if you already have that one
count = true;
}
}
if(! count) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: No admin on-duty currently.");
return 1;
}