HELP disableing teleports when in DM zones
#1

as the title suggests i need help

ok i have made 5 DM zones, each with its own virtual world

i tried using AllowPlayerTeleport(playerid, 0)

but then he/she won be able to exit the dm!

please help!
Reply
#2

pawn Код:
new IsPlayerInDM[MAX_PLAYERS];

/*when player goes to dm*/
IsPlayerInDM[playerid] = 1;

public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/exitdm"))
  {
    IsPlayerInDM[playerid] = 0;
    SetPlayerPos(playerid, outside of dm);
  }
 
  if(IsPlayerInDM[playerid] != 0) return SendClientMessage(playerid, COLOR_RED, "Sorry, you can't use commands while in a dm zone. Type /exitdm to leave it");

  /*your other commands*/
}
Reply
#3

Quote:
Originally Posted by dice7
pawn Код:
new IsPlayerInDM[MAX_PLAYERS];

/*when player goes to dm*/
IsPlayerInDM[playerid] = 1;

public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/exitdm"))
  {
    IsPlayerInDM[playerid] = 0;
    SetPlayerPos(playerid, outside of dm);
  }
 
  if(IsPlayerInDM[playerid] != 0) return SendClientMessage(playerid, COLOR_RED, "Sorry, you can't use commands while in a dm zone. Type /exitdm to leave it");

  /*your other commands*/
}
lol thanks for the reply, but it didnt work

any other suggestions?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)