Server:Unkown Command
#1

Hi this script make on the server that : Server:Unkown Command but i have verified the command there is no error here is the code :
PHP код:
CMD:ar(playeridparams[])
{
    if(
PlayerInfo[playerid][pIGRD] < 1) return SendClientMessage(playeridCOULEUR_GRIS"You are not authorized to use this command.");
    
SendAdminText(playerid"/ar"params);
    new 
giveplayeridplayername[64], giveplayer[64], string[120];
      if(!
IsPlayerAdmin(playerid)) return 0;
      if (
sscanf(params"u"giveplayerid)) return SendClientMessage(playerid0xAA3333AA"Usage: /ar [playerid]");
      new 
giveplayerid1 reporter[giveplayerid];
      
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
      
GetPlayerName(giveplayerid1giveplayerMAX_PLAYER_NAME);
      if(
giveplayerid1 == -1) return SendClientMessage(playerid0xAA3333AA"Error: That player did not report anyone now!");
    if(!
IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid0xAA3333AA"Error: User not online!");
    if(!
IsPlayerConnected(giveplayerid1)) return SendClientMessage(playerid0xAA3333AA"Error: User not online!");
    
format(stringsizeof(string), "Your report on %s(%d) has been reviewed by %s(%d)"giveplayergiveplayeridplayernameplayerid);
    
SendClientMessage(giveplayerid0xAA3333AAstring);
    
SendClientMessage(playerid0xAA3333AA"Spec the player who has been reported.");
    return 
1;
}
CMD:dr(playeridparams[])
{
    if(
PlayerInfo[playerid][pIGRD] < 1) return SendClientMessage(playeridCOULEUR_GRIS"You are not authorized to use this command.");
    
SendAdminText(playerid"/dr"params);
    new 
giveplayeridplayername[64], giveplayer[64],reason[50], string[120];
    if(!
IsPlayerAdmin(playerid)) return 0;
    if(
sscanf(params"us[128]"giveplayeridreason)) return SendClientMessage(playerid0xAA3333AA"Usage: /dr [playerid] [reason]");
    new 
giveplayerid1 reporter[giveplayerid];
    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
    
GetPlayerName(giveplayerid1giveplayerMAX_PLAYER_NAME);
    if(
giveplayerid1 == -1) return SendClientMessage(playerid0xAA3333AA"Error: That player did not report anyone now!");
    if(!
IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid0xAA3333AA"Error: User not online!");
    if(!
IsPlayerConnected(giveplayerid1)) return SendClientMessage(playerid0xAA3333AA"Error: User not online!");
    
format(stringsizeof(string), "Your report on %s(%d) has been declined by %s(%d), reason: %s"giveplayergiveplayerid1playernameplayeridreason);
    
SendClientMessage(giveplayerid0xAA3333AAstring);
    
reporter[giveplayerid] = -1;
     return 
1;
}
CMD:tr(playeridparams[])
{
     if(
PlayerInfo[playerid][pIGRD] < 1) return SendClientMessage(playeridCOULEUR_GRIS"You are not authorized to use this command.");
     
SendAdminText(playerid"/tr",params);
    new 
giveplayeridplayername[64], giveplayer[64], string[120];
    if(!
IsPlayerAdmin(playerid)) return 0;
    if(
sscanf(params"us[128]"giveplayerid)) return SendClientMessage(playerid0xAA3333AA"Usage: /tr [playerid]");
    new 
giveplayerid1 reporter[giveplayerid];
    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
    
GetPlayerName(giveplayerid1giveplayerMAX_PLAYER_NAME);
    if(
giveplayerid1 == -1) return SendClientMessage(playerid0xAA3333AA"Error: That player did not report anyone now!");
    if(!
IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid0xAA3333AA"Error: User not online!");
    if(!
IsPlayerConnected(giveplayerid1)) return SendClientMessage(playerid0xAA3333AA"Error: User not online!");
    
format(stringsizeof(string), "Your report on %s(%d) has been declined by %s(%d)"giveplayergiveplayerid1playernameplayerid);
    
SendClientMessage(giveplayerid0xAA3333AAstring);
    
reporter[giveplayerid] = -1;
    return 
1;

what's the matters ?
Reply
#2

Код:
if(!IsPlayerAdmin(playerid)) return 0;
If you're not logged in as RCON, you won't be able to use it.
Reply
#3

i have set up the INI Files and the enum with pIRGD normally i don't have to do /rcon login [mypassword]
Reply
#4

Quote:
Originally Posted by Eymeric69
Посмотреть сообщение
i don't have to do /rcon login [mypassword]
Hmm, try to login in rcon before you use this commands.
(with /rcon login [password])
Reply
#5

but i want to use it with the INI files i have to add a code when a IRGD player connect he is automatically in RCON commands but he can do all commands...
Reply
#6

Then remove that line..
Reply
#7

Why i don't want a IRGD player connect to the rcon command.
Reply
#8

IsPlayerAdmin ONLY returns true IF /rcon login has been used by said player. A player can not be an RCON admin in ANY other way.
Reply
#9

oh god...

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    new 
INI:File INI_Open(UserPath(playerid));
    
INI_SetTag(File,"data");
    
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    
INI_WriteInt(File,"IGRD"PlayerInfo[playerid][pIGRD]);
    
INI_WriteInt(File,"BAD"PlayerInfo[playerid][pBAD]);
    
INI_WriteInt(File,"ARD"PlayerInfo[playerid][pARD]);
    
INI_WriteInt(File,"FCMD"PlayerInfo[playerid][pFCMD]);
    
INI_WriteInt(File,"FMD"PlayerInfo[playerid][pFMD]);
    
INI_Close(File);

pawn Код:
public OnPlayerConnect(playerid)
{
    new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s has join LG:RP", name);
    SendClientMessageToAll(playerid, string);
    reporter[playerid] = -1;[PHP][/PHP]
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Registering...","Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}
Код:
[data]
Deaths = 0
Kills = 0
Admin = 0
Cash = 0
Password = 351142768
FMD = 0
FCMD = 0
ARD = 0
BAD = 0
IGRD = 1
Now i can use pIGRD or not ?!
Reply
#10

pIRGD yes, but not RCON. You have to login in RCON with /rcon login. There isn't another way.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)