[Pedido] /Continuar
#5

pawn Код:
#include <a_samp>
#include <dini>

new
    JogadorBloqueado[MAX_PLAYERS],
    Jogador[MAX_PLAYER_NAME],
    FLoat: kX[MAX_PLAYERS],
    FLoat: kY[MAX_PLAYERS],
    Float: kZ[MAX_PLAYERS],
    Float: kA[MAX_PLAYERS],
    sStringFrm[128];


public OnPlayerDisconnect(playerid, reason)
{
    GetPlayerName(playerid, Jogador, sizeof(Jogador));
    GetPlayerPos(playerid, kX[playerid], kY[playerid], kZ[playerid]);
    GetPlayerFacingAngle(playerid, kA[playerid]);

    format(sStringFrm, sizeof(sStringFrm), "%s.spawn.ini", Jogador);
    dini_FloatSet(sStringFrm, "cX", kX[playerid]);
    dini_FloatSet(sStringFrm, "cY", kY[playerid]);
    dini_FloatSet(sStringFrm, "cZ", kZ[playerid]);
    dini_FloatSet(sStringFrm, "cA", kA[playerid]);

    return true;
}

public OnPlayerConnect(playerid)
    return JogadorBloqueado[playerid] = 0;


public OnPlayerSpawn(playerid)
{
    GetPlayerName(playerid, Jogador, sizeof(Jogador));
    format(sStringFrm, sizeof(sStringFrm), "%s.spawn.ini", Jogador);
    if(fexist(sStringFrm) && JogadorBloqueadoplayerid] == 0)
    {
        kX[playerid] = dini_Float(sStringFrm,"cX");
        kY[playerid] = dini_Float(sStringFrm,"cY");
        kZ[playerid] = dini_Float(sStringFrm,"cZ");
        kA[playerid] = dini_Float(sStringFrm,"cA");

        SetPlayerPos(playerid, kX[playerid],  kY[playerid], kZ[playerid]);
        SetPlayerFacingAngle(playerid, kA[playerid]);
        SetCameraBehindPlayer(playerid);

        JogadorBloqueado[playerid] = 1;
    }
    if(!fexist(sStringFrm))
    {
        dini_Create(sStringFrm);
        JogadorBloquado[playerid] = 1;
    }
    return true;
}
Reply


Messages In This Thread
/Continuar - by clerISoN - 03.07.2013, 16:08
Re: /Continuar - by iCracker - 03.07.2013, 16:23
Re: /Continuar - by clerISoN - 03.07.2013, 16:29
Re: /Continuar - by ProKillerpa - 03.07.2013, 16:36
Re: /Continuar - by Knight97 - 03.07.2013, 17:36
Re: /Continuar - by Mateus_. - 07.07.2013, 20:54

Forum Jump:


Users browsing this thread: 1 Guest(s)