Hallo,
ich wollte mich mal etwas mit meinem Script und der MySQL R39-3 (BlueG) auseinandersetzen.
Nun habe ich eine Frage: Muss jeder Query auf ein Callback "antworten"?
Wenn nein, kann mir jemand ein Beispiel geben, wie ich das bei folgendem Code umschreiben kann?
new q[128],w;
format(q,sizeof q,"SELECT `ID`, `Status`, `Model` FROM `Playercars` WHERE `Owner` = '%s'",pInfo[playerid][pName]);
//mysql_format(dbHandle,q,sizeof q,"SELECT `ID`, `Status`, `Model` FROM `Playercars` WHERE `Owner` = '%e'",pInfo[playerid][pName]);
mysql_query(q);
mysql_store_result();
if(mysql_num_rows()) {
while(mysql_fetch_row(str)) {
w++;
new st,md,id;
sscanf(str,"p<|>ddd",id,st,md);
switch(w) {
case 1: {
PlayerTextDrawSetPreviewModel(playerid, Stats[29][playerid], md);
cStats[0][playerid] = id;
if(st == 1) { PlayerTextDrawBackgroundColor(playerid, Stats[29][playerid], 0x00D900FF); format(in,sizeof in,"%s~n~~g~Nicht Defekt",PlayerVehicle[md-400]); PlayerTextDrawSetString(playerid, Stats[33][playerid], in); }
else if(st == 0) { PlayerTextDrawBackgroundColor(playerid, Stats[29][playerid], 0xFF0000FF); format(in,sizeof in,"%s~n~~r~Defekt",PlayerVehicle[md-400]); PlayerTextDrawSetString(playerid, Stats[33][playerid], in); }
PlayerTextDrawShow(playerid, Stats[29][playerid]), PlayerTextDrawShow(playerid, Stats[33][playerid]);
}
case 2: {
PlayerTextDrawSetPreviewModel(playerid, Stats[30][playerid], md);
cStats[1][playerid] = id;
if(st == 1) { PlayerTextDrawBackgroundColor(playerid, Stats[30][playerid], 0x00D900FF); format(in,sizeof in,"%s~n~~g~Nicht Defekt",PlayerVehicle[md-400]); PlayerTextDrawSetString(playerid, Stats[34][playerid], in); }
else if(st == 0) { PlayerTextDrawBackgroundColor(playerid, Stats[30][playerid], 0xFF0000FF); format(in,sizeof in,"%s~n~~r~Defekt",PlayerVehicle[md-400]); PlayerTextDrawSetString(playerid, Stats[34][playerid], in); }
PlayerTextDrawShow(playerid, Stats[29][playerid]), PlayerTextDrawShow(playerid, Stats[33][playerid]), PlayerTextDrawShow(playerid, Stats[30][playerid]), PlayerTextDrawShow(playerid, Stats[34][playerid]);
}
}
}
}
mysql_free_result();
Jeffry: vielleicht
lg
Deagle