Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Anonimus24

pomoc mysql - help

Dotaz

Ahoj mám problém pokud mám prázdnou DB a nemám vytvořené nemovitosti nemovitosti se vytvoří a na serveru se zobrazí poté server restartuj a nemovitosti se již nezobrazuji.
 

stock CreateObchod(const P_name[], Float:P_X1, Float:P_Y1, Float:P_Z1, P_Cena1,P_Vlastnici)
{
    ObchodCount ++;

	format(Obchod[ObchodCount][P_Nazev], MAX_PROPERTY_NAME, "%s", P_name);
	format(Obchod[ObchodCount][ObchodOwner], MAX_PLAYER_NAME, "Mesto");

	if(ObchodCount < MAX_PROPERTY)
	{
	    if(!IsObchodCreate(MySQL:g_SQL, ObchodCount))
	    {
			new query[500];
			mysql_format(g_SQL, query, sizeof(query), "INSERT INTO `property`(`ID`,`PosX`,`PosY`, `PosZ`, `Price`, `Ochrana`) VALUES (%d, %f, %f, %f, %i, %i)",ObchodCount, P_X1, P_Y1, P_Z1, P_Cena1,P_Vlastnici);
			mysql_tquery(g_SQL, query, "OnCreateObchod", "ifffii",ObchodCount, P_X1, P_Y1, P_Z1, P_Cena1,P_Vlastnici);
 		}else Update3DTextObchod(ObchodCount);
	}else print("Prekrocen max nemovitosti");
	return 1;
}

stock IsObchodCreate(MySQL:dbHandle, ObchodED)
{
    new query[128];
    mysql_format(dbHandle, query, sizeof(query), "SELECT COUNT(*) FROM `property` WHERE `ID`=%d", ObchodED);
    mysql_query(dbHandle, query);

    new found;
    cache_get_value_index_int(0, 0, found);
    return found;
}

 

Sdílet tento příspěvek


Link to post
Share on other sites

1 odpověd na tuto otázku

Recommended Posts

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