Player spawn at the same place after death.. HELP!
#1

Hello there!
I'm modifying a zombie gamemode and there's the zombie spawn and the human spawn. The zombie spawn works perfectly, it spawn at its choosen coordinates. The human spawn just spawn at the same place, and the line of coding are pretty much the same.. I'd like to put a spawn of humans at certain coordinates like the zombie spawn does, so, they'll spawn at hidden places or something..

There's the line of coding of OnPlayerSpawn and of the OnPlayerDeath:

http://pastebin.com/PCYYKzge


Thanks!
Reply
#2

The last two spawns have the same coords

You have to change one of it wherever you like and wherever want to spawn
Reply
#3

Well, I did that and the human class keeps spawning at the same place where he dies instead of the choosen coords. The zombie spawn does spawn in the choosen coords when the zombie player dies. Is there anything wrong or something to fix the human spawn?
Reply
#4

maybe because of this onplayerdeath?
pawn Код:
GetPlayerPos(playerid,positionx,positiony,positionz);
    JugadorInfo[playerid][jPos_x] = positionx;
        JugadorInfo[playerid][jPos_y] = positiony;
        JugadorInfo[playerid][jPos_z] = positionz;
maybe delete it?
Reply
#5

pawn Код:
else if(JugadorInfo[playerid][jInfectado] == 0 && JugadorInfo[playerid][jZombie] == 0)
                {
as you can see and as i think jinfectado = if inficted == 0, and if he is not a zombie ,
that what will happen:
pawn Код:
SafeSetPlayerPos(playerid,JugadorInfo[playerid][jPos_x],JugadorInfo[playerid][jPos_y],JugadorInfo[playerid][jPos_z]);
so i think that u need to delete it, am i right?
Reply
#6

Well, i've deleted that :

GetPlayerPos(playerid,positionx,positiony,position z);
JugadorInfo[playerid][jPos_x] = positionx;
JugadorInfo[playerid][jPos_y] = positiony;
JugadorInfo[playerid][jPos_z] = positionz;

and it gave me 3 new warnings after compiling. I've tested it in-game and when you die it spawns you at the default coord, between las venturas and los santos, in a town. It's the 0,0,0 one i believe.
Reply
#7

public SafeSetPlayerPos(playerid, Float, Float:y, Float:z)
{
SetPlayerPos(playerid, x,y,z);
return 1;
}


There's the public SafeSetPlayerPos btw. Do i have to change anything on it?
Reply
#8

By the way, there's three type of spawn i believe. When you are human, when you are zombie and when you are infected.
Reply
#9

at each
which_spawn
type this:
pawn Код:
JugadorInfo[playerid][jPos_x] = positionx;
        JugadorInfo[playerid][jPos_y] = positiony;
        JugadorInfo[playerid][jPos_z] = positionz;
but edit the positionx with the x of setplayerpos in each which_spawn and the y of setplayerpos in each which_spawn and z of setplayerpos in each which_spawn and make sure you only did it for ehumano only
Reply
#10

Its working! Thank you so much, man! I'll tell you later if i'll get any problem with it again, ahaha!
Have a nice weekend! :b
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)