Help needed.
#1

Like, if someone enters for example /minigun, it says a message: 'You need to type /dmq if youw ant to leave the dm area'
How to make that?
Reply
#2

On top of script :
pawn Код:
new DM[MAX_PLAYERS];
Under OnPlayerDeath :
pawn Код:
if(DM[playerid]==1)
{
 DM[playerid]=0;
}
Under OnPlayerCommand :
pawn Код:
if(DM[playerid]&& strcmp(cmdtext, "/dmq", true)!=0)return SendClientMessage(playerid,COLOR_RED,"ERROR : You cannot use that command while your in the DM area! /dmq to exit the DM area.");
Then put this under the command of the teleport to the DM :
pawn Код:
DM[playerid]=1;
Reply
#3

Код:
//top
new bool:InDmZone[MAX_PLAYERS];

if(!strcmp(cmdtext, "/dmz", true))
{
InDmZone[playerid] = true;
//other code here...
}
lets say they want to teleport to pk..
Код:
if(!strcmp(cmdtext,"/pk 4",true) || !strcmp(cmdtext,"/pk4",true))
{
	  if(InDmZone[playerid] == true)
    {
      GameTextForPlayer(playerid, "~y~type ~w~/kill",3000,3);
      SendClientMessage(playerid, 0xE4BC1BFF, "SERVER: YOU MUST EXIT THE DM ZONE FIRST, TYPE /KILL !!");
    }
    else
    {
    //blah blah blah
    }
    return 1;
}
if(!strcmp(cmdtext, "/kill", true))
{
    SetPlayerHealth(playerid, 0.0);
    return 1;
}
OnPlayerDeath
Код:
if(InDmZone[playerid] == true)
{
	InDmZone[playerid] = false;
	SendClientMessage(playerid, 0xFF641AFF, "You have exited the DM zone !");
}
Onplayerconnect
Код:
InDmZone[playerid] = false;
taken from my gm

any questions?

yw
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)