Only RCON
#1

Did try to make this 2 command only rcon but failed can someone make that for me?

/gmx
Код:
CMD:gmx(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 99999) {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use this command.");
        return 1;
    }

    SetTimer( "Maintenance", 50000, false );
    SendClientMessageToAll(COLOR_LIGHTBLUE, "* The Server Will Be Going For Server Maintenance In 50Seconds.");
    foreach(Player, i) {
        GameTextForPlayer(i, "~y~Scheduled Maintenance 50Seconds", 5000, 3);
    }
    return 1;
}
/restart
Код:
CMD:restart(playerid, params[])
{
 	if(IsPlayerConnected(playerid)) {
  if(PlayerInfo[playerid][pAdmin] >= 1337) {
	restarting = 1;
			GameModeInitExitFunc();
		} else {
			SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command !");
		}
	}
	return 1;
}
Reply
#2

pawn Код:
SendRconCommand( "gmx" );
gmx = restart
It's the same thing, no need for 2 different commands.
Reply
#3

just add
pawn Код:
SendRconCommand("gmx");
https://sampwiki.blast.hk/wiki/Advanced_Server_Controls
Reply
#4

pawn Код:
CMD:restart(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1337)
        return SendClientMessage(playerid, -1, "You are not an admin!");
       
    SendRconCommand( "gmx" );

    return 1;
}
Reply
#5

Quote:
Originally Posted by FunnyBear
Посмотреть сообщение
pawn Код:
CMD:restart(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1337)
        return SendClientMessage(playerid, -1, "You are not an admin!");
       
    SendRconCommand( "gmx" );

    return 1;
}
Dindnt work
Reply
#6

Add this:

Код:
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be logged into RCON to use this command.");
Reply
#7

Код:
CMD:gmx(playerid, params[])
{
    	if(IsPlayerAdmin(playerid)) {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use this command.");
        return 1;
    }

    SetTimer( "Maintenance", 50000, false );
    SendClientMessageToAll(COLOR_LIGHTBLUE, "* The Server Will Be Going For Server Maintenance In 50Seconds.");
    foreach(Player, i) {
        GameTextForPlayer(i, "~y~Scheduled Maintenance 50Seconds", 5000, 3);
    }
    return 1;
}
Код:
CMD:restart(playerid, params[])
{
 	if(IsPlayerConnected(playerid)) {
	if(IsPlayerAdmin(playerid)) {
	restarting = 1;
			GameModeInitExitFunc();
		} else {
			SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command !");
		}
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)