BIG sscanf2.5 problem, I'm stuck...
#9

Of course! The reason of why I suddenly found this out, is that I never tested these commands on anyone else, or I was ID 1...

pawn Код:
CMD:kick(playerid, params[])
    {
        if(PlayerInfo[playerid][pAdmin] >= 3) {
            new PID;
            new reason[64];
            new str[128];
            new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
            GetPlayerName(PID, Playername, sizeof(Playername));
            GetPlayerName(playerid, Adminname, sizeof(Adminname));
           
            if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /kick [playerid] [reason]");

            if(!IsPlayerConnected(PID))
                return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");

            format(str, sizeof(str), "'%s' has been kicked by administrator '%s'. Reason: %s ", Playername, Adminname, reason);
            SendClientMessageToAll(COLOR_RED, str);
            new File:Log = fopen(kickPATH, io_append);
            new logData[128];
            new fTime[6];
            getdate(fTime[0], fTime[1], fTime[2]);
            gettime(fTime[3], fTime[4], fTime[5]);
            format(logData, sizeof logData, "[%02d/%02d/%04d || %02d:%02d:%02d]%s kicked %s! (Reason: %s) \r\n", fTime[2], fTime[1], fTime[0], fTime[3], fTime[4], fTime[5], Adminname, Playername, reason);
            fwrite(Log, logData);
            fclose(Log);
            Kick(PID);

        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You have to be level 3 to use that command!");
        }
        return 1;
    }
Reply


Messages In This Thread
BIG sscanf2.5 problem, I'm stuck... - by Twisted_Insane - 22.03.2012, 14:49
Re: BIG sscanf2.5 problem, I'm stuck... - by Wickeed - 22.03.2012, 14:52
Re: BIG sscanf2.5 problem, I'm stuck... - by Twisted_Insane - 22.03.2012, 14:57
Re: BIG sscanf2.5 problem, I'm stuck... - by new121 - 22.03.2012, 15:51
Re: BIG sscanf2.5 problem, I'm stuck... - by Edvin - 22.03.2012, 16:14
Re: BIG sscanf2.5 problem, I'm stuck... - by Spooky - 22.03.2012, 16:48
Re: BIG sscanf2.5 problem, I'm stuck... - by Twisted_Insane - 22.03.2012, 17:15
Re: BIG sscanf2.5 problem, I'm stuck... - by Spooky - 22.03.2012, 17:17
Re: BIG sscanf2.5 problem, I'm stuck... - by Twisted_Insane - 22.03.2012, 17:20
Re: BIG sscanf2.5 problem, I'm stuck... - by Spooky - 22.03.2012, 17:24

Forum Jump:


Users browsing this thread: 7 Guest(s)