[Solved]
#1

Here's My Code:

pawn Код:
if(SpawnX[playerid] != 0.0 && SpawnY[playerid] != 0.0 && SpawnZ[playerid] != 0.0)
SetPlayerPos(playerid, SpawnX[playerid], SpawnY[playerid], SpawnZ[playerid]);
Now I want to turn that into this:

pawn Код:
SetPlayerCheckpoint(i, SpawnX[deadplayer], SpawnY[deadplayer], SpawnZ[deadplayer]);
Reply
#2

You're trying to get where someone spawned and set that as a checkpoint for another player?
Reply
#3

Yes.
Reply
#4

The trick is, getting something to go in-place for the SetPlayerCheckpoint(playerid...);

Because it's not a command to set the checkpoint.
Reply
#5

Are you trying to do it if Player_A killed Player_B, so now Player_A gets the checkpoint?
Reply
#6

A Player dies, and a medic automatically gets the checkpoint.
Reply
#7

Okay.
pawn Код:
//top of script after #include <a_samp> and before main()
new HasDied[MAX_PLAYERS];

//This is to make sure they have died and not just entered the server
public OnPlayerDeath(playerid, reason)
{
  HasDied[playerid] = 1;
  return 1;
}

public OnPlayerSpawn(playerid)
{
  if(HasDied[playerid] == 1)
  {
   new Float:X, Float:Y, Float:Z;
   GetPlayerPos(playerid, X, Y, Z);
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
     if(IsMedic[i] == 1) //your variable to check if the player is a medic
     {
      SetPlayerCheckPoint(i, X, Y, Z, 5);
     }
   }
  }
  return 1;
}
Reply
#8

Thank you,
you have guided me, and it now works,

With a few modifications of course.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)