SA-MP Forums Archive
[Pedido] Morrer e ficar no mesmo canto - 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: [Pedido] Morrer e ficar no mesmo canto (/showthread.php?tid=467795)



Morrer e ficar no mesmo canto - willttoonn - 05.10.2013

Preciso de um script que faзa com que o player morra e fique no mesmo canto.

Ou seja ele morra e de spawn no mesmo canto.


Se precisar de informaзхes da conta so pedir, o GM й em MYSQL.


Respuesta: Morrer e ficar no mesmo canto - SeV_ - 05.10.2013

Canto? No Mesmo Lugar?

Caso for.

Use:

https://sampwiki.blast.hk/wiki/GetPlayerPos

E Armazene em uma Variavel. e Quando spawnar Sete-as.


Re: Respuesta: Morrer e ficar no mesmo canto - willttoonn - 05.10.2013

Quote:
Originally Posted by _SysTeM_OFF
Посмотреть сообщение
Canto? No Mesmo Lugar?

Caso for.

Use:

https://sampwiki.blast.hk/wiki/GetPlayerPos

E Armazene em uma Variavel. e Quando spawnar Sete-as.
pawn Код:
//Topo do GM
new Float:MorreuX, Float:MorreuY, Float:MorreuZ

//Nas publics
public OnPlayerDeath(playerid, killerid, reason)
{
    GetPlayerPos(playerid, MorreuX, MorreuY, MorreuZ);
    playerinfo[playerid][pMorto] = 1;
    SpawnPlayer(playerid);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerColor(playerid, -1);
    if(playerinfo[playerid][pMorto] == 1)
    {
      SetPlayerPos(playerid, MorreuX, MorreuY, MorreuZ);
      return 1;
    }
    return 1;
}
Mesmo assim ele nгo da spawn na posiзгo onde morreu ;S


Re: Morrer e ficar no mesmo canto - Juniiro3 - 05.10.2013

Tem que ser variбvel pra cada player, pode ser array ou vetor. Tipo:

pawn Код:
new MorreuX[MAX_PLAYERS] , MorreuY[MAX_PLAYERS] , MorreuZ[MAX_PLAYERS];
Dai ao invйs de usar MorreuX usa MorreuX[playerid]


Re: Morrer e ficar no mesmo canto - willttoonn - 05.10.2013

Quote:
Originally Posted by Juniiro3
Посмотреть сообщение
Tem que ser variбvel pra cada player, pode ser array ou vetor. Tipo:

pawn Код:
new MorreuX[MAX_PLAYERS] , MorreuY[MAX_PLAYERS] , MorreuZ[MAX_PLAYERS];
Dai ao invйs de usar MorreuX usa MorreuX[playerid]
Quando eu usei isso ele deu Error de limite de World

Ai botei Float: antes e nгo funcionou.


Re: Morrer e ficar no mesmo canto - willttoonn - 05.10.2013

Alguйm? :/


Re: Morrer e ficar no mesmo canto - willttoonn - 05.10.2013

Resolvido.


Respuesta: Morrer e ficar no mesmo canto - costadd - 05.10.2013

Mais como foi resolvido.... tb quero usar....


Re: Morrer e ficar no mesmo canto - Sellen - 05.10.2013

pawn Код:
new Float:Pos[3];

public OnPlayerDeath(playerid, killerid, reason) {

    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    SpawnPlayer(playerid);
    return 1;
}
public OnPlayerSpawn(playerid) {

    SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    return 1;
}