SA-MP Forums Archive
[FilterScript] iAdmin & iRegister system by iPrivate - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] iAdmin & iRegister system by iPrivate (/showthread.php?tid=481643)



iAdmin & iRegister system by iPrivate - iPrivate - 16.12.2013

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.



Re: iAdmin & iRegister system by iPrivate - Gen3i - 16.12.2013

Pretty simple I have to say...


Re: iAdmin & iRegister system by iPrivate - PT - 16.12.2013

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


Re: iAdmin & iRegister system by iPrivate - Team_PRO - 17.12.2013

not bad


Re: iAdmin & iRegister system by iPrivate - iPrivate - 17.12.2013

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

@Team_PRO & @Gen3i: Thank you.


Re: iAdmin & iRegister system by iPrivate - Patrick - 17.12.2013

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


Re: iAdmin & iRegister system by iPrivate - juank - 17.12.2013

Seems nice, good job


Re: iAdmin & iRegister system by iPrivate - PT - 17.12.2013

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.


Re: iAdmin & iRegister system by iPrivate - DeathFire - 17.12.2013

niiice ;o


Re: iAdmin & iRegister system by iPrivate - iPrivate - 19.12.2013

Thank you.