CMD:setbope(playerid,params[])
{
new id, level,string[128];
if(Player[playerid][pLogged] == false)return SCM(playerid, COLOR_RED,""TAG_ERRO" Vocк nгo estб Logado para usar este comando!");
if(Player[playerid][Admin] >= 4 || Player[playerid][BOPE] >= 5)
{
new cargotext[60];
if(Player[playerid][BOPE] == 5) { cargotext = "Lнder"; }
if(Player[playerid][BOPE] == 4) { cargotext = "Major"; }
if(Player[playerid][BOPE] == 3) { cargotext = "Sargento"; }
if(Player[playerid][BOPE] == 2) { cargotext = "Cabo"; }
if(Player[playerid][BOPE] == 1) { cargotext = "Recruta"; }
if(Player[playerid][Admin] == 7) { cargotext = "Fundador"; }
if(Player[playerid][Admin] == 6) { cargotext = "Lider Geral"; }
if(Player[playerid][Admin] == 5) { cargotext = "Game Master"; }
if(Player[playerid][Admin] == 4) { cargotext = "Sub Game Master"; }
if(sscanf(params,"ud",id,level)) return SCM(playerid, COLOR_GREY, ""TAG_USOCORRETO" /setbope <id> <level>");
if(level > 5) return SCM(playerid, COLOR_RED, ""TAG_ERRO" Mбximo de Level a ser setado й 5.");
if(!(IsPlayerConnected(id))) return SCM(playerid, COLOR_RED, ""TAG_ERRO" Este jogador nгo estб Logado.");
format(string, sizeof(string), ""TAG_SERVER" O %s %s te setou de Level %d da BOPE .", cargotext, GetName(playerid), level);
SCM(id, COLOR_GREY, string);
format(string,sizeof(string),""TAG_INFO" Vocк setou %s de Level %d da BOPE.", GetName(id),level);
SCM(playerid, COLOR_GREY, string);
Player[id][BOPE]=level;
Player[id][Faccoes]=13;
format(string, 128,""TAG_SERVER" O %s %s setou %s de Level %d da BOPE.", cargotext, GetName(playerid), GetName(id), level);
MensagemAdmin(string);
format(string, 128,""TAG_INFO" O %s %s setou %s de Level %d da BOPE.", cargotext, GetName(playerid), GetName(id), level);
MensagemBope(string);
format(string, sizeof(string), "LOG: O %s %s setou %s de Level %d da BOPE.",cargotext, GetName(playerid), GetName(id), level);
DarBope(string);
printf("[SET BOPE]: -BOPE-: O %s %s setou %s de Level %d da BOPE.", cargotext, GetName(playerid), GetName(id), level);
}
else
{
SCM(playerid, COLOR_RED, ""TAG_ERRO" Vocк nгo tem permissгo para usar este comando!");
}
return 1;
}
Olб, BrGabrielBr.
Remova a funзгo DarBope(string); do cуdigo e veja se o erro persiste. Se o erro parar, analise a funзгo DarBope. |
stock Experience(playerid, value)
{
Point[playerid][pEXP] += value;
new exp = GetValueXP(playerid);
if(Point[playerid][pEXP] >= exp)
{
SetPlayerScore(playerid, ++Player[playerid][Score]);
new tmp = (Point[playerid][pEXP] - exp);
Point[playerid][pEXP] = tmp;
SetProgressBarMaxValue(BARXP[playerid], GetValueXP(playerid));
SetProgressBarValue(BARXP[playerid], tmp);
GameTextForPlayer(playerid, "~y~VOCE UPOU DE LEVEL!!!!", 3000, 3);
Salvar_Conta(playerid);
}
else SetProgressBarValue(BARXP[playerid], Point[playerid][pEXP]);
return 1;
}
//==============================================================================
forward UpdateBar(playerid);
public UpdateBar(playerid)
{
SetProgressBarValue(BARXP[playerid], Point[playerid][pEXP]);
SetProgressBarMaxValue(BARXP[playerid], GetValueXP(playerid));
UpdateProgressBar(BARXP[playerid], playerid);
new str[100];
format(str, sizeof(str), "%d/%d", Point[playerid][pEXP], GetValueXP(playerid));
TextDrawSetString(TDXP[0], str);
return 1;
}
Vocк tem que ver quando Experience estб sendo chamada.
Crie um TimerEx. |
SetTimer("Experience", 1000, true);
#define horas(%0) (1000 * %0 * 60 * 60)
SetTimerEx("Experience", horas(1), true, "id", playerid, 1);
Tente desta forma:
PHP код:
Troque o valor horas(1) pelo desejado. Troque 1 pelo valor de experiкncia que ele irб adquirir. |
public GetValueXP(playerid)
{
static value;
if(Player[playerid][Score] == 0)
value = 4;
else
value = Player[playerid][Score] * 8;
return value;
}