[Only works for id 0]
#1

pawn Код:
public HeightCheck(playerid)
{
  new Float:x, Float:y, Float:z;
  for(new i = 0; i < GetMaxPlayers(); i++)
    {
        GetPlayerPos(playerid,x,y,z);
        if(z < 90)
        {
         SetPlayerHealth(playerid,0.0);
        }
    }
    return 1;
}
Why does that only work for id 0 ?
And also when i spawn for the first time i die and after that its all good.

Reaver~
Reply
#2

pawn Код:
public HeightCheck()
{
    new Float:x, Float:y, Float:z;
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        GetPlayerPos(i,x,y,z);
        if(z < 90)
        {
            SetPlayerHealth(i,0.0);
        }
    }
    return 1;
}
Reply
#3

Try this:
Код:
public HeightCheck(playerid)
{
  new Float:x, Float:y, Float:z;
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    GetPlayerPos(i,x,y,z);
    if(z < 90)
    {
      SetPlayerHealth(i,0.0);
    }
  }
  return 1;
}
And as for the dying when you spawn, well your probably spawning somewhere in an interior, all interior floors are way up in the air... So your most likely above the 90 z limit. Try changing your spawning point to somewhere else or raising your z limit cuz this is gonna kill you every time you enter an interior because you will be way above 90 z when your inside one.
Reply
#4

Quote:
Originally Posted by SuperS82
Try this:
Код:
public HeightCheck(playerid)
{
  new Float:x, Float:y, Float:z;
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    GetPlayerPos(i,x,y,z);
    if(z < 90)
    {
      SetPlayerHealth(i,0.0);
    }
  }
  return 1;
}
And as for the dying when you spawn, well your probably spawning somewhere in an interior, all interior floors are way up in the air... So your most likely above the 90 z limit. Try changing your spawning point to somewhere else or raising your z limit cuz this is gonna kill you every time you enter an interior because you will be way above 90 z when your inside one.
I dont spawn in a interior its on a roof in LV.
And Mademan's way worked already.

Reaver~
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)