Server:Unkown Command -
Eymeric69 - 06.07.2016
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(playerid, params[])
{
if(PlayerInfo[playerid][pIGRD] < 1) return SendClientMessage(playerid, COULEUR_GRIS, "You are not authorized to use this command.");
SendAdminText(playerid, "/ar", params);
new giveplayerid, playername[64], giveplayer[64], string[120];
if(!IsPlayerAdmin(playerid)) return 0;
if (sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, 0xAA3333AA, "Usage: /ar [playerid]");
new giveplayerid1 = reporter[giveplayerid];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
GetPlayerName(giveplayerid1, giveplayer, MAX_PLAYER_NAME);
if(giveplayerid1 == -1) return SendClientMessage(playerid, 0xAA3333AA, "Error: That player did not report anyone now!");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, 0xAA3333AA, "Error: User not online!");
if(!IsPlayerConnected(giveplayerid1)) return SendClientMessage(playerid, 0xAA3333AA, "Error: User not online!");
format(string, sizeof(string), "Your report on %s(%d) has been reviewed by %s(%d)", giveplayer, giveplayerid, playername, playerid);
SendClientMessage(giveplayerid, 0xAA3333AA, string);
SendClientMessage(playerid, 0xAA3333AA, "Spec the player who has been reported.");
return 1;
}
CMD:dr(playerid, params[])
{
if(PlayerInfo[playerid][pIGRD] < 1) return SendClientMessage(playerid, COULEUR_GRIS, "You are not authorized to use this command.");
SendAdminText(playerid, "/dr", params);
new giveplayerid, playername[64], giveplayer[64],reason[50], string[120];
if(!IsPlayerAdmin(playerid)) return 0;
if(sscanf(params, "us[128]", giveplayerid, reason)) return SendClientMessage(playerid, 0xAA3333AA, "Usage: /dr [playerid] [reason]");
new giveplayerid1 = reporter[giveplayerid];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
GetPlayerName(giveplayerid1, giveplayer, MAX_PLAYER_NAME);
if(giveplayerid1 == -1) return SendClientMessage(playerid, 0xAA3333AA, "Error: That player did not report anyone now!");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, 0xAA3333AA, "Error: User not online!");
if(!IsPlayerConnected(giveplayerid1)) return SendClientMessage(playerid, 0xAA3333AA, "Error: User not online!");
format(string, sizeof(string), "Your report on %s(%d) has been declined by %s(%d), reason: %s", giveplayer, giveplayerid1, playername, playerid, reason);
SendClientMessage(giveplayerid, 0xAA3333AA, string);
reporter[giveplayerid] = -1;
return 1;
}
CMD:tr(playerid, params[])
{
if(PlayerInfo[playerid][pIGRD] < 1) return SendClientMessage(playerid, COULEUR_GRIS, "You are not authorized to use this command.");
SendAdminText(playerid, "/tr",params);
new giveplayerid, playername[64], giveplayer[64], string[120];
if(!IsPlayerAdmin(playerid)) return 0;
if(sscanf(params, "us[128]", giveplayerid)) return SendClientMessage(playerid, 0xAA3333AA, "Usage: /tr [playerid]");
new giveplayerid1 = reporter[giveplayerid];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
GetPlayerName(giveplayerid1, giveplayer, MAX_PLAYER_NAME);
if(giveplayerid1 == -1) return SendClientMessage(playerid, 0xAA3333AA, "Error: That player did not report anyone now!");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, 0xAA3333AA, "Error: User not online!");
if(!IsPlayerConnected(giveplayerid1)) return SendClientMessage(playerid, 0xAA3333AA, "Error: User not online!");
format(string, sizeof(string), "Your report on %s(%d) has been declined by %s(%d)", giveplayer, giveplayerid1, playername, playerid);
SendClientMessage(giveplayerid, 0xAA3333AA, string);
reporter[giveplayerid] = -1;
return 1;
}
what's the matters ?
Re: Server:Unkown Command -
Stinged - 06.07.2016
Код:
if(!IsPlayerAdmin(playerid)) return 0;
If you're not logged in as RCON, you won't be able to use it.
Re: Server:Unkown Command -
Eymeric69 - 06.07.2016
i have set up the INI Files and the enum with pIRGD normally i don't have to do /rcon login [mypassword]
Re: Server:Unkown Command -
Mencent - 06.07.2016
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])
Re: Server:Unkown Command -
Eymeric69 - 06.07.2016
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...
Re: Server:Unkown Command -
Stinged - 06.07.2016
Then remove that line..
Re: Server:Unkown Command -
Eymeric69 - 06.07.2016
Why i don't want a IRGD player connect to the rcon command.
Re: Server:Unkown Command -
Vince - 06.07.2016

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.
Re: Server:Unkown Command -
Eymeric69 - 06.07.2016
oh god...
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
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 ?!
Re: Server:Unkown Command -
Mencent - 06.07.2016
pIRGD yes, but not RCON. You have to login in RCON with /rcon login. There isn't another way.