[Ajuda] Level - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Level (
/showthread.php?tid=517247)
Level -
BigRet - 04.06.2014
Bom to editando e meu GM e nгo estou consiguindo fazer um negocio
Meu GM tem um sistema de level que pra vc passar de level vc ganhar respeito de 1 h em 1 h Mas pra vc passar de level Precisa digitar um comando adquirirnivel Eu queria tirar esse comando e colocar pra passar sozinho Segue os codigos abaixo
O payday que vc ganha respeito
Код:
interest = (Player[i][pBank]/1000)*(tmpintrate);
if(Player[i][pBank] < 1000)
interest = 0;
Player[i][pBank] = account+interest;
format(string, sizeof(string), " Juros: 0.%d por cento",tmpintrate);
SendClientMessage(i, COLOR_GREY, string);
format(string, sizeof(string), " Juros Obtidos R$ %d", interest);
SendClientMessage(i, COLOR_GREY, string);
SendClientMessage(i, COLOR_GREY, "|--------------------------------------|");
format(string, sizeof(string), " Novo balanco: R$ %d", Player[i][pBank]);
SendClientMessage(i, COLOR_GREY, string);
new nxtlevel = Player[i][pLevel]+1;
new expamount = nxtlevel*levelexp;
if(Player[i][pExp] == expamount)
SendClientMessage(i, COLOR_LIGHTBLUE, "Vocк jб tem respeito suficiente, digite /adquirirnivel para ir ao prуximo level!!");
O comando adquirirnivel
Код:
dcmd_adquirirnivel(playerid, params[])
{
#pragma unused params
if(gPlayerLogged[playerid] != 0)
{
if(Player[playerid][pLevel] >= 0)
{
new nxtlevel = Player[playerid][pLevel]+1;
new expamount = nxtlevel*levelexp;
if(Player[playerid][pExp] < expamount)
{
format(thestring, 128, "[ERRO] Vocк precisa de %d Pontos de Respeito, Vocк sу tem %d.",expamount,Player[playerid][pExp]);
SendClientMessage(playerid, COLOR_RED, thestring);
return 1;
}
else
{
format(thestring, sizeof(thestring), "~g~Level Up: ~w~%d", nxtlevel);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerPlayMusic(playerid);
Player[playerid][pLevel]++;
if(Player[playerid][pDonateRank] > 1)
{
Player[playerid][pExp] -= expamount;
new total = Player[playerid][pExp];
if(total > 0)
{
Player[playerid][pExp] = total;
}
else
{
Player[playerid][pExp] = 0;
}
Player[playerid][gPupgrade] = Player[playerid][gPupgrade]+2;
GameTextForPlayer(playerid, thestring, 5000, 1);
format(thestring, 128, "[INFO] Vocк passou para o level %d", nxtlevel);
SendClientMessage(playerid, COLOR_GOLD, thestring);
format(thestring, 128, "[INFO] Vocк tem %d pontos de atualizacгo",Player[playerid][gPupgrade]);
SendClientMessage(playerid, COLOR_GOLD, thestring);
return 1;
}
Player[playerid][pExp] = 0;
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк ainda nгo estб logado.");
return 1;
}
}
Espero que me ajudem darei +rep
Re: Level -
ForT - 04.06.2014
Acredito que isso irб funcionar:
pawn Код:
if(Player[i][pExp] == expamount)
{
OnPlayerCommandText(i, "/adquirirnivel");
}