
Just type ingame /rcon login [password] (Your password is in server.cfg => rcon_password).
#include <a_samp>
#include <zcmd>
#include <sscanf2>

#define COLOR_RED 0xFF0000C8
#define COLOR_WHITE 0xFFFFFFC8
#define COLOR_YELLOW 0xDFF709C8
#define COLOR_GREEN 0x09F709C8
#define COLOR_BLUE 0x0000FFC8
stock GetName(playerid)
{
new
name[24];
GetPlayerName(playerid, name, sizeof(name));
return name;
}

CMD:kick(playerid, params[]);
{
new targetid;
new reason[50];
new string[200];
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You aren't an Rcon Admin!");
if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, COLOR_RED, "[ERROR]: This player is not Connected!");
if(sscanf(params, "us[50]", targetid, reason))return SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /kick [Playerid] [Reason]");
format(string, sizeof(string), "[ADMIN]: Administrator %s(ID:%d) has kicked %s(ID:%d)! [Reason: %s]", GetName(playerid), playerid, GetName(targetid), targetid, reason);
SendClientMessageToAll(COLOR_YELLOW, string);
Kick(targetid);
return 1;
}

new targetid;
new reason[50];
new string[200];
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You aren't an Rcon Admin!");
if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, COLOR_RED, "[ERROR]: This player is not Connected!");
if(sscanf(params, "us[50]", targetid, reason))return SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /kick [Playerid] [Reason]");
format(string, sizeof(string), "[ADMIN]: Administrator %s(ID:%d) has kicked %s(ID:%d)! [Reason: %s]", GetName(playerid), playerid, GetName(targetid), targetid, reason);
SendClientMessageToAll(COLOR_YELLOW, string);
Kick(targetid);


CMD:explode(playerid, params[])
{
new string[200], targetid, Float:x, Float:y, Float:z;
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You aren't an Rcon Admin!");
if(sscanf(params, "u", targetid))return SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /explode [Playerid]");
if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, COLOR_RED, "[ERROR]: This player is not connected!");
GetPlayerPos(targetid, x, y, z);
CreateExplosion(x, y, z, 12, 10.0);
format(string,sizeof(string), "[ADMIN]: Administrator %s(ID:%d) has Exploded %s(ID:%d)!", GetName(playerid), playerid GetName(targetid), targetid);
SendClientMessage(playerid, COLOR_PURPLE, string);
return 1;
}

new string[200], targetid, Float:x, Float:y, Float:z;
, Float:y, Float:z => we will use this to get the player's position" and "string => we will use this to send a message to all players that we exploded someone".if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You aren't an Rcon Admin!");
if(sscanf(params, "u", targetid))return SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /explode [Playerid]");
if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, COLOR_RED, "[ERROR]: This player is not connected!");
GetPlayerPos(targetid, x, y, z);
CreateExplosion(x, y, z, 12, 10.0);
format(string,sizeof(string), "[ADMIN]: Administrator %s(ID:%d) has Exploded %s(ID:%d)!", GetName(playerid), playerid GetName(targetid), targetid);
SendClientMessageToAll(playerid, COLOR_YELLOW, string);

/announce [text]CMD:announce(playerid, params[])
{
new text[60];
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You aren't an Rcon Admin!");
if(sscanf(params,"s[60]",text))return SendClientMessage(playerid, COLOR_GREY, "[USAGE]: /announce [Text]");
GameTextForAll(text, 3000, 5);
return 1;
}

new text[60];
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You aren't an Rcon Admin!");
if(sscanf(params,"s[60]",text))return SendClientMessage(playerid, COLOR_GREY, "[USAGE]: /announce [Text]");
GameTextForAll(text, 3000, 5);

I hope you guys like this tutorial

|
Nice tutorial.
![]() You Explained these things very detail and easy to understand ![]() Keep it up |
|
-rep because fake one
Reason: Rcon Have Already Commands here : https://sampwiki.blast.hk/wiki/RCON#RCON_Commands that will show all cmds or go In Game and do /rcon login (your rcon pass) then /rcon cmdlist Done! will show u a list of cmds |
if(pInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You aren't an Admin level 1");
|
-rep because fake one
Reason: Rcon Have Already Commands here : https://sampwiki.blast.hk/wiki/RCON#RCON_Commands that will show all cmds or go In Game and do /rcon login (your rcon pass) then /rcon cmdlist Done! will show u a list of cmds |
|
nice tutorial, thanks
![]() but i still don't understand what /explode does ?? ![]() |