Jump to content
  • 0

Problema comanda /BONUS


OldeR

Question

CMD:bonus(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
     {
         if(BonusActiv > 0)
         {
             if(PlayerInfo[playerid][pLevel] <= 1)
             {
                 GivePlayerCash(playerid, 35000000);
                 PlayerInfo[playerid][pLevel] = 5;
                 Update(playerid, pLevelx);
                 Update(playerid, pCashx);
                 SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
                 SendClientMessage(playerid, -1, "{00CC33}SERVER: Ai primit $35,000,000 si level 5 de bun venit,bafta la joc!");
            }
            else return SendClientMessage(playerid, COLOR_LIGHTRED, "Nu poti folosi aceasta comanda daca ai level 5+ !");
        }
    }
    return 1;
}

 

VREAU SA PUN SI PP CUM FAC ASTA ? ADICA SA DEA LEVEL , BANI SI PP 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
CMD:bonus(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
     {
         if(BonusActiv > 0)
         {
             if(PlayerInfo[playerid][pLevel] <= 1)
             {
                 GivePlayerCash(playerid, 35000000);
                 PlayerInfo[playerid][pLevel] = 5;
               	 PlayerInfo[playerid][pPremiumPoints] += 500;
                 Update(playerid, pLevelx);
                 Update(playerid, pCashx);
               	 Update(playerid, pPremiumPointsx);
                 SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
                 SendClientMessage(playerid, -1, "{00CC33}SERVER: Ai primit $35,000,000 si level 5 de bun venit,bafta la joc!");
            }
            else return SendClientMessage(playerid, COLOR_LIGHTRED, "Nu poti folosi aceasta comanda daca ai level 5+ !");
        }
    }
    return 1;
}

Poti inlocui += cu = simplu dar am presupus ca poate jucatorul mai are puncte premium si din alta parte.

Link to comment
Share on other sites

  • 0
Acum 3 minute, andrei9971 a spus:

Poti inlocui += cu = simplu dar am presupus ca poate jucatorul mai are puncte premium si din alta parte.

Diferenta dintre += si = e uriasa. Asa ca mai bine nu inlocuieste, sa zicem ca playerul poate da de 2 ori bonus la un interval de timp, nu ar fi ok

PlayerInfo[playerid][pPremiumPoints] += 500;
//La fel
PlayerInfo[playerid][pPremiumPoints] = PlayerInfo[playerid][pPremiumPoints] + 500;

Daca PlayerInfo[playerid][pPremiumPoints] e sa zicem 100 primiti la inregistrare = ii va pune direct 500 fara sa mai tina cont de cele 100 puncte

Link to comment
Share on other sites

  • 0
1 oră în urmă, andrei9971 a spus:

CMD:bonus(playerid, params[]) { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first."); if(IsPlayerConnected(playerid)) { if(BonusActiv > 0) { if(PlayerInfo[playerid][pLevel] <= 1) { GivePlayerCash(playerid, 35000000); PlayerInfo[playerid][pLevel] = 5; PlayerInfo[playerid][pPremiumPoints] += 500; Update(playerid, pLevelx); Update(playerid, pCashx); Update(playerid, pPremiumPointsx); SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]); SendClientMessage(playerid, -1, "{00CC33}SERVER: Ai primit $35,000,000 si level 5 de bun venit,bafta la joc!"); } else return SendClientMessage(playerid, COLOR_LIGHTRED, "Nu poti folosi aceasta comanda daca ai level 5+ !"); } }  return 1; }

Mersi mult ;)

 

Link to comment
Share on other sites

  • 0
2 hours ago, Banditul said:

Diferenta dintre += si = e uriasa. Asa ca mai bine nu inlocuieste, sa zicem ca playerul poate da de 2 ori bonus la un interval de timp, nu ar fi ok


PlayerInfo[playerid][pPremiumPoints] += 500;
//La fel
PlayerInfo[playerid][pPremiumPoints] = PlayerInfo[playerid][pPremiumPoints] + 500;

Daca PlayerInfo[playerid][pPremiumPoints] e sa zicem 100 primiti la inregistrare = ii va pune direct 500 fara sa mai tina cont de cele 100 puncte

Pai da, daca are 100, dupa ce da /bonus o sa aiba 500. Dar daca pune += o sa aiba 600. Ce spui tu asa e cu intervalul de timp. Doar ca banuiesc ca are o restrictie ceva care sa ii dea acces doar o data la /bonus.

Link to comment
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.

×
×
  • 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.