Jump to content

Recommended Posts

Posted

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

Posted (edited)
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
Posted

  //////////////////// 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!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.