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

Guest
This topic is now closed to further replies.
  • Similar Content

    • By r3f13x
      Salut, Am si eu o problema, daca se pricepe cineva poate ma ajuta si pe mine. 
      De la un timp am o eroare la forum si nu stiu de ce, asa random. 
      Daca ma poate ajuta cineva.
       
      "Some functions are enabled on your server which have the potential to cause serious damage to your community or server. If you are in a shared hosting environment, some of these functions may bypass the restrictions which prevent one account on the server affecting another. Their presence also increases the amount of damage that could be caused if your AdminCP is compromised.
      Since Invision Community, and most other web applications do not use these functions, we recommend disabling them on your server, at least within the directory that your community is installed in. You should contact your hosting provider or system administrator and ask them to be added to the disable_functions PHP setting.
      [10:59 AM]
      la setarea PHP disable_functions." 
       
    • By Bogdy RPG
      Salut , cum pot conecta serverul last-time la baza de date de pe host?
    • By Bogdy RPG
      AM CUMPARAT HOST SI CAND BAG DATA BASE-UL IMI DA O EROARE | VA ROG AJUTATI-MA PAS CU PAS !  
    • By EdySt
      Am si eu o problema, cand compilez un gm burned sau adaug un progress bar cv 
      D:\DinC\Desktop\gamemodes\L-GM.pwn(42) : fatal error 100: cannot read from file
      cand compilez cu pawn citeste, dc?
      Apropo, pawn cu care compileaza sublime am incercat sa-l sterg si sa-l pun pe asta, dar la fel tot  nu citeste
    • By Flint
      Habar n-am de la ce primesc aceste errori , e cineva pe aici care poate sa ma ajute ? 
      Am xamp-ul pornit , la fel si baza de date!

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