SA-MP Forums Archive
[ajuda]player Morre em uma area - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [ajuda]player Morre em uma area (/showthread.php?tid=190180)



[ajuda]player Morre em uma area - brunogysin - 14.11.2010

Ola pessoal Bom tenho uma duvida e uma ajuda,
Quando o player Morrer nessa Cordenada a baixo como eu Faso pra ele ir pra um derteminado local quando ele morre isso eu ja sei em onplayerdeath (Augo asim)

Oq eu quero e asim eu tenho essas cordenadas a baixo de San Fierro e to querendo quando o player morre ir pra um local mais nгo sei como fazer isso Estou querendo uma ajuda (Big Help)

pawn Code:
stock IsPlayerInSanFierro(playerid)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(x >= -1377.989 && y >= -2989.536 && x <= 1599.869 && y <= -1004.297) return 1;
    else return 0;
}



AW: [ajuda]player Morre em uma area - dainius - 14.11.2010

Very very nice.


Re: [ajuda]player Morre em uma area - rjjj - 14.11.2010

Vocк pode colocar assim:

pawn Code:
//No Topo do gm :

new SanFierroPos[MAX_PLAYERS];

//Seu stock ficaria :

stock IsPlayerInSanFierro(playerid)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(x >= -1377.989 && y >= -2989.536 && x <= 1599.869 && y <= -1004.297)
    {
    SanFierroPos[playerid] = 1;
    return 1;
    }
    else
    SanFierroPos[playerid] = 0;
    return 0;
}


//No OnPlayerSpawn* adicione  :

  if(SanFierroPos[playerid] == 1)
  {
  SetPlayerPos(playerid,268.5777,1857.9351,9.8133);//Coloque sua coordenada aqui
  SanFierroPos[playerid] = 0;
  return 1;
  }

EDITADO, realmente, eu quis dizer OnPlayerSpawn ao invйs de OnPlayerDeath
__________________
//=================[Assinatura]=================//

// Ken aqui ,saca essa :

Olha sу o que eu sei sobre voce:

1. Vocк estб lendo minha assinatura.
3. Vocк nгo percebeu que eu pulei o nє 2.
4. Vocк checou isso agorinha, e estб sorrindo.
5. Vocк ainda estб lendo o que eu sei sobre voce.
6. Vocк sabe que tudo aqui escrito й verdade.
8. Vocк nгo percebeu que eu pulei o nє 7.
9. Vocк achou isso tosco e vai copiar a minha assinatura.


xD


Respuesta: Re: [ajuda]player Morre em uma area - BiieL - 14.11.2010

Quote:
Originally Posted by rjjj
View Post
Vocк pode colocar assim:

pawn Code:
//No Topo do gm :

new SanFierroPos[MAX_PLAYERS];

//Seu stock ficaria :

stock IsPlayerInSanFierro(playerid)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(x >= -1377.989 && y >= -2989.536 && x <= 1599.869 && y <= -1004.297)
    {
    SanFierroPos[playerid] = 1;
    return 1;
    }
    else return 0;
}


//No OnPlayerDeath adicione  :

  if(SanFierroPos[playerid] = 1)
  {
  SetPlayerPos(playerid,268.5777,1857.9351,9.8133);//Aqui voce coloca a sua cordenada
  SanFierroPos[playerid] = 0;
  return 1;
  }
man,

nao seria assim:

pawn Code:
//No Topo do gm :

new SanFierroPos[MAX_PLAYERS];

//Seu stock ficaria :

stock IsPlayerInSanFierro(playerid)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(x >= -1377.989 && y >= -2989.536 && x <= 1599.869 && y <= -1004.297)
    {
    SanFierroPos[playerid] = 1;
    return 1;
    }
    else return 0;
}


//isso em Spawn:

  if(SanFierroPos[playerid] = 1)
  {
  SetPlayerPos(playerid,268.5777,1857.9351,9.8133);//Aqui voce coloca a sua cordenada
  SanFierroPos[playerid] = 0;
  return 1;
  }

//no deaath vai o IsPlayerInSanFierro q dai ativa o SanFierroPos[playerid]
acho q tu nao deveria ter usado o SanFierroPos[playerid] na stock e sim no death


Re: [ajuda]player Morre em uma area - ipsBruno - 14.11.2010

pawn Code:
//em onplayerspawn

if(GertPVarInt(playerid,"SanFiero") == 10)
{
     SetPlayerPos(playerid,x,y,z); //coordendas aqui
     SetPVarInt(playerid,"SanFiero",0);
}

//em onplayerdeath

if(IsPlayerInSanFierro(playerid))
     SetPVarInt(playerid,"SanFiero",10);

//final gamemode

stock IsPlayerInSanFierro(playerid)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(x >= -1377.989 && y >= -2989.536 && x <= 1599.869 && y <= -1004.297) return 1;
    else return 0;
}