16.06.2012, 09:44
Код HTML:
COMMAND:admins(playerid,params[])
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_ORANGE, " ");
SendClientMessage(playerid, COLOR_ORANGE, "-| ADMINS |-");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1341)
{
new admtext[64];
new sendername[MAX_PLAYER_NAME];
new string[256];
if(PlayerInfo[i][pAdmin] == 1) { admtext = "Level-1 Trial Admin"; }
else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Level-2 Administrator"; }
else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Level-3 Master Administrator"; }
else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Level-4 Lead Moderator"; }
else if(PlayerInfo[i][pAdmin] == 5) { admtext = "Level-5 Master Moderator"; }
else if(PlayerInfo[i][pAdmin] == 6) { admtext = "Level-6 King Administrator"; }
else if(PlayerInfo[i][pAdmin] == 7) { admtext = "Level-7 Co-Owner"; }
else if(PlayerInfo[i][pAdmin] == 8) { admtext = "level-8 Owner"; }
else { admtext = "Gamemoderator"; }
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s ( %s )", sendername, admtext);
SendClientMessage(playerid, COLOR_GREEN, string);
}
}
}
}
return 1;
}
Top Of The Script
Код HTML:
//Includes #include <a_samp> #include <zcmd>
After You Downloaded And Successfully Put In Your Script Now The Scripting Part Begins Now First Of All We Need
Some Colors Put The Colors Below FilterScript Init()
Код HTML:
//Colors #define COL_WHITE "{FFFFFF}" #define COL_RED "{F81414}" #define COL_GREEN "{00FF22}" #define COL_LIGHTBLUE "{00CED1}" //COLORS 2 #define COLOR_GREEN 0x008000FF #define COLOR_BLUE 0x0000FFFF #define COLOR_BRIGHTRED 0xFF000AAA #define COLOR_AQUA 0x00FFFFAA #define COLOR_GREY 0xAFAFAFAA #define COLOR_BEIGE 0xFFF8DCAA #define COLOR_BLACK 0x000000AA #define COLOR_LIGHTERBLUE 0x00BFFFAA #define COLOR_BLUELIGHT 0x1E90FFAA #define COLOR_BLUEMEDIUM 0x0000CDAA #define COLOR_BLUEDARK 0x00008BAA #define COLOR_PINK 0xFF1493AA #define COLOR_PINKDARK 0xFF00FFAA #define COLOR_GREENLIGHT 0x00FF00AA #define COLOR_GREENDARK 0x006400AA #define COLOR_MAROON 0x800000AA #define COLOR_OKER 0x808000AA #define COLOR_ORANGE 0xFF4500AA #define COLOR_ORANGELIGHT 0xFF8C00AA #define COLOR_PURPLE 0x800080AA #define COLOR_VIOLETDARK 0x9400D3AA #define COLOR_INDIGO 0xAB0082AA #define COLOR_RED 0xFF0000AA #define COLOR_SAND 0xFFDEADAA #define COLOR_SILVER 0xC0C0C0AA #define COLOR_TEAL 0x008080AA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_YELLOW 0xFFFF00AA #define COLOR_GOLD 0xFFD700AA #define COLOR_BROWN 0x8B4513AA #define COLOR_BROWNLIGHT 0xA0522DAA #define COLOR_GRAY 0xA9A9A9AA #define COLOR_GRAYDARK 0x696969AA #define COLOR_INVISIBLE 0xFFFFFF00 #define COLOR_INDIA 0x80000096 #define COLOR_PAKISTAN 0x40808096 #define COLOR_NEPAL 0x8000FF96 #define COLOR_BRAZIL 0xB7B70096 #define COLOR_CHINA 0x80808096 #define COLOR_GREECE 0x00000096 #define COLOR_SINGAPORE 0x00FFFF96 #define COLOR_IRAQ 0x8080C096
Above Now I'll Explain It To You
Код HTML:
COMMAND:admins(playerid,params[])
Need To Put It Under OnPlayerCommandText To Make It Work You Can Even Use CMD Instead Of COMMAND
Now Forget That And Come To The Next Part
Код HTML:
if(IsPlayerConnected(playerid))
It The Player Or Admin Is Connected To Show Player The Admins
Код HTML:
SendClientMessage(playerid, COLOR_ORANGE, " "); SendClientMessage(playerid, COLOR_ORANGE, "-| ADMINS |-"); for(new i = 0; i < MAX_PLAYERS; i++)
To The Player With Admins Name And Other Things Mainly Its Used To Show Player The Screen Of The Things
Код HTML:
for(new i = 0; i < MAX_PLAYERS; i++)
Admins Show It In ++ So How Many Rank Admins Are There We Can Show It
Код HTML:
if(IsPlayerConnected(i)) { if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1341) { new admtext[64]; new sendername[MAX_PLAYER_NAME]; new string[256]; if(PlayerInfo[i][pAdmin] == 1) { admtext = "Level-1 Trial Admin"; } else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Level-2 Administrator"; } else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Level-3 Master Administrator"; } else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Level-4 Lead Moderator"; } else if(PlayerInfo[i][pAdmin] == 5) { admtext = "Level-5 Master Moderator"; } else if(PlayerInfo[i][pAdmin] == 6) { admtext = "Level-6 King Administrator"; } else if(PlayerInfo[i][pAdmin] == 7) { admtext = "Level-7 Co-Owner"; } else if(PlayerInfo[i][pAdmin] == 8) { admtext = "level-8 Owner"; } else { admtext = "Gamemoderator"; } GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "%s ( %s )", sendername, admtext); SendClientMessage(playerid, COLOR_GREEN, string);
This Is The Other Part Of The Script Right If It Is Then You Saw There Written
new admtext[64];
new sendername[MAX_PLAYER_NAME];
new string[256];
new admtext means That The Text For The Admins Suppose The Rank Is Trial Administrator It Will Show Player The
Rank new sendername[MAX_PLAYER_NAME]; You Saw The Sendername Right Who Ever Types The Command
Will Be The Player Sendername Will Get The Whole Message With Admin Rank And The Down One Is The string
Код HTML:
if(IsPlayerConnected(i))
Admins Of What Rank Is There If The Admin Is Connected Then It Will Show The Admins
Код HTML:
if(PlayerInfo[i][pAdmin] == 1) { admtext = "Level-1 Trial Admin"; } else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Level-2 Administrator"; } else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Level-3 Master Administrator"; } else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Level-4 Lead Moderator"; } else if(PlayerInfo[i][pAdmin] == 5) { admtext = "Level-5 Master Moderator"; } else if(PlayerInfo[i][pAdmin] == 6) { admtext = "Level-6 King Administrator"; } else if(PlayerInfo[i][pAdmin] == 7) { admtext = "Level-7 Co-Owner"; } else if(PlayerInfo[i][pAdmin] == 8) { admtext = "level-8 Owner"; } else { admtext = "Gamemoderator"; } GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "%s ( %s )", sendername, admtext); SendClientMessage(playerid, COLOR_GREEN, string);
Level Who Is Admin Connected Is Level-1 His Rank Is {Trial Administrator} Like This It Goes On And On And You
Can Put Whatever Level You Want And How Much You Want And You Can Even Choose The Name By Yourself
Код HTML:
GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "%s ( %s )", sendername, admtext); SendClientMessage(playerid, COLOR_GREEN, string);
Is It Will Get The Name Of The Admin To The Player This Is The Variable For That
format(string, 256, "%s ( %s )", sendername, admtext); And This Is The Format How It Will Go
SendClientMessage(playerid, COLOR_GREEN, string); And This Is The Final Part It Will Show In COLOR_GREEN
How Many Admins Of What Ranks Are Online Now To The Person Who Typed /admins
This Is The Most Easy Way To Create A /admins Command And Admin Rank
HOPE YOU LIKED AND ENJOYED IT!
If It Helped You Or You Liked It Please +REP Me I Need It