Only a question
#1

Hey everyone,
i have a little and nooby question,how do i make something like this

if someone dies,his positiong is saved
pawn Код:
GetPlayerPos(playerid,x,y,z);

public Onplayerspawn(...)
{
if(PlayerInfo[playerid][pDied] == 1)
{
SetPlayerPos(playerid, x,y,z);
.
.
.
But how do i save that x,y,z?So it can be loaded on Playerspawn again?
Reply
#2

Put in the top of your GameMode/Filterscript:

pawn Код:
static Float:X[MAX_PLAYERS];  //Static Variables can save the data after a public ends.
static Float:Y[MAX_PLAYERS];
static Float:Z[MAX_PLAYERS];

Put In the OnPlayerDeath

pawn Код:
GetPlayerPos(playerid,X[playerid],Y[playerid],Z[playerid]);

Put in the OnPlayerSpawn:

pawn Код:
SetPlayerPos(playerid,X[playerid],Y[playerid],Z[playerid]);

I hope that i have helped
Reply
#3

Or, if you want to save it on disconnect, save it with Dini
Reply
#4

Quote:
Originally Posted by Mean
Посмотреть сообщение
Or, if you want to save it on disconnect, save it with Dini
I knew that,but i already made it,thx anyway


Quote:
Originally Posted by rjjj
Посмотреть сообщение
Put in the top of your GameMode/Filterscript:

pawn Код:
static Float:X[MAX_PLAYERS];  //Static Variables can save the data after a public ends.
static Float:Y[MAX_PLAYERS];
static Float:Z[MAX_PLAYERS];

Put In the OnPlayerDeath

pawn Код:
GetPlayerPos(playerid,X[playerid],Y[playerid],Z[playerid]);

Put in the OnPlayerSpawn:

pawn Код:
SetPlayerPos(playerid,X[playerid],Y[playerid],Z[playerid]);

I hope that i have helped
Thanks man,that's what i've searched for!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)