Help With Admin System
#1

Hello recently I made my own admin system. I followed a tut from this link: https://sampforum.blast.hk/showthread.php?tid=154852 . Mind someone give me a sample admin command I tried making one that i used for rcon but it didnt work. Plz Help!!!
Reply
#2

Sure,

/ban using dcmd and sscanff

pawn Код:
dcmd_ban(playerid,params[])
{
        new Reason[256], pID;
        if(PlayerInfo[playerid][pAdminLevel] < 3)
        {
            return SendClientMessage(playerid,COLOR_RED,"You need to be at least over Admin level 3 to use this command.");
        }
        if(sscanf(params,"us",pID,Reason))
        {
            return SendClientMessage(playerid,COLOR_RED,"USAGE: /ban [playerid] [reason]");
        }
        if(!IsPlayerConnected(pID))
        {
            return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
        }
        if(PlayerInfo[playerid][pAdminLevel] < PlayerInfo[pID][pAdminLevel])
        {
            return SendClientMessage(playerid,COLOR_RED,"You can't use this command on a high ranked admin");
        }
        if(pID == playerid)
        {
            SendClientMessage(playerid,COLOR_RED,"You cannot ban yourself.");
            return 1;
        }
        new name[MAX_PLAYER_NAME], string[256];
        GetPlayerName(pID,name,sizeof(name));
        new Aname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,Aname,sizeof(Aname));
        format(string,sizeof(string)," %s has banned %s with the reason: %s",Aname,name,Reason[0] ? Reason : "<No Reason>");
        SendClientMessageToAll(COLOR_GREEN,string);
        Ban(pID);
        return 1;
}
just made it my self :/
Reply
#3

Hey dude it didn't work I got these errors and warrnings.
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : error 017: undefined symbol "PlayerInfo"
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : warning 215: expression has no effect
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : error 001: expected token: ";", but found "]"
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : error 029: invalid expression, assumed zero
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Here's the code with my lines
http://pastebin.com/BSvAbr1z
Reply
#4

You are missing a bracket somewhere ( } )
Reply
#5

Quote:
Originally Posted by expertprogrammer
Посмотреть сообщение
Hey dude it didn't work I got these errors and warrnings.
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : error 017: undefined symbol "PlayerInfo"
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : warning 215: expression has no effect
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : error 001: expected token: ";", but found "]"
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : error 029: invalid expression, assumed zero
C:\Users\Owner\Desktop\EPro Stunt, DM\gamemodes\epro.pwn(763) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Here's the code with my lines
http://pastebin.com/BSvAbr1z
Did you make an admin system yet? Is it finished? You need some way to check if the player is an admin, how does it work in ur script?

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
You are missing a bracket somewhere ( } )
Incorrect, he isn't.
Reply
#6

download a good admin system and there u will have soo much cmds
Reply
#7

Quote:
Originally Posted by RatHack
Посмотреть сообщение
download a good admin system and there u will have soo much cmds
Downloaded scripts arent always the best sollution. I made my own by myself and it works better on my server than any downloaded Admin script could and i can modify it by myself without getting any problems, because i know how it was done.
Reply
#8

Quote:
Originally Posted by DeathOnaStick
Посмотреть сообщение
Downloaded scripts arent always the best sollution. I made my own by myself and it works better on my server than any downloaded Admin script could and i can modify it by myself without getting any problems, because i know how it was done.
You are right he's not missing a bracket..

Creating an own admin script will also give you skills as you practice.
Reply
#9

The best is to make it yourself as it increases your skills a lot more then if you just copy & paste some others and edit it.
Reply
#10

Um did u read the post "Hello recently I made my own admin system. I followed a tut from this link: https://sampforum.blast.hk/showthread.php?tid=154852 . Mind someone give me a sample admin command I tried making one that i used for rcon but it didnt work. Plz Help!!! " u could check the link to know how it works it uses dini so yea.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)