help! please!
#6

pawn Код:
dcmd_ban(playerid,params[]) {
    if(PlayerInfo[playerid][LoggedIn] == 1) {
        if(PlayerInfo[playerid][admin] >= 4) {
            new tmp[256], tmp2[256], Index;     tmp = strtok(params,Index), tmp2 = strtok(params,Index);
            if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /ban [playerid] [reason]");
            if(!strlen(tmp2)) return SendClientMessage(playerid, red, "ERROR: You must give a reason");
            new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
            player1 = strval(tmp);

            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) {
                GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
                new year,month,day,hour,minuite,second; getdate(year, month, day); gettime(hour,minuite,second);
                //CMDMessageToAdmins(playerid,"BAN");
                format(string,sizeof(string),"Administrator \"%s\" has banned \"%s\" (Reason: %s) ",adminname,playername,params[2]);
                SendClientMessageToAll(red,string);
                SaveToFile("BanLog",string);
                print(string);
                if(udb_Exists(PlayerName2(player1)) && PlayerInfo[player1][LoggedIn] == 1) dUserSetINT(PlayerName2(player1)).("banned",1) /*&& dUserSetINT(PlayerName2(player1)). "0",2**/;
                format(string,sizeof(string),"banned by Administrator %s. Reason: %s", adminname, params[2] );
                return BanEx(player1, string);
            } else return SendClientMessage(playerid, red, "Player is not connected or is yourself or is the highest level admin");
        } else return SendClientMessage(playerid,red,"ERROR: You need to be level 4 or higher to use this command.");
    } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Reply


Messages In This Thread
help! please! - by [MKD]Max - 20.01.2011, 04:00
Re: help! please! - by [MKD]Max - 20.01.2011, 04:14
Re: help! please! - by -Rebel Son- - 20.01.2011, 04:16
Re: help! please! - by [MKD]Max - 20.01.2011, 11:28
Re: help! please! - by [MKD]Max - 20.01.2011, 12:45
Re: help! please! - by [SU]Balli - 20.01.2011, 12:49
Re: help! please! - by [MKD]Max - 20.01.2011, 12:56
Re: help! please! - by [MKD]Max - 20.01.2011, 13:23
Re: help! please! - by Elviss - 20.01.2011, 13:25
Re: help! please! - by [MKD]Max - 20.01.2011, 13:59

Forum Jump:


Users browsing this thread: 1 Guest(s)