Need help with ranks
#1

Hey guys i'm really in trouble here
So the problem:
First of all let me tell u all the ranks.Im using ladmin system.
Level 1 = Moderator
Level 2 = Master Moderator
Level 3 = Administrator
Level 4 = Head-Administrator
Level 5 = Owner/Co-Owner.

Now what i want is when i type this command.
Example
/c [my text here ex: hey]. Now what i want here is the it should check what level im if level 1 then moderator if level 2 then master moderator And goes like that to level 5 owner/co-owner.
like this. for ex i m level 5 then " Owner/Co-Owner Redbull[GD] Says Hey

So please help me guys i really want this script and urgently plz help
Thanks in advance
If u need any additional information then tell me



Код:
dcmd_c(playerid,params[]) {
	 #pragma unused params
	 if(PlayerInfo[playerid][Level] >= 5) {
		 if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /c [text]");
		 new string [128]; format (string, sizeof(string), "**Owner %s: %s", PlayerName2(playerid), params[0] );
		 return SendClientMessageToAll(COLOR_PINK,string);
	 } else return SendClientMessage(playerid,red,"ERROR: You need to be level 5 to use this command");
}
Reply
#2

You can create an array to stores the "level" names, for example:

pawn Код:
#define MAX_LEVELS 6

new LevelName[MAX_LEVELS][20] =
{
    "None", // level 0
    "Moderator", // level 1
    "Master Moderator", // level 2
    "Administrator", // level 3
    "Head Administrator", // level 4
    "Owner/Co-Owner", // level 5
};

// Now a simple use would be:

CMD:mycommand(playerid,params[])
{
    // Supposing that admin level is stored on PlayerInfo[playerid][admlvl]
    new str[60];    
    format(str,60,"Your admin name is: %s",LevelName[PlayerInfo[playerid][adminlvl]]);
    SendClientMessage(playerid,-1,str);
    return 1;
}
Reply
#3

Try this:-
Use different cmds for different level of admins?


pawn Код:
dcmd_c1(playerid,params[]) {
     #pragma unused params
     if(PlayerInfo[playerid][Level] <= 2) {
         if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /c1 [text]");
         new string [128]; format (string, sizeof(string), "*Moderator %s: %s", PlayerName2(playerid), params[0] );
         return SendClientMessageToAll(COLOR_PINK,string);
     } else return SendClientMessage(playerid,red,"ERROR: You need to be level 1 to use this command");
}
Now for level 2:-
pawn Код:
dcmd_c2(playerid,params[]) {
     #pragma unused params
     if(PlayerInfo[playerid][Level] <= 3) {
         if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /c2 [text]");
         new string [128]; format (string, sizeof(string), "*Master Moderator %s: %s", PlayerName2(playerid), params[0] );
         return SendClientMessageToAll(COLOR_PINK,string);
     } else return SendClientMessage(playerid,red,"ERROR: You need to be level 2 to use this command");
}
Now for level 3:-
pawn Код:
dcmd_c3(playerid,params[]) {
     #pragma unused params
     if(PlayerInfo[playerid][Level] <= 4) {
         if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /c3 [text]");
         new string [128]; format (string, sizeof(string), "*Administrator %s: %s", PlayerName2(playerid), params[0] );
         return SendClientMessageToAll(COLOR_PINK,string);
     } else return SendClientMessage(playerid,red,"ERROR: You need to be level 5 to use this command");
}
For level 4:-
pawn Код:
dcmd_c4(playerid,params[]) {
     #pragma unused params
     if(PlayerInfo[playerid][Level] <= 5) {
         if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /c4 [text]");
         new string [128]; format (string, sizeof(string), "*Head-Admin %s: %s", PlayerName2(playerid), params[0] );
         return SendClientMessageToAll(COLOR_PINK,string);
     } else return SendClientMessage(playerid,red,"ERROR: You need to be level 4 to use this command");
}
Now for level 5:-
pawn Код:
dcmd_c(playerid,params[]) {
     #pragma unused params
     if(PlayerInfo[playerid][Level] >= 5) {
         if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /c5 [text]");
         new string [128]; format (string, sizeof(string), "**Owner %s: %s", PlayerName2(playerid), params[0] );
         return SendClientMessageToAll(COLOR_PINK,string);
     } else return SendClientMessage(playerid,red,"ERROR: You need to be level 5 to use this command");
}
Make sure to define.
Reply
#4

@Patroool

This works, but is such a waste of lines, and is very newbie to make a player type differents CMD's if his level varies.
Reply
#5

Quote:
Originally Posted by arakuta
Посмотреть сообщение
@Patroool

This works, but is such a waste of lines, and is very newbie to make a player type differents CMD's if his level varies.
Yes buddy, But what you explained he got nothing because he just no open, edit, compile close. You are correct too but as he is familiar with normal codes so i thought why not proceed.

^.^
Reply
#6

Quote:
Originally Posted by [vTc]Patroool
Посмотреть сообщение
Try this:-
Use different cmds for different level of admins?


pawn Код:
dcmd_c1(playerid,params[]) {
     #pragma unused params
     if(PlayerInfo[playerid][Level] <= 2) {
         if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /c1 [text]");
         new string [128]; format (string, sizeof(string), "*Moderator %s: %s", PlayerName2(playerid), params[0] );
         return SendClientMessageToAll(COLOR_PINK,string);
     } else return SendClientMessage(playerid,red,"ERROR: You need to be level 1 to use this command");
}
Now for level 2:-
pawn Код:
dcmd_c2(playerid,params[]) {
     #pragma unused params
     if(PlayerInfo[playerid][Level] <= 3) {
         if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /c2 [text]");
         new string [128]; format (string, sizeof(string), "*Master Moderator %s: %s", PlayerName2(playerid), params[0] );
         return SendClientMessageToAll(COLOR_PINK,string);
     } else return SendClientMessage(playerid,red,"ERROR: You need to be level 2 to use this command");
}
Now for level 3:-
pawn Код:
dcmd_c3(playerid,params[]) {
     #pragma unused params
     if(PlayerInfo[playerid][Level] <= 4) {
         if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /c3 [text]");
         new string [128]; format (string, sizeof(string), "*Administrator %s: %s", PlayerName2(playerid), params[0] );
         return SendClientMessageToAll(COLOR_PINK,string);
     } else return SendClientMessage(playerid,red,"ERROR: You need to be level 5 to use this command");
}
For level 4:-
pawn Код:
dcmd_c4(playerid,params[]) {
     #pragma unused params
     if(PlayerInfo[playerid][Level] <= 5) {
         if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /c4 [text]");
         new string [128]; format (string, sizeof(string), "*Head-Admin %s: %s", PlayerName2(playerid), params[0] );
         return SendClientMessageToAll(COLOR_PINK,string);
     } else return SendClientMessage(playerid,red,"ERROR: You need to be level 4 to use this command");
}
Now for level 5:-
pawn Код:
dcmd_c(playerid,params[]) {
     #pragma unused params
     if(PlayerInfo[playerid][Level] >= 5) {
         if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /c5 [text]");
         new string [128]; format (string, sizeof(string), "**Owner %s: %s", PlayerName2(playerid), params[0] );
         return SendClientMessageToAll(COLOR_PINK,string);
     } else return SendClientMessage(playerid,red,"ERROR: You need to be level 5 to use this command");
}
Make sure to define.
Thank you very much but can u tell me what to define i m very new plz help
Reply
#7

Hmmm, sure.

dcmd(c1,2,cmdtext);
dcmd(c2,2,cmdtext);
dcmd(c3,2,cmdtext);
dcmd(c4,2,cmdtext);
dcmd(c,1,cmdtext);
Reply
#8

Quote:
Originally Posted by [vTc]Patroool
Посмотреть сообщение
Hmmm, sure.

dcmd(c1,2,cmdtext);
dcmd(c2,2,cmdtext);
dcmd(c3,2,cmdtext);
dcmd(c4,2,cmdtext);
dcmd(c,1,cmdtext);
Awesome!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Love u love u <3 XD XD XD
Reply
#9

Quote:
Originally Posted by RedbullGD
Посмотреть сообщение
Awesome!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Love u love u <3 XD XD XD
Your most welcome!
Reply
#10

Quote:
Originally Posted by [vTc]Patroool
Посмотреть сообщение
Your most welcome!
Rep++++++++++++++++++++++++++++
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)