Jump to content
  • 0

Problema salvarea in baza de date


Question

Posted

Am incercat sa fac recent un sistem de crates insa am intampinat o problema la salvarea in baza de date, mai exact nu se salveaza atunci cand le achizitionezi si dai /q.

 

In baza de date am adaugat urmatoarele: NormalCrate, INT(11), default as none

 

aici e codul din script prin care ar trebui sa adauge salvarea in baza de date

if(dialogid == DIALOG_NORMALCRATE)
  	{
    	if(response)
    	{
    		switch(listitem) 
    		{
      			case 0: 
      			{
        			SendClientMessage(playerid, -1, "in lucru");
      			}
      			case 1: 
      			{
        			if(PlayerInfo[playerid][pPremiumPoints] < 100) return SCM(playerid, -1, "{008080}>> NORMAL CRATE: {FFFFFF}You don't have 100 premium points.");
        			PlayerInfo[playerid][pPremiumPoints] -= 100;
        			Update(playerid, pPremiumPoints);
        			PlayerInfo[playerid][pNormalCrate] ++;
        			Update(playerid, pNormalCrate);
        			SCM(playerid, -1, "{008080}>> CRATES: {FFFFFF}You succesfully bought a NORMAL crate for 100 premium points.");
      			}       
    		}
  		}
  	}

 

3 answers to this question

Recommended Posts

  • 0
Posted

Ti-as sugera sa verifici in primul rand mysqlog/serverlog. Urmatorul lucru, verifica daca query pentru Update(playerid, pNormalCrate); este corect si de fapt actualizeaza NormalCrates

  • 0
Posted

Incearca sa trimiti tu query u respectiv manual, fara sa te folosesti de functia `Update` pe care o ai in gamemode.

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.