OnplayerSpawn //Nos queremos que a progressbar so aparece quando ele spawnar, para n fica a barra la entrada de login etc
PHP код:
public OnPlayerEXP(playerid) // criando a callback
{
if(EXP[playerid] == 1)
{
SetProgressBarValue(EXPP, 10.0);
UpdateProgressBar(EXPP, playerid);
PlayerPlaySound(playerid,1149,0.0,0.0,0.0), GameTextForPlayer(playerid,"+>EXP!",1000,2);
EXP[playerid] ++; //somando + 1 no valor atual da variбvel.
SendClientMessage(playerid, -1, "**Vocк somou + 1 EXP.");
}
if(EXP[playerid] == 2)
{
SetProgressBarValue(EXPP, 20.0);
UpdateProgressBar(EXPP, playerid);
PlayerPlaySound(playerid,1149,0.0,0.0,0.0), GameTextForPlayer(playerid,"+>EXP!",1000,2);
EXP[playerid] ++; //somando + 1 no valor atual da variбvel.
SendClientMessage(playerid, -1, "**Vocк somou + 1 EXP.");
}
if(EXP[playerid] == 3)
{
SetProgressBarValue(EXPP, 30.0);
UpdateProgressBar(EXPP, playerid);
PlayerPlaySound(playerid,1149,0.0,0.0,0.0), GameTextForPlayer(playerid,"+>EXP!",1000,2);
EXP[playerid] ++; //somando + 1 no valor atual da variбvel.
SendClientMessage(playerid, -1, "**Vocк somou + 1 EXP.");
}
if(EXP[playerid] == 4)
{
SetProgressBarValue(EXPP, 40.0);
UpdateProgressBar(EXPP, playerid);
PlayerPlaySound(playerid,1149,0.0,0.0,0.0), GameTextForPlayer(playerid,"+>EXP!",1000,2);
EXP[playerid] ++; //somando + 1 no valor atual da variбvel.
SendClientMessage(playerid, -1, "**Vocк somou + 1 EXP.");
}
if(EXP[playerid] == 5)
{
SetProgressBarValue(EXPP, 50.0);
UpdateProgressBar(EXPP, playerid);
PlayerPlaySound(playerid,1149,0.0,0.0,0.0), GameTextForPlayer(playerid,"+>EXP!",1000,2);
EXP[playerid] ++; //somando + 1 no valor atual da variбvel.
SendClientMessage(playerid, -1, "**Vocк somou + 1 EXP.");
}
if(EXP[playerid] == 6)
{
SetProgressBarValue(EXPP, 60.0);
UpdateProgressBar(EXPP, playerid);
Score[playerid]++; //Soma um level na variбvel.
EXP[playerid] = 0; //Seta o EXP para 0 pois o player ja somou 6 EXP de 10 minutos totalizando 1 hora.
SetPlayerScore(playerid, Score[playerid]);
PlayerPlaySound(playerid,1149,0.0,0.0,0.0), GameTextForPlayer(playerid,">UP<",1000,2);
SendClientMessage(playerid, -1, "**Vocк upou + 1 Score."); //Manda uma msg avisando.
SetProgressBarValue(XPA, -00.0);
UpdateProgressBar(XPA, playerid);
}
}