Whats Wrong?
#1

Hello,
I've made a Makeadmin command for my Administration System,
but for some reason, it sends "Unknown Command" Error.
Here's The Code
pawn Код:
COMMAND:makeadmin(playerid, params[])
{
new id;
new AdminLevel2;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
{
if(!sscanf(params, "ui", id, AdminLevel2))
{
if((AdminLevel2 >= 1 && AdminLevel2 <= 5) || AdminLevel2 == 0)
{
new string[126];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), ""red"[DU]:"green"Server Owner %s Has Set Your Level To %d", name, AdminLevel2);
SendClientMessage(id, COLOR_GREEN, string);
format(string, sizeof(string), "You Gave Admin Level %d To %s", AdminLevel2, PlayerName);
SendClientMessage(playerid, COLOR_GREEN, string);
PlayerInfo[id][AdminLevel] = AdminLevel2;
return 1;
}
else return SendClientMessage(playerid, COLOR_GREEN, "Avaliable Levels: 1-5");
}
else return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /makeadmin [PlayerId/PartOfName] [AdminLevel]");
}
else return SendClientMessage(playerid, COLOR_RED, "You're not RCON Admin,You must be RCON Admin to use this COMMAND");
}
else return SendClientMessage(playerid, COLOR_RED, "Player Is Not Connected");
}
Thank You.
Reply
#2

pawn Код:
COMMAND:makeadmin(playerid, params[])
{
    new id;
    new AdminLevel2;
    if(!sscanf(params, "ui", id, AdminLevel2)) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /makeadmin [PlayerId/PartOfName] [AdminLevel]");
    if(IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player Is Not Connected");
    if(PlayerInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You're not RCON Admin,You must be RCON Admin to use this COMMAND");
    if((AdminLevel2 >= 1 && AdminLevel2 <= 5) || AdminLevel2 == 0) return SendClientMessage(playerid, COLOR_GREEN, "Avaliable Levels: 1-5");

    new string[126];
    new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    GetPlayerName(id, PlayerName, sizeof(PlayerName));
    format(string, sizeof(string), ""red"[DU]:"green"Server Owner %s Has Set Your Level To %d", name, AdminLevel2);
    SendClientMessage(id, COLOR_GREEN, string);
    format(string, sizeof(string), "You Gave Admin Level %d To %s", AdminLevel2, PlayerName);
    SendClientMessage(playerid, COLOR_GREEN, string);
    PlayerInfo[id][AdminLevel] = AdminLevel2;
    return 1;
}
btw to check rcon admins you have to write " IsPlayerAdmin""
Reply
#3

Quote:
Originally Posted by emokidx111
Посмотреть сообщение
pawn Код:
COMMAND:makeadmin(playerid, params[])
{
    new id;
    new AdminLevel2;
    if(!sscanf(params, "ui", id, AdminLevel2)) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /makeadmin [PlayerId/PartOfName] [AdminLevel]");
    if(IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player Is Not Connected");
    if(PlayerInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You're not RCON Admin,You must be RCON Admin to use this COMMAND");
    if((AdminLevel2 >= 1 && AdminLevel2 <= 5) || AdminLevel2 == 0) return SendClientMessage(playerid, COLOR_GREEN, "Avaliable Levels: 1-5");

    new string[126];
    new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    GetPlayerName(id, PlayerName, sizeof(PlayerName));
    format(string, sizeof(string), ""red"[DU]:"green"Server Owner %s Has Set Your Level To %d", name, AdminLevel2);
    SendClientMessage(id, COLOR_GREEN, string);
    format(string, sizeof(string), "You Gave Admin Level %d To %s", AdminLevel2, PlayerName);
    SendClientMessage(playerid, COLOR_GREEN, string);
    PlayerInfo[id][AdminLevel] = AdminLevel2;
    return 1;
}
btw to check rcon admins you have to write " IsPlayerAdmin""
Hello,
I Know we need to have " IsPlayerAdmin" I was using my rcon security system in-which we need to confirm another rcon admin level,
Well the code dosent works, When i type /Makeadmin It says Player Is Not Connected..
Thank You!
Reply
#4

pawn Код:
if(sscanf(params, "ui", id, AdminLevel2)) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /makeadmin [PlayerId/PartOfName] [AdminLevel]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player Is Not Connected");
    if(PlayerInfo[playerid][AdminLevel] < 5 || !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You're not RCON Admin,You must be RCON Admin to use this COMMAND");
    if((AdminLevel2 == 0 || AdminLevel2 > 5) return SendClientMessage(playerid, COLOR_GREEN, "Avaliable Levels: 1-5");
oops.try this
Reply
#5

Quote:
Originally Posted by emokidx111
Посмотреть сообщение
pawn Код:
if(sscanf(params, "ui", id, AdminLevel2)) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /makeadmin [PlayerId/PartOfName] [AdminLevel]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player Is Not Connected");
    if(PlayerInfo[playerid][AdminLevel] < 5 || IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You're not RCON Admin,You must be RCON Admin to use this COMMAND");
    if((AdminLevel2 == 0 || AdminLevel2 > 5) return SendClientMessage(playerid, COLOR_GREEN, "Avaliable Levels: 1-5");
oops.try this
Dosent Work.
Still says "Player Is Not Connected"......
Reply
#6

make sure the player is really connected to the server whom you are trying to use this on... cause that should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)