DM zone
#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


Messages In This Thread
DM zone - by martyz-lithuania - 22.10.2009, 14:10
Re: DM zone - by Correlli - 22.10.2009, 14:18
Re: DM zone - by martyz-lithuania - 22.10.2009, 20:01
Re: DM zone - by Eulfen - 22.10.2009, 20:03

Forum Jump:


Users browsing this thread: 1 Guest(s)