Jump to content

/Bonus


BaDB0y95

Recommended Posts

Am si eu o problema la comanda /bonus dupa ce tastez primesc level si diamantele si bani mi pune si ii retrage inapoi adica bani nu se salveaza

 

CMD:bonus(playerid, params[])
{
    if(IsPlayerConnected(playerid))
     {
        if(pInfo[playerid][pScore] <= 2)
          {
            GivePlayerMoney(playerid, 15000000);
              pInfo[playerid][pScore] = 3;
            pInfo[playerid][pDiamonds] = 50;
               SetPlayerScore(playerid, pInfo[playerid][pScore]);
             SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai primit 15.000.000$, level 3 si 50 diamante de bun venit!");
        }
        else return SendClientMessage(playerid, COLOR_LIGHTRED, "Nu poti folosi aceasta comanda daca ai level 3+ !");
    }
    return 1;
}

 

Discord: BaDB0y#3017

Link to comment
Share on other sites

CMD:bonus(playerid, params[])
{
	if(pInfo[playerid][pScore] >= 2) return SCM(playerid, COLOR_LIGHTRED, "Nu poti folosi aceasta comanda daca ai level 2+!");
    GivePlayerMoney(playerid, 15000000);
	pInfo[playerid][pScore] = 3;
    pInfo[playerid][pDiamonds] = 50;
	pInfo[playerid][pMoney] += 15000000;
    SetPlayerScore(playerid, pInfo[playerid][pScore]);
    new query[128];
    mysql_format(SQL, query, 128, "UPDATE `users` SET `Level` = '%d', 'Diamonds' = '%d', `Money` = '%d' WHERE `ID` = '%d'", pInfo[playerid][pScore], pInfo[playerid][pDiamonds], pInfo[playerid][pMoney], pInfo[playerid][pSQLID]);
	mysql_tquery(SQL, query, "", "");
	return true;
}

 

Edited by hanako
greseala
  • Upvote 1
Link to comment
Share on other sites

  //////////////////// Sa nu se buguiasca banii //////////////////

ResetPlayerMoney(playerid);

pInfo[playerid][pMoney] += 1500000;

GivePlayerMoney(playerid, pInfo[playerid][pMoney]);

////////////////////////////////////////////////////////////////////////

 

// Salvare in baza de date sa nu se piarda banii ///

mysql_format(SQL, query, 128, "update users set level = '%d', Diamonds = '%d', Money = '%d' where name = '%s'", pInfo[playerid][pScore], pInfo[playerid][pDiamonds], pInfo[playerid][pMoney], GetName(playerid));

mysql_tquery(SQL, query);

////////////////////////////////////////////////////////////////////////

 

Sper ca te-am ajutat <3!

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
Reply to this topic...

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