Suggestion Command
#1

Any One Can Help Me?? for Suggestion command like /suggest
with zcmd or any think I very need it for my server thx..
Reply
#2

This isn't script resquets. This is.
Reply
#3

Here..
pawn Код:
stock SendAdminMessage(color, admlvl, string[])
{
    foreach(Player, i)
    {
        if(IsPlayerLoggedIn(i) && PlayerInfo[i][pAdmin] >= admlvl)
        {
            SendClientMessage(i, color, string);
        }
    }
    return 1;
}
pawn Код:
#define COLOR_ORANGE 0xFF9900FF
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_GREY 0xAFAFAFFF
pawn Код:
CMD:suggest(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /suggest [text]");
    if(AntiAdv(playerid, params)) return 1;
    if(strlen(params) > 128) return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
    new File: file = fopen("suggestions.cfg", io_append), string[128];
    format(string, sizeof(string), "[%s] %s\r\n", RPN(playerid), params);
    fwrite(file, string);
    fclose(file);
    SendClientMessage(playerid, COLOR_ORANGE, "You suggestion has been posted and admins will soon review it.");
    format(string, sizeof(string), "{0xFF0000}AdmWarn:{0xFFBF00} %s has suggested something, /suggestions to view it. ", RPN(playerid));
    SendAdminMessage(COLOR_DARKRED, 1, string);
    return 1;
}
pawn Код:
CMD:suggestions(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pDev] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    new string[128], File: file = fopen("suggestions.cfg", io_read), idx=1;
    SendClientMessage(playerid, COLOR_ORANGE, "[Adrenaline Roleplay Suggestions]:");
    while(fread(file, string))
    {
        format(string, sizeof(string), "%d) %s", idx, string);
        SendClientMessage(playerid, COLOR_ORANGE, string);
        idx ++;
    }
    fclose(file);
    return 1;
}
Код:
You can do the enums for pAdmin etc..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)