13/01/2023 12:09
eu fiz um sistema de barrinha de fome e sede mais quando chegar 20% ela passa da barra voces pode me ajuda ?
imagem do bug
https://ibb.co/jvVc4N9
Código:
Mag: AtualizarFomeSede(playerid)
{
if(PlayerSpectando[playerid] == false)
{
if(UserInfo[playerid][user_fome] > 100) UserInfo[playerid][user_fome] = 100;
if(UserInfo[playerid][user_sede] > 100) UserInfo[playerid][user_sede] = 100;
new Float:vidaplayer;
GetPlayerHealth(playerid, vidaplayer);
PlayerTextDrawSetString(playerid, ContFomeSede[playerid], fmat_return("%d%", UserInfo[playerid][user_fome]));
PlayerTextDrawTextSize(playerid, BarraFomeSede[playerid], 440+UserInfo[playerid][user_fome] , 1.0 );
PlayerTextDrawShow(playerid, BarraFomeSede[playerid]);
PlayerTextDrawSetString(playerid, ContFomeSede1[playerid], fmat_return("%d%", UserInfo[playerid][user_sede]));
PlayerTextDrawTextSize(playerid, BarraFomeSede1[playerid], 530+UserInfo[playerid][user_sede] , 1.0 );
PlayerTextDrawShow(playerid, BarraFomeSede1[playerid]);
if(UserInfo[playerid][user_fome] == 10)
{
PlayerTextDrawSetString(playerid, ContFomeSede[playerid], fmat_return("%d%", UserInfo[playerid][user_fome]));
PlayerTextDrawTextSize(playerid, BarraFomeSede[playerid], 477+UserInfo[playerid][user_fome] , 1.0 );
PlayerTextDrawShow(playerid, BarraFomeSede[playerid]);
}
if(UserInfo[playerid][user_fome] == 9)
{
PlayerTextDrawSetString(playerid, ContFomeSede[playerid], fmat_return("%d%", UserInfo[playerid][user_fome]));
PlayerTextDrawTextSize(playerid, BarraFomeSede[playerid], 474+UserInfo[playerid][user_fome] , 1.0 );
PlayerTextDrawShow(playerid, BarraFomeSede[playerid]);
}
if(UserInfo[playerid][user_fome] == 8)
{
PlayerTextDrawSetString(playerid, ContFomeSede[playerid], fmat_return("%d%", UserInfo[playerid][user_fome]));
PlayerTextDrawTextSize(playerid, BarraFomeSede[playerid], 471+UserInfo[playerid][user_fome] , 1.0 );
PlayerTextDrawShow(playerid, BarraFomeSede[playerid]);
}
if(UserInfo[playerid][user_fome] == 7)
{
PlayerTextDrawSetString(playerid, ContFomeSede[playerid], fmat_return("%d%", UserInfo[playerid][user_fome]));
PlayerTextDrawTextSize(playerid, BarraFomeSede[playerid], 468+UserInfo[playerid][user_fome] , 1.0 );
PlayerTextDrawShow(playerid, BarraFomeSede[playerid]);
}
if(UserInfo[playerid][user_fome] == 6)
{
PlayerTextDrawSetString(playerid, ContFomeSede[playerid], fmat_return("%d%", UserInfo[playerid][user_fome]));
PlayerTextDrawTextSize(playerid, BarraFomeSede[playerid], 465+UserInfo[playerid][user_fome] , 1.0 );
PlayerTextDrawShow(playerid, BarraFomeSede[playerid]);
}
if(UserInfo[playerid][user_fome] <= 5)
{
PlayerTextDrawSetString(playerid, ContFomeSede[playerid], fmat_return("%d%", UserInfo[playerid][user_fome]));
PlayerTextDrawTextSize(playerid, BarraFomeSede[playerid], 462+UserInfo[playerid][user_fome] , 1.0 );
PlayerTextDrawShow(playerid, BarraFomeSede[playerid]);
}
if(UserInfo[playerid][user_sede] == 10)
{
PlayerTextDrawSetString(playerid, ContFomeSede1[playerid], fmat_return("%d%", UserInfo[playerid][user_sede]));
PlayerTextDrawTextSize(playerid, BarraFomeSede1[playerid], 520+UserInfo[playerid][user_sede] , 1.0 );
PlayerTextDrawShow(playerid, BarraFomeSede1[playerid]);
}
if(UserInfo[playerid][user_sede] == 9)
{
PlayerTextDrawSetString(playerid, ContFomeSede1[playerid], fmat_return("%d%", UserInfo[playerid][user_sede]));
PlayerTextDrawTextSize(playerid, BarraFomeSede1[playerid], 510+UserInfo[playerid][user_sede] , 1.0 );
PlayerTextDrawShow(playerid, BarraFomeSede1[playerid]);
}
if(UserInfo[playerid][user_sede] == 8)
{
PlayerTextDrawSetString(playerid, ContFomeSede1[playerid], fmat_return("%d%", UserInfo[playerid][user_sede]));
PlayerTextDrawTextSize(playerid, BarraFomeSede1[playerid], 500+UserInfo[playerid][user_sede] , 1.0 );
PlayerTextDrawShow(playerid, BarraFomeSede1[playerid]);
}
if(UserInfo[playerid][user_sede] == 7)
{
PlayerTextDrawSetString(playerid, ContFomeSede1[playerid], fmat_return("%d%", UserInfo[playerid][user_sede]));
PlayerTextDrawTextSize(playerid, BarraFomeSede1[playerid], 490+UserInfo[playerid][user_sede] , 1.0 );
PlayerTextDrawShow(playerid, BarraFomeSede1[playerid]);
}
if(UserInfo[playerid][user_sede] == 6)
{
PlayerTextDrawSetString(playerid, ContFomeSede1[playerid], fmat_return("%d%", UserInfo[playerid][user_sede]));
PlayerTextDrawTextSize(playerid, BarraFomeSede1[playerid], 480+UserInfo[playerid][user_sede] , 1.0 );
PlayerTextDrawShow(playerid, BarraFomeSede1[playerid]);
}
if(UserInfo[playerid][user_sede] <= 5)
{
PlayerTextDrawSetString(playerid, ContFomeSede1[playerid], fmat_return("%d%", UserInfo[playerid][user_sede]));
PlayerTextDrawTextSize(playerid, BarraFomeSede1[playerid], 470+UserInfo[playerid][user_sede] , 1.0 );
PlayerTextDrawShow(playerid, BarraFomeSede1[playerid]);
}
retirada[playerid] ++;
PlayerTextDrawShow(playerid,BarraFomeSede[playerid]);
PlayerTextDrawShow(playerid,BarraFomeSede1[playerid]);
if(retirada[playerid] == 150)
{
if(vidaplayer > 5)
{
if(UserInfo[playerid][user_fome] < 10 || UserInfo[playerid][user_sede] < 10)
{
UserInfo[playerid][user_fome] -- ;
UserInfo[playerid][user_sede] -= random(2);
if(UserInfo[playerid][user_fome] < 1)UserInfo[playerid][user_fome] = 1;
if(UserInfo[playerid][user_sede] < 1)UserInfo[playerid][user_sede] = 1;
if(vidaplayer >10 )
{
SetPlayerHealth(playerid, vidaplayer - 10);
}
else if(vidaplayer >6 )
{
SetPlayerHealth(playerid, vidaplayer - 6);
}
else if(vidaplayer >3 )
{
SetPlayerHealth(playerid, vidaplayer - 3);
}
if(UserInfo[playerid][user_fome] < 10){
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Você esta com muita fome, coma algo ou morrerá de fome!");
}
if(UserInfo[playerid][user_sede] < 10){
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Você esta com muita sede, beba algo ou morrerá de sede!");
}
retirada[playerid] = 0;
return 1;
}
if(UserInfo[playerid][user_fome] < 25 || UserInfo[playerid][user_sede] < 25)
{
UserInfo[playerid][user_fome] -- ;
UserInfo[playerid][user_sede] -= random(2);
if(UserInfo[playerid][user_fome] < 1)UserInfo[playerid][user_fome] = 1;
if(UserInfo[playerid][user_sede] < 1)UserInfo[playerid][user_sede] = 1;
if(vidaplayer >5 )
{
SetPlayerHealth(playerid, vidaplayer - 5);
}
retirada[playerid] = 0;
return 1;
}
if(UserInfo[playerid][user_fome] < 50 || UserInfo[playerid][user_sede] < 50 )
{
UserInfo[playerid][user_fome] -- ;
UserInfo[playerid][user_sede] -= random(2);
if(UserInfo[playerid][user_fome] < 1)UserInfo[playerid][user_fome] = 1;
if(UserInfo[playerid][user_sede] < 1)UserInfo[playerid][user_sede] = 1;
if(vidaplayer >2 )
{
SetPlayerHealth(playerid, vidaplayer - 2);
}
retirada[playerid] = 0;
return 1;
}
UserInfo[playerid][user_fome] -- ;
UserInfo[playerid][user_sede] -= random(2);
retirada[playerid] = 0;
}
}
SalvarConta(playerid);
}
return 1;
}
imagem do bug
https://ibb.co/jvVc4N9