SA-MP Forums Archive
DM Zones - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: DM Zones (/showthread.php?tid=159411)



DM Zones - willsuckformoney - 13.07.2010

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


Re: DM Zones - wups - 13.07.2010

What do you exactly want?


Re: DM Zones - willsuckformoney - 13.07.2010

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


Re: DM Zones - hab2ever - 13.07.2010

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;
 }



Re: DM Zones - willsuckformoney - 13.07.2010

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


Re: DM Zones - RyDeR` - 13.07.2010

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.


Re: DM Zones - willsuckformoney - 13.07.2010

Код:
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?


Re: DM Zones - RyDeR` - 13.07.2010

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.


Re: DM Zones - willsuckformoney - 13.07.2010

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


Re: DM Zones - willsuckformoney - 13.07.2010

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