Jump to content
  • 0
Sign in to follow this  
NuamNume

Problema Scripting.

Question

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;
}

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

This site uses cookies. By continuing browsing, you agree to the use of this information. For more details, see Terms of Use and Privacy Policy.