[Ajuda] Level
#1

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
Reply
#2

Acredito que isso irб funcionar:
pawn Код:
if(Player[i][pExp] == expamount)
{
    OnPlayerCommandText(i, "/adquirirnivel");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)