Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Question

Posted (edited)

Am gasit pe internet un tutorial de vehicle System pe mysql si era pe o versiune veche, cum as putea sa o trec pe r39?

public LoadCar()
{
    new vehs = 0;
    mysql_query(handle,"SELECT MAX(id) FROM cars");
    mysql_store_result();
    masini = mysql_fetch_int();
    for(new idx = 1; idx <= masini; idx++)
    {
        new query[256];
        mysql_format(handle, query, sizeof(query), "SELECT * FROM cars WHERE ID = %d",idx);
        mysql_query(handle, query);
        mysql_store_result();
        if(cache_num_rows())
        {
            CarInfo[idx][cID] = -2;
        }
        else
        {
            if(mysql_fetch_row_format(query, "|"))
            {
                sscanf(query, "p<|>e<iiffffiis[25]is[14]iiiiiiiiiiiiiiiiiiiii>",CarInfo[idx]);
                vehs++;
            }
        }
    }
    mysql_free_result();
    printf("Cars: %d", vehs);
    return 1;
}

 

Multumesc celor care o sa ma ajute :D

Edited by andreistalker

1 answer to this question

Recommended Posts

  • 0
Posted

Il citez pe  WiDuAlK.SaMp  :

public LoadCar()
{
    mysql_format(handle, query, sizeof(query), "SELECT * FROM `cars`");
    mysql_store_result();
	
	new Rows = cache_num_rows();

	for (new i = 0; i < Rows; i++)
	{
		CarInfo[i - 1][cID] = -2;
    }
    mysql_free_result();
    printf("Cars: %d", Rows);
    return 1;
}

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

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.