Help with spawning -
Jakwob - 16.12.2014
Hey i have a problem, i want players to spawn at hospital when the die i have tryed many ways off other help topics but none of them have worked. the problem i get is when you die, it will spawn you at the New Player spawn. heres my code
pawn Код:
new bool:NewPlayer[MAX_PLAYERS];
new bool:Death[MAX_PLAYERS];
pawn Код:
public OnPlayerSpawn(playerid)
{
if(NewPlayer[playerid] == true)
{
new rand = random(sizeof(SpawnSkins));
SetPlayerPos(playerid, 836.8863,-2064.6953,12.8672);// New Player Spawn
SetPlayerFacingAngle(playerid, 1.3629);
SetPlayerSkin(playerid, SpawnSkins[rand][0]);
NewPlayer[playerid] = false;
}
if(Death[playerid] == true)
{
SetPlayerPos(playerid, 2038.1417,-1411.3397,17.1641);//hospital spawn
SetPlayerFacingAngle(playerid, 130.9140);
Death[playerid] = false;
}
return 1;
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
GameTextForPlayer(playerid, "~r~Wasted", 5000, 2);
SendDeathMessage(killerid, playerid, reason);
pInfo[playerid][Deaths] += 1;
pInfo[killerid][Kills] += 1;
pInfo[killerid][Scores] += 1;
Death[playerid] = true;
return 1;
}
i will rep the person who can solve my problem.
Thanks in advance
Re: Help with spawning -
Ryz - 16.12.2014
i have also system like this but mine works fine
pawn Код:
public OnPlayerSpawn(playerid)
{
if(NewPlayer[playerid] == true)
{
new rand = random(sizeof(SpawnSkins));
SetPlayerPos(playerid, 836.8863,-2064.6953,12.8672);// New Player Spawn
SetPlayerFacingAngle(playerid, 1.3629);
SetPlayerSkin(playerid, SpawnSkins[rand][0]);
NewPlayer[playerid] = false;
return 1;
}
else if(Death[playerid] == true)
{
SetPlayerPos(playerid, 2038.1417,-1411.3397,17.1641);//hospital spawn
SetPlayerFacingAngle(playerid, 130.9140);
Death[playerid] = false;
return 1;
}
return 1;
}
Re: Help with spawning -
Sawalha - 16.12.2014
EDIT: the player above me solved it.
Re: Help with spawning -
Jakwob - 16.12.2014
still not working it spawns me at my New Player Location
Re: Help with spawning -
Ryz - 16.12.2014
Impossible
ok try
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
GameTextForPlayer(playerid, "~r~Wasted", 5000, 2);
SendDeathMessage(killerid, playerid, reason);
pInfo[playerid][Deaths] += 1;
pInfo[killerid][Kills] += 1;
pInfo[killerid][Scores] += 1;
Death[playerid] = true;
NewPlayer[playerid] =false;
return 1;
}
Re: Help with spawning -
Jakwob - 16.12.2014
Still not work. check for your self my ip is jakwobnr.hopto.org:7777
AW: Help with spawning -
Flori - 16.12.2014
Ops delete
AW: Help with spawning -
Flori - 16.12.2014
Make something like this: It's easier if you just use one array instead of this 2 ones.
pawn Код:
new NewOrDie[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
if(NewOrDie[playerid] == 0)
{
new rand = random(sizeof(SpawnSkins));
SetPlayerPos(playerid, 836.8863,-2064.6953,12.8672);// New Player Spawn
SetPlayerFacingAngle(playerid, 1.3629);
SetPlayerSkin(playerid, SpawnSkins[rand][0]);
NewOrDie[playerid] = 1;
}
else if(NewOrDie[playerid] == 1)
{
SetPlayerPos(playerid, 2038.1417,-1411.3397,17.1641);//hospital spawn
SetPlayerFacingAngle(playerid, 130.9140);
}
return 1;
}
Re: Help with spawning -
Arastair - 16.12.2014
This is all of it, why it doesn't work i don't know
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerPos(playerid, 2038.1417,-1411.3397,17.1641); //The Hospital
return 1;
}
Re: AW: Help with spawning -
Arastair - 16.12.2014
Florian, thats a total thing, just add that, everything will be alright