Vice City Multiplayer

General Discussion => General Discussion => Topic started by: Arber on November 28, 2012, 01:31:03 am

Title: How to disable example: "/goto name"
Post by: Arber on November 28, 2012, 01:31:03 am
How to disable example: "/goto name" ??
thanks for read
Title: Re: How to disable example: "/goto name"
Post by: sseebbyy on November 28, 2012, 01:42:41 am
How to disable example: "/goto name" ??
thanks for read

You can't disable a rcon command, but is protected by rcon pass.

From what we know, you have to be RCON Admin to can use "/goto" command.
Title: Re: How to disable example: "/goto name"
Post by: Arber on November 28, 2012, 03:11:01 pm
No, i'm not admin on server and i can use /goto command and other commands
Title: Re: How to disable example: "/goto name"
Post by: sseebbyy on November 28, 2012, 03:44:53 pm
No, i'm not admin on server and i can use /goto command and other commands

You can't use /goto command if you aren't RCON Administrator !

If the owner of server made a cmd like " !goto " or "/c goto" for all players, thats anything else.

RCON Administrator is that player what type in the chat "/admin <password>"
Title: Re: How to disable example: "/goto name"
Post by: VS on November 29, 2012, 06:12:31 pm
[pawn]

new nogoto[MAX_PLAYERS]

public OnPlayerCommandText(playerid, cmdtext[])
{
        new tmp[256];
   if (strcmp("nogoto", cmd, true, 10) == 0)
   {
        tmp = strtok(cmdtext, idx);
        if(nogoto[playerid] == 0)
        {
            nogoto[playerid] = 1;
            SendClientMessage(playerid, red, "You are no longer accepting goto warps.");
        }
        else
        {
            nogoto[playerid] = 0;
            SendClientMessage(playerid, lgr, "You are now accepting goto warps.");
        }
      return 1;
   }
   if (strcmp("goto", cmd, true, 10) == 0)
   {
      tmp = strtok( cmdtext, idx );
        if (!strlen(tmp))
      {
       SendClientMessage(playerid, lgr, " /c goto [ID]");
       return true;
      }

      new ID = strval(tmp);

        if(nogoto[playerid] == 1) return SendClientMessage(playerid, red, "Sorry that player has goto disabled");

      if (!IsPlayerConnected(ID))
      {
          SendClientMessage(playerid, 0xFFFFFFAA, " Invalid Player");
          format( tmp, 128, "%s > Error < that > Player < isn't in the data base", Name[playerid]), SendClientMessage(playerid, red, tmp);
          return true;
      }

        new Float:X, Float:Y, Float:Z;

      if ( GetPlayerVehicleID( playerid ) )
       {
          GetPlayerPos( strval(tmp), X, Y, Z );
            SetVehiclePos( GetPlayerVehicleID(playerid), X+2, Y+2, Z ,0);
           GetPlayerName(ID, tmp, 128);
         format(tmp, 128, "Teleported to (Player - %s, id - %d)", tmp, ID);
         SendClientMessage(playerid, 0xFFFFFFAA, tmp);
         
         format( tmp, 128, "Teleport to > %s < ID > %d <", tmp, ID), SendClientMessage(playerid, red, tmp);
         
      }else{
           GetPlayerPos( strval(tmp), X, Y, Z );
           SetPlayerPos( playerid, X+2, Y+2, Z ,0 ,0);
             GetPlayerName(ID, tmp, 128);

           format( tmp, 128, "Teleport to > %s < ID > %d <", tmp, ID), SendClientMessage(playerid, red, tmp);

      }
      return 1;
   }
}

[/pawn]