[Tutorial] How To Make Admin Ranks + /admins
#1

Код 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;
}
First Of All To Script Admin Ranks And /admins Command You Need To Know How To Put Includes At The Very

Top Of The Script

Код HTML:
//Includes
#include <a_samp>
#include <zcmd>
If You Don't Have ZCMD Include Download It From Here http://www.solidfiles.com/d/f0167bd16e/

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
Finish Putting The Color Defines Now We Move To Our Real Scripting Part As I Already Made The Whole Command

Above Now I'll Explain It To You

Код HTML:
COMMAND:admins(playerid,params[])
You Saw This Right This Is The ZCMD Comman Style You

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 Will First See

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++)
You Saw The Above Code Written In The Top Of The Thread This SendClientMessage Is Used To Send Message

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++)
You Saw This Right This Is Used For MAX_PLAYERS Means

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))
You Saw This Again Right Because This Is Used To Find Out How Many

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);
You Saw The if(PlayerInfo[i][pAdmin] == 1) { admtext = "Level-1 Trial Admin"; } This Means That If The Player

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);
As I Already Explained This Things But Still Explaining Again GetPlayerName(i, sendername, sizeof(sendername));

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
Reply
#2

First off all i hate a n00b asking for rep+
Second your tutorial is not well explain
commonly all idiots create a tutorial without explaining because they want reps.
and you are one of them.
Reply
#3

Romel i did not give a tutorial to make people dumb i explained it as much as possible and as much i could you read and

watch it carefully my friend i explained everything line by line i only don't give tutorial for +rep i need thats why i say

but this tutorial is very well explained if you know
Reply
#4

You need it for what?
Server Ad? You already have more than 7+ so you can Server Ad.

I can proof that this code is copy paste from your Nadmin.
Reply
#5

yeah my nadmin and i created it so credit is mine i just put here and explained how to script it to scripters

own script
Reply
#6

Please do some research first before creating a tutorial. This sets a bad example for others.

pawn Код:
if(IsPlayerConnected(playerid))
Evidently, the player that executes the command is connected. This piece of code dates back to SA-MP 0.1b where a player could still execute commands after being kicked. This was fixed. Still people are blindly copying this (GodFather ...) without the slightest clue as to why.

pawn Код:
new string[256];
The maximum chat output is 128 characters. Why use a buffer twice that length?

pawn Код:
else if(PlayerInfo[i][pAdmin] == 2)
Know when to use switches.


Oh, And Don't Type Every Word With A Capital Letter, Because That Is So Annoying To Read.
Reply
#7

Quote:
Originally Posted by Vince
Посмотреть сообщение
pawn Код:
if(IsPlayerConnected(playerid))
Evidently, the player that executes the command is connected. This piece of code dates back to SA-MP 0.1b where a player could still execute commands after being kicked. This was fixed. Still people are blindly copying this (GodFather ...) without the slightest clue as to why.
This
Quote:
Originally Posted by Vince
Посмотреть сообщение
Oh, And Don't Type Every Word With A Capital Letter, Because That Is So Annoying To Read.
And this
Reply
#8

Ok sorry anyway hows the tutorial rate it
Reply
#9

my rate is 4/10
Reply
#10

btw ty Romel whatever marks i got umm happy with it
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)