Jump to content
  • 0

Database Problem


andreistalker

Question

Problema intalnita (descriere): Nu stiu cum ar trebui sa fac ca sa se trimita banii la toti playerii
Ero(area / rile) / warning-(ul / urile): -
Liniile de cod / sursa / script-ul(obligatoriu):

forward updatemoney();
public updatemoney()
{
new query[256];
	foreach(Player, i)
		mysql_format(handle, query, sizeof(query), "UPDATE 'conturi' SET 'Cash' = '%d' WHERE 'Nume' = '%s'",
 ----, ----);
        mysql_query(handle, query);
	return 1;
}


Imagini / Video (optional): -
Ati incercat sa rezolvati singur?: La MySql format cum ar trebui sa fac ca sa il timita?

Edited by andreistalker
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Am incercat sa rezolv si am rezolvat-o 50% adica cand scriu /stats imi arata banii, dar banii nu se trimit si la database, aceeasi problema am si cand folosesti /ban nu trimite Ban = 1 la database, astea 2 sunt probleme...

Am rezolvat-o, dar acum nu imi mai da banii la connect :)))) MENTIONEZ: PANA ACUM MERGEA

public OnLogin(playerid)
{
    new rows, fields,temporar[200];
    cache_get_data(rows, fields);
    if(rows)
    {
        P_Data[playerid][pParola] = cache_get_field_content(0, "Parola",temporar);
        P_Data[playerid][pID] = cache_get_field_content_int(0, "ID");
        P_Data[playerid][pCash] = cache_get_field_content_int(0, "Cash");
        P_Data[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
        P_Data[playerid][pHelper] = cache_get_field_content_int(0, "Helper");
        P_Data[playerid][pLevel] = cache_get_field_content_int(0, "Level");
        SpawnPlayer(playerid);
        GivePlayerMoney(playerid, P_Data[playerid][pCash]);
        SpawnPlayer(playerid);
        gLogged[playerid] = 1;
        SpawnPlayer(playerid);
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Parola incorecta!", "Te rog sa iti introduci parola corecta, pentru a te loga pe server.", "Logare", "Exit");
    }
    return 1;
}

 

Edited by andreistalker
Link to comment
Share on other sites

  • 0

Asta e rezolvarea

foreach(Player, i)
		mysql_format(handle, query, sizeof(query), "UPDATE 'conturi' SET 'Cash' = '%d'",
 ----, ----);
        mysql_query(handle, query);
	return 1;
}

in caz ca nu ti-ai dat seama si ai cerut T/C fiindca nimeni nu ti-a raspuns.

242086.png

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.