kirpi1997
Ученик
Здраствуйте пользователи P-I.Скажите пожалуйста как переделать команду /buylevel что-бы при покупке уровня менялся ещё возраст.Тойть у тебя 16 уровень и 16 лет перешол на следующий уровень стал 17лвл и 17лет
вот команда /buylevel
вот команда /buylevel
Код:
if (strcmp(cmd, "/buylevel", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (gPlayerLogged[playerid] != 0)
{
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
if(PlayerInfo[playerid][pLevel] >= 0)
{
new nxtlevel = PlayerInfo[playerid][pLevel]+1;
new costlevel = nxtlevel*levelcost;
new expamount = nxtlevel*levelexp;
new infostring[256];
if(GetPlayerMoney(playerid) < costlevel)
{
format(infostring, 256, " У вас недостаточно наличности на руках ($%d) !",costlevel);
SendClientMessage(playerid, COLOR_GRAD1, infostring);
return 1;
}
else if (PlayerInfo[playerid][pExp] < expamount)
{
format(infostring, 256, " Нужно %d Респектов, У вас всего [%d] !",expamount,PlayerInfo[playerid][pExp]);
SendClientMessage(playerid, COLOR_GRAD1, infostring);
return 1;
}
else
{
format(string, sizeof(string), "~g~LEVEL UP~n~~w~You Are Now Level %d", nxtlevel);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerPlayMusic(playerid);
NormMoney[playerid] = 2;
AntiMoney[playerid] = AntiMoney[playerid] - costlevel;
GivePlayerMoney(playerid, (costlevel));
PlayerInfo[playerid][pLevel]++;
if(PlayerInfo[playerid][pDonateRank] > 0)
{
PlayerInfo[playerid][pExp] = expamount;
new total = PlayerInfo[playerid][pExp];
if(total > 0)
{
PlayerInfo[playerid][pExp] = total;
}
else
{
PlayerInfo[playerid][pExp] = 0;
}
}
else
{
PlayerInfo[playerid][pExp] = 0;
}
PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
GameTextForPlayer(playerid, string, 5000, 1);
format(infostring, 256, "* Вы купили уровень %d за ($%d) пишите/upgrade", nxtlevel, costlevel);
SendClientMessage(playerid, COLOR_LIGHTBLUE, infostring);
format(infostring, 256, "* Вам дали %d Пунктов Модернизации",PlayerInfo[playerid][gPupgrade]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, infostring);
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Вы не загружены !");
}
}
return 1;
}
