Solved.
#1

Basically, I want this.

When you die, the Exact positon (x,y,z) is recorded.

When you spawn you spawn in this position.

Possible?
Reply
#2

pawn Код:
new Float:SpawnX[MAX_PLAYERS];
new Float:SpawnY[MAX_PLAYERS];
new Float:SpawnZ[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    SpawnX[MAX_PLAYERS] = 0.0;
    SpawnY[MAX_PLAYERS] = 0.0;
    SpawnZ[MAX_PLAYERS] = 0.0;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    GetPlayerPos(playerid, SpawnX[playerid], SpawnY[playerid], SpawnZ[playerid]);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(SpawnX[playerid] != 0.0 && SpawnY[playerid] != 0.0 && SpawnZ[playerid] != 0.0)
        SetPlayerPos(playerid, SpawnX[playerid], SpawnY[playerid], SpawnZ[playerid]);
    return 1;
}
Reply
#3

Thanks for the Reply, it indeed has helped me.

1 Problem with what you recommended.


pawn Код:
error 032: array index out of bounds (variable "SpawnX")
 error 032: array index out of bounds (variable "SpawnY")
 error 032: array index out of bounds (variable "SpawnZ")
Reply
#4

Код:
public OnPlayerConnect(playerid)
{
	SpawnX[playerid] = 0.0;
	SpawnY[playerid] = 0.0;
	SpawnZ[playerid] = 0.0;
}
Forgot to change max_players to playerid
Reply
#5

Solved! Compiled and everything.
I will let you know how it works out.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)