Only a question - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Only a question (
/showthread.php?tid=197296)
Only a question -
SkizzoTrick - 08.12.2010
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?
Re: Only a question - rjjj - 08.12.2010
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
Re: Only a question -
Mean - 08.12.2010
Or, if you want to save it on disconnect, save it with Dini
Re: Only a question -
SkizzoTrick - 08.12.2010
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!