Teletransportar 15 Users en diferentes posiciones
#3

pawn Код:
#define MAX_POSICIONES 14

enum Posiciones_
{
    Ocupada,
    Float:x,
    Float:y,
    Float:z,
    Float:zz
}
new Posiciones[MAX_POSICIONES][Posiciones_];

public OnGameModeInit()
{
    Posiciones[0][x] = 0.0;
    Posiciones[0][y] = 0.0;
    Posiciones[0][z] = 0.0;
    Posiciones[0][zz] = 0.0;

    Posiciones[1][x] = 0.0;
    Posiciones[1][y] = 0.0;
    Posiciones[1][z] = 0.0;
    Posiciones[1][zz] = 0.0;

    Posiciones[2][x] = 0.0;
    Posiciones[2][y] = 0.0;
    Posiciones[2][z] = 0.0;
    Posiciones[2][zz] = 0.0;
   
    // ...
   
    for (new i = 0; i<=MAX_POSICIONES; i++)
        Posiciones[i][Ocupada] = 0;
}

CMD:ir(playerid, params[])
{
    for (new i = 0; i<=MAX_POSICIONES; i++)
    {
        if (Posiciones[i][Ocupada] = 0)
        {
            SetPlayerPos(playerid, Posiciones[i][x], Posiciones[i][y], Posiciones[i][z]);
            SetPlayerFacingAngle(playerid, Posiciones[i][zz]);
            Posiciones[i][Ocupada] = 1;
            return 1;
        }
    }
    return 1;
}
Reply


Messages In This Thread
Teletransportar 15 Users en diferentes posiciones - by Metzone - 02.12.2014, 22:52
Respuesta: Teletransportar 15 Users en diferentes posiciones - by jotajeda - 02.12.2014, 23:02
Re: Teletransportar 15 Users en diferentes posiciones - by GAlvaro14 - 03.12.2014, 05:57
Re: Teletransportar 15 Users en diferentes posiciones - by Metzone - 03.12.2014, 10:46
Respuesta: Re: Teletransportar 15 Users en diferentes posiciones - by jotajeda - 03.12.2014, 15:23

Forum Jump:


Users browsing this thread: 1 Guest(s)