can i get help with cmds ?
#2

Here it is:
pawn Код:
CMD:reportbug(playerid, params[])
{
    if(sscanf(params, "s[128]", params))
        return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /reportbug [text]");

    if(strlen(params) > 12)
        return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
       
    new File: file = fopen("bugs.cfg", io_append), string[128], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof pName);
    format(string, sizeof(string), "[%s] %s\r\n", pName, params);
    fwrite(file, string);
    fclose(file);
    SendClientMessage(playerid, COLOR_ORANGE, "Your bug report has been saved, scripters will check it once possible.");
    format(string, sizeof(string), "AdmWarn: %s has reported a bug, /bugs to view it. (Inform Zaiat about it ASAP)", pName);
    SendAdminMessage(COLOR_DARKRED, 1, string);
    return 1;
}

CMD:bugs(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 1)
        return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
       
    new string[128], File: file = fopen("bugs.cfg", io_read), idx=1;
    SendClientMessage(playerid, COLOR_ORANGE, "[City Of Roleplay Bugs]:");
    while(fread(file, string))
    {
        format(string, sizeof(string), "%d) %s", idx, string);
        SendClientMessage(playerid, COLOR_ORANGE, string);
        idx ++;
    }
    fclose(file);
    return 1;
}

CMD:deletebug(playerid, params[])
{
    new line;
    if(PlayerInfo[playerid][pAdmin] < 7)
        return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
       
    if(sscanf(params, "i", line))
        return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /deletebug [bugid]");
       
    if(line < 1)
        return SendClientMessage(playerid, COLOR_GREY, "Invalid bug id.");
       
    new string[128], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof pName);
    fdeleteline("bugs.cfg", line);
    format(string, sizeof(string), "AdmWarn: %s has deleted bug ID %d.", pName, line);
    SendAdminMessage(COLOR_DARKRED, 1, string);
    return 1;
}
Reply


Messages In This Thread
can i get help with cmds ? - by Joe_Goro - 22.02.2013, 11:03
Re: can i get help with cmds ? - by antonio112 - 22.02.2013, 11:18
Re: can i get help with cmds ? - by Joe_Goro - 22.02.2013, 11:25
Re: can i get help with cmds ? - by antonio112 - 22.02.2013, 11:36
Re: can i get help with cmds ? - by Joe_Goro - 22.02.2013, 16:55
Re: can i get help with cmds ? - by antonio112 - 22.02.2013, 17:48
Re: can i get help with cmds ? - by Brokenbreaken - 22.02.2013, 18:11
Re: can i get help with cmds ? - by Joe_Goro - 24.02.2013, 13:47

Forum Jump:


Users browsing this thread: 1 Guest(s)