Jump to content
  • 0

Problema /dsremove


LeetRomania

Question

Salut.

Am adaugat comanda:

CMD:dsremove(playerid, params[])
{
    if(IsPlayerConnected(playerid))
     {
        if(playerVariables[playerid][pAdminLevel] < 6) return S(playerid, -1, AdminOnly);

        new id, i, queryString[256], string[256];

        if(sscanf(params, "i", id)) return S(playerid, COLOR_GREY, "Syntax: {FFFFFF}/dsremove [model]");

        mysql_format(handle, queryString, sizeof(queryString), "DELETE FROM stock WHERE ID = '%d' ORDER BY ID = '%d' ASC LIMIT 1", id, id);
        mysql_tquery(handle, queryString, "", "");
        
        format(string, sizeof(string), "{F0DF52}/dsremove: Owner %s removed car %d (%s) from the DS.", GetName(playerid), id, VehicleNames[id - 400]);
        submitToAdmins(string, -1);
        incarcarestock = 3;
    }
     return 1;
}

si problema este ca nu se sterge masina din baza de date. Aveti idee de ce? 

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0
CMD:dsremove(playerid, params[])
{
    if(IsPlayerConnected(playerid))
     {
        if(playerVariables[playerid][pAdminLevel] < 6) return S(playerid, -1, AdminOnly);

        new id, queryString[256], string[256],eroare = 0,idv;

        if(sscanf(params, "i", id)) return S(playerid, COLOR_GREY, "Syntax: {FFFFFF}/dsremove [model]");
		mysql_format(handle, queryString, sizeof(queryString), "SELECT * FROM `stock` WHERE `Model`='%d'",id);
		new Cache: verificare = mysql_query(handle, queryString);
		eroare = cache_get_row_count();
		if(eroare > 0)
		{
			for(new i = 0; i < eroare; i++)
			{
				idv = cache_get_field_content_int(i, "ID");
			}
		}
		cache_delete(verificare);
		if(eroare < 1) return SendClientMessage(playerid, -1, "Acest model de vehicul nu exista in baza de date.");
		Stock[idv][vPrice] = -1;
		mysql_format(handle, queryString, sizeof(queryString), "DELETE FROM stock WHERE `Model` = '%d'", id);
        mysql_tquery(handle, queryString, "", "");
        
        format(string, sizeof(string), "{F0DF52}/dsremove: Owner %s removed car %d (%s) from the DS.", GetName(playerid), id, VehicleNames[id - 400]);
        submitToAdmins(string, -1);
        incarcarestock = 3;
    }
     return 1;
}

Poftim, acum va trebuii sa functioneze.

                        

 

 

Link to comment
Share on other sites

  • 0

 

Acum 3 minute, LeetRomania a spus:

mysql_format(handle, queryString, sizeof(queryString), "DELETE FROM stock WHERE ID = '%d' ORDER BY ID = '%d' ASC LIMIT 1", id, id);

schimba cu.

mysql_format(handle, queryString, sizeof(queryString), "DELETE FROM stock WHERE `Model` = '%d'", id);

 

                        

 

 

Link to comment
Share on other sites

  • 0
Chiar acum, LeetRomania a spus:

Am facut si asa si nu merge.. 

Pai ai folosit comanda /dsremove [model vehicul, ex 411?]

Nu are cum sa nu mearga.

Dai /dsremove 411

Si verifica daca se sterge din baza de date.

 

                        

 

 

Link to comment
Share on other sites

  • 0
7 minutes ago, [RW]Robi said:

Pai ai folosit comanda /dsremove [model vehicul, ex 411?]

Nu are cum sa nu mearga.

Dai /dsremove 411

Si verifica daca se sterge din baza de date.

 

Da, ai dreptate. Dar cum pot face sa nu se stearga daca modelul nu exista?

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.