DM Respawn![SOLVED]
#1

How can i do so when a player teleports to a DM Zone and dies there he spawns back to that DM Zone?
Reply
#2

---------- Removed ----------
Reply
#3

Use SetSpawnInfo in your dm teleport command
and reset their spawn info if they leave it with some other command
Reply
#4

Quote:
Originally Posted by McX-7[wЂstSidЂ
]
pawn Код:
OnPlayerDeath(playerid,SetPlayerPos,x,y,z); // At x,y,z put coordinates of the dm zone
What? Are you kidding? That's not even a function Plus if you set a player's position OnPlayerDeath, it will still change OnPlayerSpawn

On the top of the script:
Код:
new bool : dead[MAX_PLAYERS];
new Float: x, Float: y, Float: z;
Код:
publci OnPlayerSpawn(playerid)
{
  if(dead[playerid]==true)
  {
    SetPlayerPos(playerid,x,y,z);
    dead[playerid]=false;
  }
  return 1;
}
Код:
public OnPlayerDeath(playerid)
{
  dead[playerid]=true;
 
  GetPlayerPos(playerid,x,y,z);
  return 1;
}
Reply
#5

yeah and then is going to say
Код:
undefined symbol "dead"
Reply
#6

Can't you see
Код:
new bool: dead[MAX_PLAYERS];
Have you tested this?
Reply
#7

Quote:
Originally Posted by DJDhan
Have you tested this?
yeah and it sas
Код:
undefined symbol "dead"
Reply
#8

Well if you define at the top of the script, it shouldn't give you an error like that.
Reply
#9

No you've done a simple mistake
you got this
pawn Код:
new bool : dead[MAX_PLAYERS];
And this is how it supposed to be (Without no space between the two dots)
pawn Код:
new bool:dead[MAX_PLAYERS];
And now i got no ERRORS
Reply
#10

Код:
static gTeam[MAX_PLAYERS];


new Float:Your arena name[1][3] = {
{DM spawn kordinates}
};

public OnPlayerSpawn(playerid)
{
	if (gTeam[playerid] == 0)
	{
    new rand = random(sizeof(areaatc));
    SetPlayerPos(playerid, Arena Name[rand][0], Arena Name[rand][1], Arena name[rand][2]);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,25,100); // Guns
    GivePlayerWeapon(playerid,31,300); // Guns
    GivePlayerWeapon(playerid,16,5); // Guns
    SetPlayerColor(playerid,COLOR_GREY);
    SetPlayerTime(playerid, 12, 00);
  }

	if (strcmp(cmdtext, "/Arena name", true)==0)
	{
	  gTeam[playerid] = 1; // gTeam id

		SetPlayerPos(playerid,108.7740,1917.5236,18.5575);
    ResetPlayerWeapons(playerid);
		GivePlayerWeapon(playerid,25,100);
		GivePlayerWeapon(playerid,31,300);
		GivePlayerWeapon(playerid,16,5);
		SetPlayerColor(playerid,COLOR_BLUE);
		new pName[30];
   	GetPlayerName(playerid, pName, 30);
    format(string, 280, "%s now your arena name zone", pName);
    SendClientMessageToAll(COLOR_LIGHTBLUE, string);
		SendClientMessage(playerid,COLOR_LIGHTYELLOW,"If you wanna leave write /Leave");
		return 1;
  }


	if (strcmp(cmdtext, "/Leave", true)==0)
	{
	  gTeam[playerid] = 0;
    	SetPlayerColor(playerid,COLOR_GREEN);
    	ResetPlayerWeapons(playerid);
		SetPlayerWorldBounds(playerid, 9999.0, -9999.0, 9999.0, -9999.0);
		SpawnPlayer(playerid);
		return 1;
  }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)