[FilterScript] iAdmin & iRegister system by iPrivate
#1

iAdmin & iRegister system by iPrivate
I'm sure there are a couple of admin filterscripts around but I though "Why shall I not release one too?". This ain't really special and it uses some of the admin commands I had added in my gamemode. Except that, there are made some differences which are:

Differences:

- Level 5 administrator has been removed
- /setlevel has been changed for level 4
- /kickall has been added for level 3
- /givecar has been added for level 2
- /ban has been added for level 2
- /slap has been added for level 1
- /skin has been added for level 1
- /acmds will ONLY shown the commands of your level and the old ones.

More commands are being to be added soon!

Commands (full list)
pawn Код:
COMMAND:acmds(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED,"Error: You have to be admin or you are not high level enoguh in order to use this command!");
    else if(PlayerInfo[playerid][pAdmin] == 1) return SendClientMessage(playerid, COLOR_RED, "Level 1: /kick - /armour - /health - /camera - /freeze - /unfreeze - /skin - /slap");
    else if(PlayerInfo[playerid][pAdmin] == 2)
    {
        SendClientMessage(playerid, COLOR_RED, "Level 1: /kick - /armour - /health - /camera - /freeze - /unfreeze - /skin - /slap");
        SendClientMessage(playerid, COLOR_RED, "Level 2: /get - /goto - /ban - /announce - /givecar");
    }
    else if(PlayerInfo[playerid][pAdmin] == 3)
    {
        SendClientMessage(playerid, COLOR_RED, "Level 1: /kick - /armour - /health - /camera - /freeze - /unfreeze - /skin - /slap");
        SendClientMessage(playerid, COLOR_RED, "Level 2: /get - /goto - /ban - /announce - /givecar");
        SendClientMessage(playerid, COLOR_RED, "Level 3: /givegun - /kickall - /resetguns");
    }
    else if(PlayerInfo[playerid][pAdmin] == 4)
    {
        SendClientMessage(playerid, COLOR_RED, "Level 1: /kick - /armour - /health - /camera - /freeze - /unfreeze - /skin - /slap");
        SendClientMessage(playerid, COLOR_RED, "Level 2: /get - /goto - /ban - /announce - /givecar");
        SendClientMessage(playerid, COLOR_RED, "Level 3: /givegun - /kickall - /resetguns");
        SendClientMessage(playerid, COLOR_RED, "Level 4: /setlevel");
    }
    return 1;
}
Downloads

Download using PasteBin
- We are offering only PasteBin for now.

How to get it working

- Open the pastebin link that's under "Downloads" section.
- Open a new .pwn file with Pawno application.
- Copy everything from the PasteBin link and paste it on the Pawno new file.
- Compile and save it under your 'filterscripts' folder.
- Open your scriptfiles folder.
- Create a new folder named 'Users'
- Open your server.cfg file and write the filterscript name in the 'filterscripts' line.
- Start your server and join the game.
- Register a new account.
- Close the game and go to Scriptfiles - Users - Your account.
- Open it and edit the 'Admin' line. Put it 4.
- Enjoy being administrator.

Credits

- Special thanks to ****** for the Y_INI include. (Required in saving accounts)
- Special thanks to Zeex for his zCMD include. (Command processor)
- And everyone else who contributed in the creation of this filterscript.
Reply
#2

Pretty simple I have to say...
Reply
#3

you can improve this, like:

pawn Код:
COMMAND:acmds(playerid)
{
    if(PlayerInfo[playerid][pAdmin] < 1)
        return SendClientMessage(playerid, COLOR_RED,"Error: You have to be admin or you are not high level enoguh in order to use this command!");
    switch(PlayerInfo[playerid][pAdmin])
    {
        case 1:
            SendClientMessage(playerid, COLOR_RED, "Level 1: /kick - /armour - /health - /camera - /freeze - /unfreeze - /skin - /slap");
        case 2:
        {
            SendClientMessage(playerid, COLOR_RED, "Level 1: /kick - /armour - /health - /camera - /freeze - /unfreeze - /skin - /slap");
            SendClientMessage(playerid, COLOR_RED, "Level 2: /get - /goto - /ban - /announce - /givecar");
        }
        case 3:
        {
            SendClientMessage(playerid, COLOR_RED, "Level 1: /kick - /armour - /health - /camera - /freeze - /unfreeze - /skin - /slap");
            SendClientMessage(playerid, COLOR_RED, "Level 2: /get - /goto - /ban - /announce - /givecar");
            SendClientMessage(playerid, COLOR_RED, "Level 3: /givegun - /kickall - /resetguns");
        }
        case 4:
        {
            SendClientMessage(playerid, COLOR_RED, "Level 1: /kick - /armour - /health - /camera - /freeze - /unfreeze - /skin - /slap");
            SendClientMessage(playerid, COLOR_RED, "Level 2: /get - /goto - /ban - /announce - /givecar");
            SendClientMessage(playerid, COLOR_RED, "Level 3: /givegun - /kickall - /resetguns");
            SendClientMessage(playerid, COLOR_RED, "Level 4: /setlevel");
        }
    }
    return 1;
}
anyway good job for a beginner scripter
Reply
#4

not bad
Reply
#5

@PT: I think that there wont be any difference of performance on both commands, isn't it?

@Team_PRO & @Gen3i: Thank you.
Reply
#6

Quote:
Originally Posted by iPrivate
Посмотреть сообщение
@PT: I think that there wont be any difference of performance on both commands, isn't it?

@Team_PRO & @Gen3i: Thank you.
You won't see any difference when you execute the command but when you test its speed you will notice that switch statement is much faster than if statement by 252 milliseconds
Reply
#7

Seems nice, good job
Reply
#8

Quote:
Originally Posted by iPrivate
Посмотреть сообщение
@PT: I think that there wont be any difference of performance on both commands, isn't it?
How like pds2k12 said you will gain more velocity and perfomance from code..

you need do some velocity test's and you will see.
Reply
#9

niiice ;o
Reply
#10

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)