Jump to content
  • 0

problema verificare comanda!


caltabos

Question

salut am facut o comanda /beneficii pentru youtuberi si am pus verificarea ca daca beneficii = 1 sa nu te mai lase sa dai, dar tot poti da si in baza de date nu se creeaza Beneficii nu stiu de ce!

 

Comanda:

Spoiler

}
CMD:beneficii(playerid, params[]) {
    if(PlayerInfo[playerid][pYT] == 0) return SendClientMessage(playerid, COLOR_RED, "Nu esti youtuber!");
    if(PlayerInfo[playerid][pBeneficii] == 1) return SendClientMessage(playerid, COLOR_RED, "Ai luat deja beneficiile!");
    foreach(Player, i) {
        if(IsPlayerConnected(i) && IsPlayerLogged == 1) {
            new playerlevel = PlayerInfo[pLevel];
            PlayerInfo[pLevel] = playerlevel + 1;
            Update(i, pLevelx);
            SetPlayerScore(i,PlayerInfo[pLevel]);
            PlayerInfo[pPremiumPoints] += 50;
            Update(i, pPremiumPointsx);
            GivePlayerMoney(playerid, 15000000);
            Update(playerid, pCashx);
            SendClientMessage(playerid, COLOR_WHITE, "{b70000}Beneficii YT : {FFFFFF}Ai primit {00a521}15,000,000$ {ffb407}50 {FFFFFF}Puncte Premium si {b70000}Nivel 1.");
            UpdateProgress(i, 0);
        }
    }
    return 1;
}

La pInfo am adaugat : pBeneficii

In systems.inc :

#define pBeneficiix            91

case pBeneficiix: format(var, sizeof(var), "UPDATE `users` SET `Beneficii`='%d' WHERE `ID`='%d'",PlayerInfo[playerid][pBeneficii], PlayerInfo[playerid][pSQLID]);sa-mp-042.png.61def6b47ba8bd2d6dddb2d0c3635ddb.png

 

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Încearcă așa, ar trebui să meargă.

	CMD:beneficii(playerid, params[])
	{
        if(PlayerInfo[playerid][pYT] == 1 && PlayerInfo[playerid][pBeneficii] == 0)
        {
            new playerlevel = PlayerInfo[playerid][pLevel];
            PlayerInfo[playerid][pLevel] = playerlevel + 1;
            Update(playerid, pLevelx);
            SetPlayerScore(playerid,PlayerInfo[pLevel]);
            PlayerInfo[playerid][pPremiumPoints] += 50;
            Update(playerid, pPremiumPointsx);
            PlayerInfo[playerid][pCash] += 15000000;
            Update(playerid, pCashx);
            SendClientMessage(playerid, COLOR_WHITE, "{b70000}Beneficii YT : {FFFFFF}Ai primit {00a521}15,000,000$ {ffb407}50 {FFFFFF}Puncte Premium si {b70000}Nivel 1.");
      	}
    	return 1;
}

 

Edited by Flaviu11
Link to comment
Share on other sites

  • 0
Acum 25 minute, Flaviu11 a spus:

Încearcă așa, ar trebui să meargă.


	CMD:beneficii(playerid, params[])
	{
        if(PlayerInfo[playerid][pYT] == 1 && PlayerInfo[playerid][pBeneficii] == 0)
        {
            new playerlevel = PlayerInfo[playerid][pLevel];
            PlayerInfo[playerid][pLevel] = playerlevel + 1;
            Update(playerid, pLevelx);
            SetPlayerScore(playerid,PlayerInfo[pLevel]);
            PlayerInfo[playerid][pPremiumPoints] += 50;
            Update(playerid, pPremiumPointsx);
            PlayerInfo[playerid][pCash] += 15000000;
            Update(playerid, pCashx);
            SendClientMessage(playerid, COLOR_WHITE, "{b70000}Beneficii YT : {FFFFFF}Ai primit {00a521}15,000,000$ {ffb407}50 {FFFFFF}Puncte Premium si {b70000}Nivel 1.");
      	}
    	return 1;
}

 

da, dar am observat ca-n baza de date nu se adauga tabelul beneficii la users, stii cumva dece?

Link to comment
Share on other sites

  • 0
Acum 8 ore, Cordyandrey a spus:

Poate pentru ca nu e setat sa se salveze in baza de date... mai priveste si tu tutoriale.. 

#define pBeneficiix            91

 

case pBeneficiix: format(var, sizeof(var), "UPDATE `users` SET `Beneficii`='%d' WHERE `ID`='%d'",PlayerInfo[playerid][pBeneficii], PlayerInfo[playerid][pSQLID]);

........................

Link to comment
Share on other sites

  • 0
Acum 38 minute, caltabos a spus:

#define pBeneficiix            91

 

case pBeneficiix: format(var, sizeof(var), "UPDATE `users` SET `Beneficii`='%d' WHERE `ID`='%d'",PlayerInfo[playerid][pBeneficii], PlayerInfo[playerid][pSQLID]);

........................

Si apelezi in comanda beneficii acea fubctie pt update ca eu nu o vad?

Daca Setezi variabila pt beneficii pe 1 in comanda si ii faci update in db ai rezolvat maretul bug

Btw comanda pe care ai postat-o initial dadea acele bonusuri la toti playeri on de fiecare data cand cineva folosea comanda beneficii 

Link to comment
Share on other sites

  • 0
Acum 1 minut, valivaly96 a spus:

Si apelezi in comanda beneficii acea fubctie pt update ca eu nu o vad?

Daca Setezi variabila pt beneficii pe 1 in comanda si ii faci update in db ai rezolvat maretul bug

Btw comanda pe care ai postat-o initial dadea acele bonusuri la toti playeri on de fiecare data cand cineva folosea comanda beneficii 

am pus Update(playerid, pBeneficiix); dar in topicul asta am uitat sa pun, dar tot nu merge oricum nu o mai fac

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.