SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 16/06/2012, 09:44 AM   #1
Nirzor
Huge Clucker
 
Nirzor's Avatar
 
Join Date: Feb 2012
Location: Bangladesh
Posts: 443
Reputation: 41
Default How To Make Admin Ranks + /admins

HTML Code:
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 Code:
//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 Code:
//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 Code:
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 Code:
if(IsPlayerConnected(playerid))
It Will First See

It The Player Or Admin Is Connected To Show Player The Admins

HTML Code:
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 Code:
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 Code:
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 Code:
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 Code:
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 Code:
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
__________________
BB SA-MP
Nirzor is offline   Reply With Quote
Old 16/06/2012, 09:46 AM   #2
_Jake_
High-roller
 
_Jake_'s Avatar
 
Join Date: Apr 2012
Location: Land of Ooo
Posts: 2,798
Reputation: 294
Default Re: How To Make Admin Ranks + /admins

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.
__________________
I stopped playing stunt servers long time ago and decided to enter the RolePlay servers and roleplay with it, You would find me playing in P:LA or in any popular servers, edit or not, My roleplay name would be always Ronald_Lacson.


When on UN-RP servers, My username would be always Jake_Hero, If you want to add me on Skype, the ID would be, spencer_

I need a user who can let me use JakAdmin 3.2.2 on their servers, I am glad if someone will let me, It's not that i will steal anything - You're the one who'll upload the Beta Script.
_Jake_ is offline   Reply With Quote
Old 16/06/2012, 09:49 AM   #3
Nirzor
Huge Clucker
 
Nirzor's Avatar
 
Join Date: Feb 2012
Location: Bangladesh
Posts: 443
Reputation: 41
Default Re: How To Make Admin Ranks + /admins

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
__________________
BB SA-MP
Nirzor is offline   Reply With Quote
Old 16/06/2012, 09:52 AM   #4
_Jake_
High-roller
 
_Jake_'s Avatar
 
Join Date: Apr 2012
Location: Land of Ooo
Posts: 2,798
Reputation: 294
Default Re: How To Make Admin Ranks + /admins

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.
__________________
I stopped playing stunt servers long time ago and decided to enter the RolePlay servers and roleplay with it, You would find me playing in P:LA or in any popular servers, edit or not, My roleplay name would be always Ronald_Lacson.


When on UN-RP servers, My username would be always Jake_Hero, If you want to add me on Skype, the ID would be, spencer_

I need a user who can let me use JakAdmin 3.2.2 on their servers, I am glad if someone will let me, It's not that i will steal anything - You're the one who'll upload the Beta Script.
_Jake_ is offline   Reply With Quote
Old 16/06/2012, 11:50 AM   #5
Nirzor
Huge Clucker
 
Nirzor's Avatar
 
Join Date: Feb 2012
Location: Bangladesh
Posts: 443
Reputation: 41
Default Re: How To Make Admin Ranks + /admins

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
__________________
BB SA-MP
Nirzor is offline   Reply With Quote
Old 16/06/2012, 01:33 PM   #6
Vince
Godfather
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 6,113
Reputation: 1627
Default Re: How To Make Admin Ranks + /admins

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

pawn Code:
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 Code:
new string[256];
The maximum chat output is 128 characters. Why use a buffer twice that length?

pawn Code:
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.
__________________
I will rarely post a ready made solution in your thread, but rather I try to make you realize your own mistakes so you can fix them yourself.
Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime.
Vince is offline   Reply With Quote
Old 16/06/2012, 01:47 PM   #7
Max_Coldheart
Gangsta
 
Max_Coldheart's Avatar
 
Join Date: Dec 2011
Location: Finland
Posts: 706
Reputation: 87
Default Re: How To Make Admin Ranks + /admins

Quote:
Originally Posted by Vince View Post

pawn Code:
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 View Post
Oh, And Don't Type Every Word With A Capital Letter, Because That Is So Annoying To Read.
And this
__________________
Max_Coldheart is offline   Reply With Quote
Old 17/06/2012, 05:43 AM   #8
Nirzor
Huge Clucker
 
Nirzor's Avatar
 
Join Date: Feb 2012
Location: Bangladesh
Posts: 443
Reputation: 41
Default Re: How To Make Admin Ranks + /admins

Ok sorry anyway hows the tutorial rate it
__________________
BB SA-MP
Nirzor is offline   Reply With Quote
Old 17/06/2012, 06:24 AM   #9
_Jake_
High-roller
 
_Jake_'s Avatar
 
Join Date: Apr 2012
Location: Land of Ooo
Posts: 2,798
Reputation: 294
Default Re: How To Make Admin Ranks + /admins

my rate is 4/10
__________________
I stopped playing stunt servers long time ago and decided to enter the RolePlay servers and roleplay with it, You would find me playing in P:LA or in any popular servers, edit or not, My roleplay name would be always Ronald_Lacson.


When on UN-RP servers, My username would be always Jake_Hero, If you want to add me on Skype, the ID would be, spencer_

I need a user who can let me use JakAdmin 3.2.2 on their servers, I am glad if someone will let me, It's not that i will steal anything - You're the one who'll upload the Beta Script.
_Jake_ is offline   Reply With Quote
Old 17/06/2012, 12:45 PM   #10
Nirzor
Huge Clucker
 
Nirzor's Avatar
 
Join Date: Feb 2012
Location: Bangladesh
Posts: 443
Reputation: 41
Default Re: How To Make Admin Ranks + /admins

btw ty Romel whatever marks i got umm happy with it
__________________
BB SA-MP
Nirzor is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Admin Ranks MechaTech Scripting Help 11 24/05/2012 08:46 PM
Admin Ranks? sanplayer Scripting Help 10 09/10/2011 05:59 PM
How do I make level 1 admins secret from /admins seanny Help Archive 4 27/05/2011 08:00 AM
Im using v-admin how do i make it so admins spawn somewhere else aspire5630 Help Archive 1 04/05/2009 12:18 PM


All times are GMT. The time now is 02:36 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.