DM Zones
#1

Someone help to make dm zones?? I know nothing with DM Zones i just make dms :L
Reply
#2

What do you exactly want?
Reply
#3

how to make it so what when a player does like /dm it sends them to the dm and they cant do anything in the DM
Reply
#4

What do you mean? u want telewarn?
This:
Код:
//Top of on you'r script
new DMZone[MAX_PLAYERS];
#define TELEWARN 1999

//onplayercommandtext
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/mycommand", true) == 0)
	{
	if(DMZone[playerid] == 1) return ShowPlayerDialog(playerid,TELEWARN,DIALOG_STYLE_MSGBOX,"Error:","Teleporting Error!\n\n-Sorry But you can't Teleport to another area while in a dm. Type /kill to leave the DM.","Kill Me!","Cancel");
	//something here
	return 1;
	}
	if(strcmp(cmdtext, "/kill", true) == 0)
	{
	DMZone[playerid] = 0;
	SetPlayerHealth(playerid,0);
	ResetPlayerWeapons(playerid);
	return 1;
	}
	if(strcmp(cmdtext, "/leavedm", true) == 0)
	{
	DMZone[playerid] = 0;
	SetPlayerHealth(playerid,0);
	ResetPlayerWeapons(playerid);
	return 1;
	}
	return 0;
}
//ondialogresponse
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if (dialogid == TELEWARN)
		{
 		if(response == 1)
		{
		SetPlayerHealth(playerid,0);
		DMZone[playerid] = 0;
		}
    	return 1;
	}
	return 0;
 }
Reply
#5

lol no i wanted to make it so what when ever you go to the /BoatDM you cant do any command or tele or anything until you /leaveboatdm
Reply
#6

Use a variable; I recommend to use PVars.

In /boatDM and other DM commands
Код:
SetPVarInt(playerid, "InDM", true);
In /leavedm (dont use /leaveboatdm, otherwise you have alot of commands)
Код:
SetPVarInt(playerid, "InDM", false);
At the top of OnPlayerCommandText
Код:
if(GetPVarInt(playerid, "InDM")) return SendClientMessage(playerid, 0xFFFFFFFF, "You cannot use commands while you're in a deathmatch zone. Use /leavedm to exit!");
I recommend to use one variable so you have to use only one command (/leavedm) and also one check under OnPlayerCommandText.
Reply
#7

Код:
C:\Users\Charlie\Desktop\SAMP Server\gamemodes\SFTDM.pwn(571) : error 017: undefined symbol "GetPVarInt"
C:\Users\Charlie\Desktop\SAMP Server\gamemodes\SFTDM.pwn(576) : error 017: undefined symbol "SetPVarInt"
C:\Users\Charlie\Desktop\SAMP Server\gamemodes\SFTDM.pwn(583) : error 017: undefined symbol "SetPVarInt"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
what to do ryder?
Reply
#8

You are still using the old version of PAWN.

Delete all compilers and includes you have right now and download samp server again and use those includes and that compiler.
Reply
#9

ok i updated it and now i have a problem... It wont even let me /leavedm
Reply
#10

Fixed it a little, just now when i /leavedm it sends the errors message but still works
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)