/Rban, /Ban, /Unban, /Explode-Player
#1

how would i make these commands:
Код:
/Rban
/Ban
/Unban
/Explode-Player
how would i make these cmds i dont want the entire code i want to know how to make em as i have a nice admin script and i lack these cmds so how can i make them?

Regards,
Zonoya,
AKA, Bella
Reply
#2

Anyone^^?
Reply
#3

Search on the wiki for "Ban" and "CreateExplosion"
Reply
#4

Using zcmd:

Explode:
pawn Код:
CMD:explode(playerid, params[])
{
    {
    new targetid;
    if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: [PlayerID/PartOfName]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Player not connected!");
    else
        {
            new Float:SLX, Float:SLY, Float:SLZ;
            GetPlayerPos(targetid, SLX, SLY,SLZ);
            CreateExplosion(SLX, SLY, SLZ, 11, 0.25);
            new string[128];
            new pName[24], pTame[24];
            GetPlayerName(playerid,pName,24);
            GetPlayerName(targetid,pTame,24);
            format(string,sizeof string,"%s has been exploded by Administrator %s.",pTame,pName);
            SendClientMessageToAll(0xFFFFFFFF, string);
        }
    }
    return 1;
}
Ban:
pawn Код:
CMD:ban(playerid, params[])
{
    new targetid, reason[64], string[128];
    if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: [PlayerID/PartOfName] [Reason]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Player not connected!");
    {
        new pTargetName[24], pName[24];
        GetPlayerName(playerid,pName,24);
        GetPlayerName(targetid,pTargetName,24);
        format(string, sizeof(string), "Admin %s has IP banned %s Reason: %s", pName,  pTargetName, reason);
        SendClientMessageToAll(0xFFFFFFFF,string);
        Ban(targetid);
    }
    return 1;
}
Reply
#5

its not ban im worried about tell me unban that is compatible with ban then thats what i want
Reply
#6

pawn Код:
dcmd_rban(playerid,params[])
{
    if(AccInfo[playerid][LoggedIn] == 1)
    {
        if(AccInfo[playerid][Level] >= 4)
        {
            new ip[128], Index;
            new tmp[256];  tmp  = strtok(params,Index);
            new tmp2[256]; tmp2 = strtok(params,Index);
           
            if(!strlen(params)) return
            SendClientMessage(playerid, LIGHTBLUE2, "Usage: /rban [PlayerID] [Reason]") &&
            SendClientMessage(playerid, orange, "Function: Will Range Ban the specified player");
            if(!strlen(tmp2)) return
            SendClientMessage(playerid, red, "ERROR: Reason unspecified!");
            new player1;
            new string[128];
            new playername[MAX_PLAYER_NAME];
            new adminname [MAX_PLAYER_NAME];
            player1 = strval(tmp);

            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
             {
                GetPlayerName(player1, playername, sizeof(playername));
                GetPlayerName(playerid, adminname, sizeof(adminname));
                new year,month,day; getdate(year, month, day);
                new hour,minuite,second; gettime(hour,minuite,second);
                SendCommandToAdmins(playerid,"RBan");
                format(string,sizeof(string),"|- %s has been Range Banned by Administrator %s | Reason: %s [Date: %d/%d/%d] [Time: %d:%d] -|",playername,adminname,params[2],day,month,year,hour,minuite);
                SendClientMessageToAll(lightred,string);
                new str[128];
                format(str,sizeof(str),"%s has been Range Banned by Administrator %s | Reason: %s",playername,adminname,params[2]);
                SaveIn("BanLog",str);
                print(string);
                if(udb_Exists(PlayerName2(player1)) && AccInfo[player1][LoggedIn] == 1)
                dUserSetINT(PlayerName2(player1)).("Banned",1);
                GetPlayerIp(player1,ip,sizeof(ip));
                strdel(ip,strlen(ip)-2,strlen(ip));
                format(ip,128,"%s**",ip);
                format(ip,128,"banip %s",ip);
                SendRconCommand(ip);
                return 1;
            }
            else return ErrorMessages(playerid, 3);
        }
        else return ErrorMessages(playerid, 1);
    }
    else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Reply
#7

Are we going to script all your server?
I suggest you to hire a scripter.
Reply
#8

pawn Код:
dcmd_ban(playerid,params[])
{
    if(AccInfo[playerid][LoggedIn] == 1)
    {
        if(AccInfo[playerid][Level] >= 4)
        {
            new Index;
            new tmp[256];  tmp  = strtok(params,Index);
            new tmp2[256]; tmp2 = strtok(params,Index);
           
            if(!strlen(params)) return
            SendClientMessage(playerid, LIGHTBLUE2, "Usage: /ban [PlayerID] [Reason]") &&
            SendClientMessage(playerid, orange, "Function: Will Ban the specified player");
            if(!strlen(tmp2))
            return SendClientMessage(playerid, red, "ERROR: Reason unspecified!");
            new player1;
            new string[128];
            new playername[MAX_PLAYER_NAME];
            new adminname [MAX_PLAYER_NAME];
            player1 = strval(tmp);

            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
            {
                GetPlayerName(player1, playername, sizeof(playername));
                GetPlayerName(playerid, adminname, sizeof(adminname));
                new year,month,day; getdate(year, month, day);
                new hour,minuite,second; gettime(hour,minuite,second);
                SendCommandToAdmins(playerid,"Ban");
                format(string,sizeof(string),"|- %s has been Banned by Administrator %s | Reason: %s [Date: %d/%d/%d] [Time: %d:%d]",playername,adminname,params[2],day,month,year,hour,minuite);
                SendClientMessageToAll(lightred,string);
                new str[128];
                format(str,sizeof(str),"%s has been Banned by Administrator %s | Reason: %s",playername,adminname,params[2]);
                SaveIn("BanLog",str);
                print(string);
                if(udb_Exists(PlayerName2(player1)) && AccInfo[player1][LoggedIn] == 1)
                dUserSetINT(PlayerName2(player1)).("Banned",1);
                format(string,sizeof(string),"Banned by Administrator %s. | Reason: %s",adminname,params[2]);
                return BanEx(player1, string);
            }
            else return SendClientMessage(playerid, red, "ERRPR: Player is not connected or is yourself or is the highest level admin");
        }
        else return ErrorMessages(playerid, 1);
    }
    else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
im using this Ban cmd!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)