How to create filterscript for my own custom rcon commands -
bobsona - 12.08.2014
Hello, I want to create few rcon commands, which I want to access through the console by rcon.
Any examples?
For example, I want to create command that promotes certain player to a certain Admin lvl. / VIP lvl.
Or a command that removes all nick/IP bans of a certain player by nick.
P.S.
For example, this is my current command for unban player.
I want to create an alternative rcon command like this, which I want to access from console.
Код:
dcmd_unban(playerid, params[])
{
if(pInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid, COLOR_RED, "You have no righs!");
new target[30], user[128];
if(sscanf(params, "s[30]", target)) return SendClientMessage(playerid, COLOR_ORANGE, "Use: /unban [player nick]");
format(user, sizeof(user), "%s.ini", target);
if(INI_Exist(user))
{
new INI:File = INI_Open(user);
INI_SetTag(File,"Player's Data");
INI_WriteInt(File, "Banned", 0);
INI_Close(File);
SendClientMessage(playerid,COLOR_ORANGE,"You can use /rcon unbanip [IP of the player] too!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "This player is not existing!");
return 1;
}
return 1;
}
Re: How to create filterscript for my own custom rcon commands -
Affan - 12.08.2014
You first need an admin system / vip system. But here is an example
pawn Код:
CMD:yourcommandname(playerid, params[])
{
if(IsPlayerAdmin(playerid)) // Checks if player is rcon
{
// Do something here
}
else return SendClientMessage(playerid, -1, "You are not an RCON-Administrator"); // Send the error
return 1;
}
Edit: Nevermind, didn't see "console"
Re: How to create filterscript for my own custom rcon commands -
GGW - 12.08.2014
if you want a cmd only for the rcon you have to add this :
PHP код:
if(IsPlayerAdmin(playerid))
{
// add what your cmd do here
}
Re: How to create filterscript for my own custom rcon commands -
bobsona - 12.08.2014
I have an admin system.
@GGW
I don't want command in the game, I want to connect to the server from console by rcon and to send commands to the server.
Re: How to create filterscript for my own custom rcon commands -
Stinged - 12.08.2014
He didn't say normal commands that have IsPlayerAdmin...
"Hello, I want to create few rcon commands, which I want to access through the console by rcon."
https://sampwiki.blast.hk/wiki/OnRconCommand
Use that ^
But you also can use this, which is easier:
https://sampforum.blast.hk/showthread.php?tid=88771
Re: How to create filterscript for my own custom rcon commands -
bobsona - 12.08.2014
I tried Fast rcon command processor: RCMD (modified DCMD)
But when I put that code in my gamemode, all rcon commands stop working.
Re: How to create filterscript for my own custom rcon commands -
bobsona - 13.08.2014
Any ideas for my question?