"Unknow command" [+REP]
#1

Hello. So, I made a VIP System, and I started with: /MakeVip [/FaVip in romanian].

pawn Код:
CMD:favip(playerid, params[])
{
    new ID;
    new Level;
    new string[128];
    new name[MAX_PLAYER_NAME];
    new pname[MAX_PLAYER_NAME];
    if(IsPlayerAdmin(playerid))
    {
        if(sscanf(params,"ui", ID, Level)) return SendClientMessage(playerid, COLOR_LIGHTBLUE,"Folosire: {FFCC33}/FaVip [ID] [Nivel Vip]");
        if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Jucatorul nu este conectat!");
        if(Level > 1) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nivel gresit. [1-2]");
        GetPlayerName(playerid, name, sizeof(name));
        GetPlayerName(ID, pname, sizeof(pname));
        VipInfo[ID][Vip] = Level;
        format(string, sizeof(string), "{FFCC33}Ai primit {FF0000}VIP {FFCC33}de nivel: {FF0000}%s {FFCC33}de la Admin-ul: {FF0000}%s {FFCC33}!", Level, name);
        SendClientMessage(ID, -1, string);
        format(string, sizeof(string), "{FFCC33}L-ai facut pe {FF0000}%s {FFCC33}VIP de nivel: {FF0000}%s {FFCC33}!", pname, Level);
        SendClientMessage(playerid, -1, string);
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nu esti RCON!");
    }
    return 1;
}

pawn Код:
enum vInfo
{
    Vip
}
new VipInfo[MAX_PLAYERS][vInfo];

But In-Game, only says: "Unknow Command". Tried with Grand Larceny GM, filescript it's loading, no errors, I'm logged as RCON, but doesn't work.
+ Rep for helper.
Reply
#2

pawn Код:
CMD:favip(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        if(sscanf(params, "ud", params[0], params[1])) return SendClientMessage(playerid, COLOR_LIGHTBLUE,"Folosire: {FFCC33}/FaVip [ID] [Nivel Vip]");
        if(!IsPlayerConnected(params[0]) && params[0] == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Jucatorul nu este conectat!");
        if(VipInfo[params[0]][Vip] == params[1]) return SendClientMessage(playerid, -1, "already has that vip level");
        if(params[1] < 0 || params[1] > 2) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nivel gresit. [1-2]");
       
        GetPlayerName(playerid, name, sizeof(name));
        GetPlayerName(params[0], pname, sizeof(pname));
        VipInfo[params[0]][Vip] = params[1];
       
        format(string, sizeof(string), "{FFCC33}Ai primit {FF0000}VIP {FFCC33}de nivel: {FF0000}%s {FFCC33}de la Admin-ul: {FF0000}%s {FFCC33}!", Level, name);
        SendClientMessage(ID, -1, string);
        format(string, sizeof(string), "{FFCC33}L-ai facut pe {FF0000}%s {FFCC33}VIP de nivel: {FF0000}%s {FFCC33}!", pname, Level);
        SendClientMessage(playerid, -1, string);
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nu esti RCON!");
    }
    return true;
}
Reply
#3

Solved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)