Spawn His Place When Died
#1

hello,

i asking what is the code to player spawn back after he die in dm
Reply
#2

...

use pawno
Reply
#3

ehm what do you mean?..
if a player dies he spawns automatically at the spawn point lol...
Reply
#4

Quote:
Originally Posted by Sascha
ehm what do you mean?..
if a player dies he spawns automatically at the spawn point lol...
Maybe he means that if you die in DM minigame, you will be spawned at the place where you entered this minigame.
AK47317, explain more about thing that you want and we'll help you
Reply
#5

hm...yea possible..in this case do:
this at the defines and so on..
Код:
enum PlayerInfo
{
Spawnx,
Spawny,
Spawnz,
Face
}
new PlayerData[MAX_PLAYERS][PlayerInfo];
then do that at OnPlayerDeath:
Код:
new Float:Coords[3];
GetPlayerPos(playerid, Coords[1], Coords[2], Coords[3]);
PlayerData[playerid][Spawnx] = Coords[1];
PlayerData[playerid][Spawny] = Coords[2];
PlayerData[playerid][Spawnz] = Coords[3];
PlayerData[playerid][Face] = GetPlayerFacingAngle(playerid);
Then: OnPlayerSpawn
Код:
SetPlayerPos(playerid, PlayerData[playerid][Spawnx], PlayerData[playerid][Spawny], PlayerData[playerid][Spawnz]);
SetPlayerFacingAngle(playerid, PlayerData[playerid][Face]);
i guess that could work.. (if you mean what Sinyavski said)...

ah and btw..please correct it, if i made a mistake:P
Reply
#6

Quote:
Originally Posted by Sascha
ah and btw..please correct it, if i made a mistake:P
Yes, you made
Код:
enum PlayerInfo
{
Float:Spawnx,//Should be Float
Float:Spawny,//Should be Float
Float:Spawnz,//Should be Float
Float:Face//Should be Float
}
new PlayerData[MAX_PLAYERS][PlayerInfo];
And here:
Код:
new Float:Coords[3];
GetPlayerPos(playerid, Coords[0], Coords[1], Coords[2]);//First coords should be with "Zero"
PlayerData[playerid][Spawnx] = Coords[0];//Zero
PlayerData[playerid][Spawny] = Coords[1];
PlayerData[playerid][Spawnz] = Coords[2];
Now someone, correct me, if i made it wrong xD
Reply
#7

well if some one get killed in dm that people spawn back in that dm if he do /exitdm he will spawn back to main world
Reply
#8

First:: ok i have found the error and i have fix it thx

Second:k there something weird when some one join and spawn the charter he go to underworld what the heck
Reply
#9

AK47317 just make a check if he is in the DM or not;

@Top
pawn Код:
new playerisindm[MAX_PLAYERS] = 0;
@OnPlayerConnect:
pawn Код:
playerisindm[playerid] = 0;
@DM Command:
pawn Код:
if(playerisindm[playerid])
{
 // Player is in dm, dont teleport him?
}
else
{
 // Teleport the player to the DM
 playerisindm[playerid] = 1;
}
@OnPlayerDeath
pawn Код:
if(playerisindm[playerid])
{
 // Spawn in DM
 SetPlayerPos(playerid, PlayerData[playerid][Spawnx], PlayerData[playerid][Spawny], PlayerData[playerid][Spawnz]);
 SetPlayerFacingAngle(playerid, PlayerData[playerid][Face]);
}
else
{
 // Spawn normally
}
Reply
#10

is it true if the code like this at OnPlayerSpawn



Код:
if(DMZone[playerid] == 0)
	{
	  SetPlayerPos(playerid, PlayerData[playerid][Spawnx], PlayerData[playerid][Spawny], PlayerData[playerid][Spawnz]);
		SetPlayerFacingAngle(playerid, PlayerData[playerid][Face]);
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)