[Pedido] Sistema Fodгo!
#7

pawn Код:
new Conta[MAX_PLAYERS][DATA];
enum Data
{
    Float:saved_armour,
    Float:saved_health,
    Float:saved_X,      
    Float:saved_Y,      
    Float:saved_Z,      
    Float:saved_ang,
    saved_int
}

OnPlayerCommandText
{
if (strcmp(cmd, "/x1", true) == 0)
{
    SavePlayerData(playerid);
}
if (strcmp(cmd, "/sair", true) == 0)
{
    LoadPlayerData(playerid);
}
}

forward public SavePlayerData(playerid);
public SavePlayerData(playerid)
{
    new Float: health, Float: armour, Float: SX, Float: SY, Float: SZ, Float:ang;
    GetPlayerHealth(playerid, health);
    GetPlayerArmour(playerid, armour);
    GetPlayerPos(playerid, SX, SY, SZ);
    GetPlayerFacingAngle(playerid, ang);
    //
    Conta[playerid][saved_money] = GetPlayerMoney(playerid);
    Conta[playerid][saved_skin] = GetPlayerSkin(playerid);
    Conta[playerid][saved_health] = health;
    if (armour > 0) Conta[playerid][saved_armour] = armour;
    Conta[playerid][saved_X] = SX;
    Conta[playerid][saved_Y] = SY;
    Conta[playerid][saved_Z] = SZ;
    Conta[playerid][saved_ang] = ang;
    Conta[playerid][saved_int] = GetPlayerInterior(playerid);
}
forward public LoadPlayerData(playerid);
public LoadPlayerData(playerid)
{
    SetPlayerHealth(playerid, Conta[playerid][saved_health]);
    if (Conta[playerid][saved_armour] > 0) SetPlayerArmour(playerid, Conta[playerid][saved_armour]);
    GivePlayerMoney(playerid, Conta[playerid][saved_money]-GetPlayerMoney(playerid));
    SetPlayerSkin(playerid, Conta[playerid][saved_skin]);
    SetPlayerPos(playerid, Conta[playerid][saved_X], Conta[playerid][saved_Y], Conta[playerid][saved_Z]);
    SetPlayerFacingAngle(playerid, Conta[playerid][saved_ang]);
    SetPlayerInterior(playerid, Conta[playerid][saved_int]);
}
Mais de mгo beijada do que isso, impossible
Reply


Messages In This Thread
[Pedido] Sistema Fodгo! - by marcos5680 - 30.08.2011, 18:12
Re: [Pedido] Sistema Fodгo! - by Bruno Pereira - 30.08.2011, 18:15
Re: [Pedido] Sistema Fodгo! - by Shadoww5 - 30.08.2011, 18:21
Re: [Pedido] Sistema Fodгo! - by JonathanFeitosa - 30.08.2011, 18:22
Respuesta: Re: [Pedido] Sistema Fodгo! - by marcos5680 - 30.08.2011, 19:57
Respuesta: [Pedido] Sistema Fodгo! - by marcos5680 - 30.08.2011, 21:52
Re: [Pedido] Sistema Fodгo! - by trollv - 30.08.2011, 23:38
Re: [Pedido] Sistema Fodгo! - by [BEP]AcerPilot - 30.08.2011, 23:41
Re: [Pedido] Sistema Fodгo! - by trollv - 30.08.2011, 23:47
Re: [Pedido] Sistema Fodгo! - by [BEP]AcerPilot - 30.08.2011, 23:48
Re: [Pedido] Sistema Fodгo! - by dPlaYer_ - 31.08.2011, 17:46
Respuesta: Re: [Pedido] Sistema Fodгo! - by marcos5680 - 31.08.2011, 21:39
Re: [Pedido] Sistema Fodгo! - by trollv - 01.09.2011, 01:02
Re: [Pedido] Sistema Fodгo! - by [S]trong - 01.09.2011, 01:05
Respuesta: Re: [Pedido] Sistema Fodгo! - by marcos5680 - 01.09.2011, 16:16
Re: [Pedido] Sistema Fodгo! - by Dolby - 01.09.2011, 23:49
Re: [Pedido] Sistema Fodгo! - by [R] ousenber [K] - 01.09.2011, 23:51
Respuesta: Re: [Pedido] Sistema Fodгo! - by marcos5680 - 02.09.2011, 16:24
Respuesta: [Pedido] Sistema Fodгo! - by marcos5680 - 02.09.2011, 19:15
Respuesta: [Pedido] Sistema Fodгo! - by marcos5680 - 05.09.2011, 16:40

Forum Jump:


Users browsing this thread: 3 Guest(s)