admin script
#1

Hello I got a registration system made by kush thank him for the tutorial,

But now I wanna make a adminscript with ZCMD. but how?
I wanna make 10 admin levels

+ basic commands namely:

/kick
/banname
/banip
/tempbanname
/tempbanip
/warn
/mute
/unmute
/freeze
/unfreeze
/god
/slap

And a lot of more commands.
But how can I make that?

Can anyone give me a little tutorial for how to make a admin system?

Thanks

Royriky123
Reply
#2

ill give you some of my commands ill edit when done

pawn Код:
CMD:freeze(playerid, params[])
{
    new id;
    new string[128];
    new string2[128];
    if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /freeze [id]");
    TogglePlayerControllable(id, 0);
    format(string, sizeof(string), "you have frozen %s", PlayerName(id));
    format(string2, sizeof(string2), "you have been frozen by %s", PlayerName(playerid));
    SendClientMessage(playerid, -1, string);
    SendClientMessage(id, -1, string2);
    return 1;
}
CMD:unfreeze(playerid, params[])
{
    new id;
    new string[128];
    new string2[128];
   
    if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /unfreeze [id]");
    TogglePlayerControllable(id, 1);
    format(string, sizeof(string), "you have unfrozen %s", PlayerName(id));
    format(string2, sizeof(string2), "you have been unfrozen by %s", PlayerName(playerid));
    SendClientMessage(playerid, -1, string);
    SendClientMessage(id, -1, string2);
    return 1;
}
pawn Код:
CMD:kick(playerid, params[]) {
    new ID, reason[24], string[128];
    if(sscanf(params,"us[24]",ID,reason)) return SendClientMessage(playerid,0xA70000FF,"Syntax: /Kick [ID] [Reason].");
    format(string,sizeof(string),"You've kicked %s for reason: %s.",PlayerName(ID),reason);
    SendClientMessage(playerid,0xFFFFFFFF,string);
    format(string,sizeof(string),"You've been kicked by %s for reason: %s.",PlayerName(playerid),reason);
    SendClientMessage(ID,0xFFFFFFFF,string);
    Kick(ID);
    return true;
}
there thats 3 commands all you have to do is put your variables for if they are admin
Reply
#3

pawn Код:
CMD:kick(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1) {
        new targetid, reason;
        new VBName[MAX_PLAYER_NAME];
        new VBName1[MAX_PLAYER_NAME];
        GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
        GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
        if(sscanf(params, "ri", targetid, reason)) return SendClientMessage(playerid, COLOR_PURPLE,"Usage: /kick [playerid] [reason]");
        if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Yourself!");
        if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Higher Administrators!");
        else {
            new str[128];
            format(str, sizeof(str), "Administrator %s Has Kicked %s Reason: %d!", VBName, VBName1, reason);
            SendClientMessageToAll(COLOR_DRED,str);
            Kick(targetid);
        }
    }
    else return SendClientMessage(playerid, COLOR_DRED, "You Need To Be A Administrator!");
    return 1;
}

CMD:warn(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid) || PlayerInfo[playerid][pVip] >= 3)
    {
        new reason[32];
        new targetid;
        if(sscanf(params, "rs[32]", targetid, reason))
            return SendClientMessage(playerid, COLOR_PURPLE,"Usage: /warn [playerid] [reason]");
        if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Warn Yourself!");


        new str[128],Name[MAX_PLAYER_NAME],Name1[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
        GetPlayerName(targetid, Name1, MAX_PLAYER_NAME);
        format(str, sizeof(str), "Administrator %s Has Warned %s Reason: %s!", Name, Name1, reason);
        SendClientMessageToAll(COLOR_DRED,str);
        Warns[targetid] ++;
    }
    return true;
}
       

CMD:setlevel(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 4 || IsPlayerAdmin(playerid)) {
        new VBName[MAX_PLAYER_NAME];
        new VBName1[MAX_PLAYER_NAME];
        new targetid;
        GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
        GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
        new
            iAdminValue,
            iTargetID;

        if(sscanf(params, "di", iTargetID, iAdminValue)) {
            SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /setlevel [playerid] [level]");
        }
        else if(IsPlayerConnected(iTargetID)) {
            new
                szMessage[47 + (MAX_PLAYER_NAME * 2)];

            if(iAdminValue < 0 || iAdminValue > 5) return SendClientMessage(playerid, COLOR_PURPLE, "Valid range is 0 - 5.");
            PlayerInfo[iTargetID][pAdmin] = iAdminValue;
            format(szMessage, sizeof(szMessage), "Administrator %s has promoted %s to a level %d admin.", VBName, VBName1, iAdminValue);
            SendStaffMessage(COLOR_PURPLE,szMessage);
            format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, VBName);
            SendClientMessage(iTargetID, COLOR_PURPLE, szMessage);
            format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", VBName1,iAdminValue);
            SendClientMessage(playerid, COLOR_PURPLE, szMessage);
        }
        else SendClientMessage(playerid, COLOR_PURPLE, "Invalid player specified.");
    }
    return 1;
}
Reply
#4

You can download of admin system and get commands
Reply
#5

Thank you all very very much , and how can I make 10 administrator levels? and some if check for is a player admin, and setlevels etc. Thanks RoyRiky123
Reply
#6

Quote:
Originally Posted by WagnerPM
Посмотреть сообщение
You can download of admin system and get commands
Most of admin scripts that you can be download are not still using zcmd
Reply
#7

im currently devolping a admin system wich will be ALL zcmd and ill release it i hope its good
Reply
#8

Yea I send u plus rep than haha:d
Reply
#9

Hey I got this errors and warnings idk how to fix it.

Quote:

C:\Users\roy\Desktop\samp server roy\pawno\Adminscript.pwn(1 : error 012: invalid function call, not a valid address
C:\Users\Edward\Desktop\samp server roy\pawno\Adminscript.pwn(1 : warning 215: expression has no effect
C:\Users\Edward\Desktop\samp server roy\pawno\Adminscript.pwn(1 : error 001: expected token: ";", but found ")"
C:\Users\Edward\Desktop\samp server roy\pawno\Adminscript.pwn(1 : error 029: invalid expression, assumed zero
C:\Users\Edward\Desktop\samp server roy\pawno\Adminscript.pwn(1 : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.

Reply
#10

Quote:
Originally Posted by BEER-samp
Посмотреть сообщение
Yea I send u plus rep than haha:d
lol yeh
Quote:
Originally Posted by royriky123
Посмотреть сообщение
Hey I got this errors and warnings idk how to fix it.
show us the lines please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)