Question about DM area protection
#1

How to prevent other players entering other dm areas without using /kill ? :P
I have suggested it before, but can't find the topic

For example:
[b]I type /tdm, I get telepoted to the location. Then I want to enter Drugs DM (/drugsdm), but it says a message:
'Use /kill to leave this area'
Reply
#2

At the top of script
Код:
new bool: typedkill;
under all your DM teleport commands
Код:
if(typedkill==false) return SendClientMessage(playerid,0xffffffaa,"Please type /kill to leave this area");

if(typedkills==true)
{
 typedkill=false;
 //your DM script here
}
Your kill command:
Код:
if(!strcmp(cmdtext,"/kill",5,true)==0)
{
  SetPlayerHealth(playerid,0.0);
  typedkill=true;
  return 1;
}
That should do the trick although it can be done better.
Reply
#3

I just make a /leavedm command and re-spawn the player.
It looks something like this:

pawn Код:
if(strcmp(cmdtext, "/leavedm", true) == 0)
{
DMArea[playerid] = 0;
SpawnPlayer(playerid);
return 1;
}
Its not the same but simular
Reply
#4

That one is too complicated for me. Can it be shorter like, 'DM[MAX_PLAYERS];'
Reply
#5

Quote:
Originally Posted by MrDeGekkerd
That one is too complicated for me. Can it be shorter like, 'DM[MAX_PLAYERS];'
Which one is too complicated?
If mine then you do new DMArea[MAX_PLAYERS]; at the top
Reply
#6

Quote:
Originally Posted by Joe Torran C
Quote:
Originally Posted by MrDeGekkerd
That one is too complicated for me. Can it be shorter like, 'DM[MAX_PLAYERS];'
Which one is too complicated?
If mine then you do new DMArea[MAX_PLAYERS]; at the top
Thanks, going to try that one out
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)