DM zone
#1

Hi. I decided to make new DM zone, but i don't know how to how to make if you in that zone only /exit command work.

This is teleport to DM zone:

Код:
	if(!strcmp(cmdtext,"/cr-dm",true))
  {
    SetPlayerPos(playerid,561.9404, -3516.9241, 5.5000);
    SendClientMessage(playerid, 0xFF000090, "*DM zona");
    SetPlayerVirtualWorld(playerid, 2);
    return 1;
  }
Exit command:
Код:
  if(!strcmp(cmdtext,"/exit",true))
  {
    SetPlayerPos(playerid, 397.5430, -1804.3560, 8.9000);
    SendClientMessage(playerid, 0xFF000090, " Home");
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid,0);
    return 1;
  }
Please help me
Thanks
Reply
#2

pawn Код:
new bool:myVariable[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid)
{
  myVariable[playerid] = false; // reset the variable - you could do it at OnPlayerDisconnect-callback instead at OnPlayerConnect but it will reset it anyway.
  return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/cr-dm", true))
{
  SetPlayerPos(playerid, 561.9404, -3516.9241, 5.5000);
  SendClientMessage(playerid, 0xFF000090, "*DM zona");
  SetPlayerVirtualWorld(playerid, 2);
  myVariable[playerid] = true; // set it to true.
  return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/exit", true))
{
  if(myVariable[playerid] == true) // is true?
  {
    SetPlayerPos(playerid, 397.5430, -1804.3560, 8.9000);
    SendClientMessage(playerid, 0xFF000090, " Home");
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid, 0);
    myVariable[playerid] = false; // set it to fase.
  }
  else
  {
    // msg:_can't_use_this_command_if_you're_not_in_the_zone_.
  }
  return 1;
}

Or do you mean you can use ONLY /exit from all commands?
Reply
#3

Thank you very much Very very big respect
Reply
#4

Its easy to script that file
Anyway trusted scripters are around!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)