/Admin style - 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: /Admin style (
/showthread.php?tid=295225)
/Admin style -
RBTDM - 05.11.2011
Hello!
i am using luxadmin system in that i dont want the current /admin style
this is the current code
pawn Код:
CMD:admins(playerid,params[])
{
#pragma unused params
new count = 0;
new string[128];
new ChangeColor;
SendClientMessage(playerid, green, " ");
SendClientMessage(playerid, green, "___________ |- Online Admins -| ___________");
SendClientMessage(playerid, green, " ");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(PlayerInfo[i][Level] >= 1 && PlayerInfo[i][Hide] == 0)
{
if(PlayerInfo[i][Level] > 6)
{
AdmRank = "Professional Admin";
ChangeColor = Color_Professional_Admin;
}
if(IsPlayerAdmin(i))
{
AdmRank = "RCON Administrator";
ChangeColor = Color_RCON_Administrator;
}
else
{
switch(PlayerInfo[i][Level])
{
case 1: {
AdmRank = "VIP";
ChangeColor = Color_Basic_Moderator;
}
case 2: {
AdmRank = "Moderator";
ChangeColor = Color_Moderator;
}
case 3: {
AdmRank = "Master Moderator";
ChangeColor = Color_Master_Moderator;
}
case 4: {
AdmRank = "Administrator";
ChangeColor = Color_Administrator;
}
case 5: {
AdmRank = "Head Administrator";
ChangeColor = Color_Master_Administrator;
}
case 6: {
AdmRank = "Professional Admin";
ChangeColor = Color_Master_Administrator;
}
}
}
switch(PlayerInfo[i][OnDuty])
{
case 0: AdmDuty = "Playing!";
case 1: AdmDuty = "On Duty!";
}
format(string, 128, "Level: %d - %s (Id:%i) | %s | %s",PlayerInfo[i][Level], PlayerName2(i),i,AdmRank,AdmDuty);
SendClientMessage(playerid, ChangeColor, string);
count++;
}
}
}
if (count == 0)
SendClientMessage(playerid,red,"No admin online in the list");
SendClientMessage(playerid, green, " _______________________________________");
return 1;
}
I wanted to change it style , if a player type /admins then it should show the admin list in a Box
for example just see rocks vip system..
http://forum.sa-mp.com/showthread.ph...t=%2Fhighlight
Please help me to make it like that
Re: /Admin style -
Kingunit - 05.11.2011
Do you know how to use dialogs?
Re: /Admin style -
RBTDM - 05.11.2011
know thats why i need yours help
Re: /Admin style -
RBTDM - 05.11.2011
Help...............
Re: /Admin style -
wumpyc - 05.11.2011
Try to change
PHP код:
SendClientMessage(playerid, ChangeColor, string);
to
PHP код:
ShowPlayerDialog(playerid,53,DIALOG_STYLE_LIST,"Admin List:",string,"OK","Cancel");
I didn't tested it...but this or something like that should work...
Re: /Admin style -
Ironboy - 05.11.2011
Try this
pawn Код:
CMD:admins(playerid,params[])
{
#pragma unused params
new count = 0;
new string[128];
new ChangeColor;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(PlayerInfo[i][Level] >= 1 && PlayerInfo[i][Hide] == 0)
{
if(PlayerInfo[i][Level] > 6)
{
AdmRank = "Professional Admin";
ChangeColor = Color_Professional_Admin;
}
if(IsPlayerAdmin(i))
{
AdmRank = "RCON Administrator";
ChangeColor = Color_RCON_Administrator;
}
else
{
switch(PlayerInfo[i][Level])
{
case 1: {
AdmRank = "VIP";
ChangeColor = Color_Basic_Moderator;
}
case 2: {
AdmRank = "Moderator";
ChangeColor = Color_Moderator;
}
case 3: {
AdmRank = "Master Moderator";
ChangeColor = Color_Master_Moderator;
}
case 4: {
AdmRank = "Administrator";
ChangeColor = Color_Administrator;
}
case 5: {
AdmRank = "Head Administrator";
ChangeColor = Color_Master_Administrator;
}
case 6: {
AdmRank = "Professional Admin";
ChangeColor = Color_Master_Administrator;
}
}
}
switch(PlayerInfo[i][OnDuty])
{
case 0: AdmDuty = "Playing!";
case 1: AdmDuty = "On Duty!";
}
format(string, 128, "Level: %d - %s (Id:%i) | %s | %s",PlayerInfo[i][Level], PlayerName2(i),i,AdmRank,AdmDuty);
ShowPlayerDialog(playerid,53,DIALOG_STYLE_MSGBOX,"Admin List:",string,"OK","");
count++;
}
}
}
if (count == 0)
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Online Administrators","No admin online in the list","Close","");
return 1;
}
Re: /Admin style -
RBTDM - 05.11.2011
ty very much
+rep