[SOLVED]/exit dm
#1

Hello, I've searched but couldn't find the right thing..I have DM zones and they disable the commands when players enter them, but there is no other way to leave them unless you die, Would there be a way to exit them ex: /exit allowing that command but the commands are disabled?
Reply
#2

Use a command like this

Код:
  if (strcmp("/exit", cmdtext, true, 10) == 0) {

//SETS THEIR POS SOMEWHERE, or where ever you want them to teleport back to. this is just an example.

      SetPlayerPos(playerid,2352.0007,-1168.8942,27.9879);
      SetPlayerInterior(playerid, 0);
      return 1;
    }
Reply
#3

Quote:
Originally Posted by Pinny
Use a command like this

Код:
  if (strcmp("/exit", cmdtext, true, 10) == 0) {

//SETS THEIR POS SOMEWHERE, or where ever you want them to teleport back to. this is just an example.

      SetPlayerPos(playerid,2352.0007,-1168.8942,27.9879);
      SetPlayerInterior(playerid, 0);
      return 1;
    }
That wont work, because the commands are disabled when they are in a /dm, How can i make it so if there in a dm zone "PlayerData[playerid][InDM] = 1;" they can only use /exit?

--edit: I figured it out, it had to be like this:
Код:
if(strcmp("/exit", cmdtext, true, 10) == 0)
  {
  if(PlayerData[playerid][InDM] == 1)
  return 1;
  {
  TogglePlayerControllable(playerid,true);
  SetCameraBehindPlayer(playerid);
  SpawnPlayer(playerid);
  PlayerData[playerid][InDM] = 0;
  SendClientMessage(playerid,COLOR_YELLOW,"You have left the death match");
  return 0;
  }
  }
thanks guys
Reply
#4

here command exit dm

if (strcmp("/exit", cmdtext, true, 10) == 0) {

SetPlayerPos(playerid,2352.0007,-1168.8942,27.9879);
SetPlayerInterior(playerid, 0);
PlayerData[playerid][InDM] = 0;
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)