Jump to content
  • 0

Problema Mysql


Stark.sys

Question

Problemă întâlnită (descriere): Crashed wile samp :-?
Ero(area / rile) / warning-(ul / urile): 

 

* Loaded 5 vehicles from database and 5 models

[16:22:25] [debug] Server crashed while executing RoRp.amx
[16:22:25] [debug] AMX backtrace:
[16:22:25] [debug] #0 native mysql_format () from mysql.dll
[16:22:25] [debug] #1 00008350 in public Vehicles () from RoRp.amx

Liniile de cod / sursa / script-ul: 

public Vehicles(vehicleid)
{
	new strquery[256];
    gVehInfo[vehicleid][vID] = cache_insert_id(c);
	mysql_format(c, strquery, sizeof(query), "SELECT * FROM `vehicle` WHERE `ID`='%i'", vehicleid);
	mysql_query(c, strquery, true);
	return 1;
}

OnGameModeInit:
mysql_pquery(c, "SELECT * FROM `vehicle`", "OnVehicleLoad", "");
SetTimer("Vehicles", 100, 0);

Imagini / Video (optional):  - 
Aţi încercat să rezolvaţi singur?: Da, daca scot mysql_format (); nu mai da crash-u :-?

 

PS: Erori noi ...

 

 

16:37:02 cache_get_row_count OK connection: 1 16:37:02 cache_get_row_count WARNING no active cache
Edited by sRk7

"Mulţi programatori buni fac programare nu pentru că se aşteaptă să câştige bani sau să fie lăudaţi de public, ci pentru că e amuzant să programezi." - Linus Torvalds

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

1. Nu ai nevoie de un string asa de mare (256), merge si 128.

2. La mysql_query poti sa scoti acel true pentru ca nu iti trebuie.

3. Tu acolo ai un SetTimer("Vehicles", 100, 0); care cheama functia Vehicles care are parametru vehicleid, tu trebuie sa ii pasezi si ei un parametru, pentru asta foloseste SetTimerEx.

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