Jump to content
  • 0

Problema comanda /BONUS


Question

Posted

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 

4 answers to this question

Recommended Posts

  • 0
Posted
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.

  • 0
Posted
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

  • 0
Posted
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 ;)

 

  • 0
Posted
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.

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.