Jump to content

Question

Posted

Salut, am o problema la comanda buylevel. Pur si simplu am RP-uri, dar cand dau /buylevel imi zice ca nu am, dar, daca nu am rp-uri tot imi zice ca nu am deci nu stiu ce am facut.

YCMD:buylevel(playerid, params[], help)
{
    new respect = (PlayerInfo[playerid][pLevel] * 3), money = (PlayerInfo[playerid][pLevel] * 250);
    
    if(PlayerInfo[playerid][pRespect] < respect)
        return SendClientMessage(playerid, COLOR_GREY, "Nu ai destule RP-uri! Foloseste comanda /stats pentru a vedea cate RP-uri ai.");
        
    if(GetPlayerMoney(playerid) < money)
        return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money!");
        
    GivePlayerMoneyEx(playerid, -money);
    UpdateLevelBar(playerid);
    
    PlayerInfo[playerid][pLevel] ++;
    PlayerInfo[playerid][pRespectPoints] -= respect;

    mysqlQuery("UPDATE `users` SET `RespectPoints` = '%d', `Level` = '%d' WHERE `ID` = '%d'", PlayerInfo[playerid][pRespectPoints], PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pSQLID]);
    SendFormatMessage(playerid, COLOR_YELLOW, "Your level is now %d!", PlayerInfo[playerid][pLevel]);
    return true;
}

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

new respect = PlayerInfo[playerid][pLevel] * 3,

money = PlayerInfo[playerid][pLevel] * 250;

if(PlayerInfo[playerid][pRespectPoints] < respect)
        return SendClientMessage(playerid, COLOR_GREY, "Nu ai destule RP-uri! Foloseste comanda /stats pentru a vedea cate RP-uri ai.");

Edited by NERS

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.