Filterscript for textbox
#1

I want to make a filterscript with the following text to be displayed in a message box when the command /acmds is typed in.
Код:
Moderator (Level 1): /ban /slap /kick /warn /mute /unmute /jail /unjail /mutelist /announce /spec /specoff /asay /ip
Administrator (Level 2): /tempban /unban /clearchat /cweapons /worldtime /gotoxyz /lastlog (+All level 1 commands)
Head Administrator (Level 3): /setlevel /setvip /removevip /setexp /resetgod (+All level 1 & 2 commands) (Head admins cannot set anyone server owner)
Server Owner (Level 4): /setlevelviarcon /kickall /toglostaccmsg /saveallstats  /togstuntbonus (+All level 1, 2 & 3 commands)
I want it to be so that only Lvl 1, 2, 3, and 4 can access this list. How would I go about doing this?
Thanks in advance!
Also, how do I make a filterscript to display text in the chat window upon typing a command?
Код:
Example: "/lol"
Text output in chat: a light blue text of "Man that was so funny I laughed out loud!"
Reply
#2

What is your variable that stores your player levels? and what command include are you using?
Reply
#3

Well, I have no idea, and I'm a n00b at this, I just modified some existing scripts to get my server running...

Код:
case 1:
	    {
			PlayerInfo[giveid][Admin] = 1;
			format(str, sizeof(str), ""STEELBLUE"- AS - {%06x}%s(%d) "STEELBLUE"has been set to: Moderator", (GetPlayerColor(giveid) >>> 8), GetName( giveid ), giveid );
			SendClientMessageToAll( 0xB0C4DEFF, str );
			return 1;
		}
		case 2:
		{
		    PlayerInfo[giveid][Admin] = 2;
		    format(str, sizeof(str), ""STEELBLUE"- AS - {%06x}%s(%d) "STEELBLUE"has been set to: Administrator", (GetPlayerColor(giveid) >>> 8), GetName( giveid ), giveid );
		    SendClientMessageToAll( 0xB0C4DEFF, str );
		    return 1;
		}
		case 3:
		{
		    PlayerInfo[giveid][Admin] = 3;
		    format(str, sizeof(str), ""STEELBLUE"- AS - {%06x}%s(%d) "STEELBLUE"has been set to: Head Administrator", (GetPlayerColor(giveid) >>> 8), GetName( giveid ), giveid );
		    SendClientMessageToAll( 0xB0C4DEFF, str );
		    return 1;
		}
		case 4:
		{
		    PlayerInfo[giveid][Admin] = 4;
		    format(str, sizeof(str), ""STEELBLUE"- AS - {%06x}%s(%d) "STEELBLUE"has been set to: Server Owner", (GetPlayerColor(giveid) >>> 8), GetName( giveid ), giveid );
		    SendClientMessageToAll( 0xB0C4DEFF, str );
		    return 1;
Could this be the part with those variables?
Reply
#4

Bump :c
Reply
#5

Use strcat, and ShowDialogForPlayer.

Example:
pawn Код:
CMD:help(playerid, params[])
{
    new string[125]; // change this to suit your needs.
    strcat(string, "Line 1\n", sizeof(string));
    strcat(string, "Line 2\n", sizeof(string));
    ShowDialogForPlayer(playerid, -1, DIALOG_STYLE_MSGBOX, "Messagebox Title", string, "", "");
    return 1;
}
And use SendClientMessage for chat messages.
Reply
#6

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Use strcat, and ShowDialogForPlayer.

Example:
pawn Код:
CMD:help(playerid, params[])
{
    new string[125]; // change this to suit your needs.
    strcat(string, "Line 1\n", sizeof(string));
    strcat(string, "Line 2\n", sizeof(string));
    ShowDialogForPlayer(playerid, -1, DIALOG_STYLE_MSGBOX, "Messagebox Title", string, "", "");
    return 1;
}
And use SendClientMessage for chat messages.
Thanks, but I' confused here. I need to make the admin commands list only for levels 1 to 4, how do I do that?
And also, could you be a bit more specific on SendClientMessage? Sorry for being an ultra n00b. Thanks!
Reply
#7

Quote:
Originally Posted by prantheking
Посмотреть сообщение
Thanks, but I' confused here. I need to make the admin commands list only for levels 1 to 4, how do I do that?
And also, could you be a bit more specific on SendClientMessage? Sorry for being an ultra n00b. Thanks!
It's simple. (might be a better way to do this, but here's one)
pawn Код:
CMD:help(playerid, params[])
{
    new string[125]; // change this to suit your needs.
    if(PlayerInfo[giveid][Admin] > 0) strcat(string, "Level 1 admin help: blabla\n", sizeof(string)); // If the person is a level 1 admin, add the help for that level
    if(PlayerInfo[giveid][Admin] > 1) strcat(string, "Level 2 admin help: blabla\n", sizeof(string)); // If the person is a level 2 admin, add the help for that level
    ShowDialogForPlayer(playerid, -1, DIALOG_STYLE_MSGBOX, "Messagebox Title", string, "", "");
    return 1;
}
This will allow the admin to see the administrative commands for his admin level and the ones for the levels below him.
Reply
#8

Thanks, will try this^^
Reply
#9

You should try creating something from scratch if you want to actually learn how to script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)