Death system.
#1

------
Reply
#2

I do it like this:

pawn Код:
enum PlayerInfo
{
//playerinfo stuff
    Float:CurX,
    Float:CurY,
    Float:CurZ,
//blabla
}
I use those 3 to store a temporary position whenever I need to
->
pawn Код:
OnPlayerDeath(..
{
GetPlayerPos((playerid), PInfo[id][CurX], PInfo[id][CurY], PInfo[id][CurZ]);
return 1;
}

//Then
OnPlayerSpawn(...
{
SetPlayerPos(id, PInfo[id][CurX], PInfo[id][CurY], PInfo[id][CurZ]);
return 1;
}
Something like this?
Reply
#3

try that:

Код:
public OnPlayerSpawn(playerid)
{
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(killerid, slx, sly, slz);
SetPlayerPos(playerid, slx, sly, slz);
return 1;
}
Reply
#4

------
Reply
#5

SOrry you'll get erros, I forgot to adjust it (I just copied from my script
do this:
pawn Код:
OnPlayerDeath(..
{
GetPlayerPos((playerid), PInfo[playerid][CurX], PInfo[playerid][CurY], PInfo[playerid][CurZ]);
return 1;
}

//Then
OnPlayerSpawn(...
{
SetPlayerPos(playerid, PInfo[playerid][CurX], PInfo[playerid][CurY], PInfo[playerid][CurZ]);
return 1;
}
Reply
#6

pawn Код:
enum PlayerInfo
{
//playerinfo stuff
    Float:CurX,
    Float:CurY,
    Float:CurZ,
//blabla
}
new bool:pKilled[MAX_PLAYERS];
OnPlayerConnect(..
{
    pKilled[playerid] = false;
    return 1;
}

OnPlayerDeath(..
{
GetPlayerPos(playerid, PInfo[playerid][CurX], PInfo[playerid][CurY], PInfo[playerid][CurZ]);
pKilled[playerid] = true;
return 1;
}

//Then
OnPlayerSpawn(...
{
if(pKilled[playerid] == true)
{
     SetPlayerPos(playerid, PInfo[playerid][CurX], PInfo[playerid][CurY], PInfo[playerid][CurZ]);
     pKilled[playerid] = false;
}
return 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)