Algun ProgressBar recomendable?
#3

Correcciуn.
Este es un sistema de orina simple, si deseas tener alguna imagen en especial, avнsame.

Код:
#include <a_samp>
#include <orina>

//Tiempo que tarda en sumar 1 a GanasDeMear
#define Tiempo             20000 // ahora estб en 5 seg :v yo diria ponerle como 20 (20000)

//COLORES
#define VERDE             0x00D000FF
#define ROJO             0xE10000FF
#define NARANJA         0xFEAA00FF

//ANIMACION
#define MEAR_ANIMACION 68

//TImers
new ActualizarBarra[MAX_PLAYERS];
new TiempoMeando[MAX_PLAYERS];
//Barra
new Bar:MearBarra;
//Variables
new GanasDeMear[MAX_PLAYERS];

//Forwards de Timers
forward Menos(playerid);
forward DespuesDeMear(playerid);

//ProxDetector
#define T                 0x00FF07FF
#define T2                0x00FF07FF
#define T3                0x00FF07FF
#define T4                0x00FF07FF
#define T5                0x00FF07FF

new Escuchar[MAX_PLAYERS];

forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);

public OnFilterScriptInit()
{
    MearBarra = CreateProgressBar(548.000000, 35.000000, 57.500000, 5.199999, -51901185, 100);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    GanasDeMear[playerid] = 0;
    SetProgressBarValue(MearBarra, 0);
    ActualizarBarra[playerid] = SetTimer("Menos",Tiempo,1);
    ShowProgressBarForPlayer(playerid, MearBarra);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/orinar", cmdtext, true) == 0)
    {
        if(GanasDeMear[playerid] < 25)
        {
            SendClientMessage(playerid, ROJO, "Todavia no tienes tantas ganas de mear");
        }
        else
        {
        GanasDeMear[playerid] = 0;
        SetProgressBarValue(MearBarra, 0);
        TiempoMeando[playerid] = SetTimer("DespuesDeMear",3000,false);
        SetPlayerSpecialAction(playerid, MEAR_ANIMACION);
        SendClientMessage(playerid, VERDE, "[Pensamiento] ЎUuff!, ");
        new string[256], nombre[256];
        GetPlayerName(playerid, nombre, sizeof(nombre));
        format(string, sizeof(string), "** PSSSSSSSSSSSSSSS(%s [ID:%d])",nombre, playerid);
        ProxDetector(10.0, playerid, string,T,T2,T3,T4,T5);
        }
        return 1;
    }
    return 0;
}

public Menos(playerid)
{
GanasDeMear[playerid] += 1;
new Float:probando = GetProgressBarValue(MearBarra);
SetProgressBarValue(MearBarra, probando+1.0);
UpdateProgressBar(MearBarra, playerid);
if(GanasDeMear[playerid] == 50)
{
    SendClientMessage(playerid, NARANJA, "Tienes ganas de mear, ves a un lavabo o mea detras de un arbol");
}
else if(GanasDeMear[playerid] == 75)
{
    SendClientMessage(playerid, NARANJA, "ЎCorre, mea donde puedas! Si no meas te vas a mear encima!");
}
else if(GanasDeMear[playerid] == 100)
{
    TogglePlayerControllable(playerid,0);
    SetPlayerSpecialAction(playerid, MEAR_ANIMACION);
    TiempoMeando[playerid] = SetTimer("DespuesDeMear",3000,false);
    SendClientMessage(playerid, ROJO, "ЎTe has meado encima! Se van a reнr de ti");
}
return 1;
}

public DespuesDeMear(playerid)
{
    GanasDeMear[playerid] = 0;
    SetProgressBarValue(MearBarra, 0);
    ActualizarBarra[playerid] = SetTimer("Menos",Tiempo,1);
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
    TogglePlayerControllable(playerid,1);
    return 1;
}

public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
   if(IsPlayerConnected(playerid))
   {
      new Float:posx, Float:posy, Float:posz;
      new Float:oldposx, Float:oldposy, Float:oldposz;
      new Float:tempposx, Float:tempposy, Float:tempposz;
      GetPlayerPos(playerid, oldposx, oldposy, oldposz);
      for(new i = 0; i < MAX_PLAYERS; i++)
      {
         if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
         {
            if(!Escuchar[i])
            {
               GetPlayerPos(i, posx, posy, posz);
               tempposx = (oldposx -posx);
               tempposy = (oldposy -posy);
               tempposz = (oldposz -posz);
               if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
               {
                  SendClientMessage(i, col1, string);
               }
               else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
               {
                  SendClientMessage(i, col2, string);
               }
               else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
               {
                  SendClientMessage(i, col3, string);
               }
               else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
               {
                  SendClientMessage(i, col4, string);
               }
               else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
               {
                  SendClientMessage(i, col5, string);
               }
            }
            else
            {
               SendClientMessage(i, col1, string);
            }
         }
      }
   }
   return 1;
}
espero te sirva, saludos.
Reply


Messages In This Thread
Algun ProgressBar recomendable? - by Ciprian0 - 06.11.2016, 22:55
Respuesta: Algun ProgressBar recomendable? - by OTACON - 06.11.2016, 23:42
Respuesta: Algun ProgressBar recomendable? - by Gles - 07.11.2016, 00:31
Respuesta: Algun ProgressBar recomendable? - by OTACON - 07.11.2016, 00:43
Re: Algun ProgressBar recomendable? - by SilverGamingYT - 07.11.2016, 16:59
Respuesta: Re: Algun ProgressBar recomendable? - by Gles - 08.11.2016, 18:15

Forum Jump:


Users browsing this thread: 1 Guest(s)