Progressbar
#3

їPor quй me hace crashear del servidor?
pawn Код:
new Bar:HambreJ[MAX_PLAYERS] = {INVALID_BAR_ID, ...};
forward Hambre();

public Hambre()
{
    foreach(Player, playerid)
    {
        SetProgressBarValue(HambreJ[playerid], -5.0);
        UpdateProgressBar(HambreJ[playerid], playerid);
    }
}

public OnGameModeInit()
{
    SetTimer("Hambre", 50000, 1);
        return 1;
}

public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    if(playertextid == Textdraw20[playerid])
    {
        PlayerTextDrawHide(playerid, Textdraw0[playerid]);
        PlayerTextDrawHide(playerid, Textdraw1[playerid]);
        PlayerTextDrawHide(playerid, Textdraw2[playerid]);
        PlayerTextDrawHide(playerid, Textdraw3[playerid]);
        PlayerTextDrawHide(playerid, Textdraw4[playerid]);
        PlayerTextDrawHide(playerid, Textdraw5[playerid]);
        PlayerTextDrawHide(playerid, Textdraw6[playerid]);
        PlayerTextDrawHide(playerid, Textdraw7[playerid]);
        PlayerTextDrawHide(playerid, Textdraw8[playerid]);
        PlayerTextDrawHide(playerid, Textdraw9[playerid]);
        PlayerTextDrawHide(playerid, Textdraw10[playerid]);
        PlayerTextDrawHide(playerid, Textdraw11[playerid]);
        PlayerTextDrawHide(playerid, Textdraw12[playerid]);
        PlayerTextDrawHide(playerid, Textdraw13[playerid]);
        PlayerTextDrawHide(playerid, Textdraw14[playerid]);
        PlayerTextDrawHide(playerid, Textdraw15[playerid]);
        PlayerTextDrawHide(playerid, Textdraw16[playerid]);
        PlayerTextDrawHide(playerid, Textdraw17[playerid]);
        PlayerTextDrawHide(playerid, Textdraw18[playerid]);
        PlayerTextDrawHide(playerid, Textdraw19[playerid]);
        PlayerTextDrawHide(playerid, Textdraw20[playerid]);
        CancelSelectTextDraw(playerid);
    }
    else if(playertextid == Textdraw6[playerid])
    {
        SetProgressBarValue(HambreJ[playerid], 20.0);
        UpdateProgressBar(HambreJ[playerid], playerid);
        Informacion[playerid][pPizza] -= 1;
        ApplyAnimation(playerid,"FOOD","EAT_Burger",4.1,0,1,1,0,0,0);
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        new npcname[24];
        GetPlayerName(playerid, npcname, 24);
        if(!strcmp(npcname, "Ricardo", true))
        {
            SetPlayerSkin(playerid, 111);
        }
        return 1;
    }

    if(GetPVarInt(playerid, "HaMuerto") == 1){
        SetPVarInt(playerid, "HaMuerto", 0);
        SetPlayerPos(playerid, 1183.31, -1325.01, 13.58);
        SetPlayerFacingAngle(playerid, -90);
        SetPlayerSkin(playerid, Informacion[playerid][pRopaPuesta]);
        return 1;
    }
    if(NuevoUsuario[playerid] == true)
    {
        SetPlayerPos(playerid, 1183.31, -1325.01, 13.58);
        return 1;
    }

    SetPlayerPos(playerid,Informacion[playerid][pPos_x],Informacion[playerid][pPos_y],Informacion[playerid][pPos_z]);
    SetPlayerVirtualWorld(playerid, Informacion[playerid][pVirtualWorld]);
    SetPlayerInterior(playerid, Informacion[playerid][pInterior]);
    SetPlayerFacingAngle(playerid, Informacion[playerid][pPos_r]);
   
    SetPlayerHealth(playerid, Informacion[playerid][pVida]);
    SetPlayerArmour(playerid, Informacion[playerid][pChaleco]);
    SetPlayerSkin(playerid, Informacion[playerid][pRopaPuesta]);
    SaludJ[playerid] = CreateProgressBar(562.800048, 191.900009, _, _, 0xFA58ACFF, 100.0);
    ShowProgressBarForPlayer(playerid, SaludJ[playerid]);
    HambreJ[playerid] = CreateProgressBar(633.200012, 279.260314, _, _, 0xF7FE2EFF, 100.0);
    ShowProgressBarForPlayer(playerid, HambreJ[playerid]);
    return 1;
}
Reply


Messages In This Thread
Progressbar - by Alexander11 - 27.09.2014, 02:19
Respuesta: Progressbar - by Swedky - 27.09.2014, 02:22
Respuesta: Progressbar - by Alexander11 - 27.09.2014, 02:34

Forum Jump:


Users browsing this thread: 1 Guest(s)