Jump to content
  • 0

Problema /buylevel


zroT

Question

Salut.

Am si eu o problema cu cumanada /buylevel, de exemplu: Daca am 100 respect points si im trebuie sa folosesc 20 pentru level 2 , dupa ce folosesc /buylevel ma seteaza pe 0 respect.

PS: Comanda e buna, pe alte GM-uri merge, alta cred a e buba.

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;//10k for testing purposes

new expamount = nxtlevel*levelexp;

new infostring[256];

if(GetPlayerMoney(playerid) < costlevel)

{

format(infostring, 256, "  Trebuie sa ai $%d pentru a putea cumpara level !",costlevel);

SendClientMessage(playerid, COLOR_GRAD1, infostring);

return 1;

}

else if (PlayerInfo[playerid][pExp] < expamount)

{

format(infostring, 256, "  Ai nevoie de %d Puncte de Respect pentru a trece la level-ul urmator,    momentan ai decat [%d] !",expamount,PlayerInfo[playerid][pExp]);

SendClientMessage(playerid, COLOR_GRAD1, infostring);

return 1;

}

else

{

format(string, sizeof(string), "~g~Level urmator~n~~w~Tu acum ai level %d", nxtlevel);

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

PlayerPlayMusic(playerid);

GivePlayerMoney(playerid, (-costlevel));

PlayerInfo[playerid][pLevel]++;

if(PlayerInfo[playerid][pRegularRank] > 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, "  Acum ai level %d pentru ($%d) Sxrie /upgrade", nxtlevel, costlevel);

SendClientMessage(playerid, COLOR_GRAD1, infostring);

format(infostring, 256, "  Tu ai acum %d Puncte de Upgrade",PlayerInfo[playerid][gPupgrade]);

SendClientMessage(playerid, COLOR_GRAD2, infostring);

}

}

return 1;

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Tu nu esti logat !");

}

}

return 1;

}

stats.php?page=2&ip=samp.zonek.ro&port=7777
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.