public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){ if(dialogid == DIALOG_CRACE) { if(response == 1) { if((strlen(inputtext) < 1)) { SendClientMessage(playerid, VOROS, \"A név minimum 1 karakter hosszú kell hogy legyen!\"); PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0); ShowPlayerDialog(playerid, DIALOG_CRACE, DIALOG_STYLE_INPUT, \"Race System\", \"\"VOROS_K\"HIBA:A név minimum 1 karakter kell hogy legyen!\\n\"ZOLD_K\"Írj egy nevet a pályanak!\", \"Elfogad\", \"\"); } else { new racen[100]; format(racen, sizeof(racen), \"%s\", inputtext); format(query, sizeof(query), \"SELECT * FROM `kserace` WHERE `RaceName` = \'%s\'\", inputtext); mysql_function_query(FCH, query, true, \"CheckRaceName\", \"ss\",playerid, racen); } } return 1;} return 0;}
public CheckRaceName(playerid, racen[]) {new rows, fields;new rnstr2[256];cache_get_data(rows, fields);printf(\"rows:%d\", rows);if(rows) {ShowPlayerDialog(playerid, DIALOG_CRACE, DIALOG_STYLE_INPUT, \"Race System\", \"\"VOROS_K\"HIBA:Ilyen nevû versenypályánk már van!\"ZOLD_K\"Írj egy nevet a pályanak!\", \"Elfogad\", \"\");} else {new sikerstring[300], starttick, finishtick;format(rnstr2, sizeof(rnstr2), \"INSERT INTO `kserace` (`RaceNr` ,`RaceName` ,`RaceCreator` ,`raceX` ,`raceY` ,`raceZ`) VALUES ( NULL , \'%s\' , \'%s\', \'%f\', \'%f\', \'%f\');\", racen, PName(playerid), X[playerid][0], Y[playerid][0], Z[playerid][0]);mysql_function_query(FCH, rnstr2, true, \"SaveChoords\", \"\");for(new i = 1; i <= CPNumber[playerid]; i++) {format(rnstr2, sizeof(rnstr2), \"INSERT INTO `kserace` (`RaceNr` ,`RaceName` ,`RaceCreator` ,`raceX` ,`raceY` ,`raceZ`) VALUES ( NULL , \'%s\' , \'\', \'%f\', \'%f\', \'%f\');\", racen, X[playerid], Y[playerid], Z[playerid]);mysql_function_query(FCH, rnstr2, true, \"SaveChoords\", \"\");}finishtick = GetTickCount() - starttick;DisablePlayerRaceCheckpoint(playerid);RaceInfos[playerid][isBuilder] = 0;CPNumber[playerid] = 0;format(sikerstring, sizeof(sikerstring), \"Sikeresen létrehoztad a {eb1717} %s {17eb17} nevü versenypályát.\\nA versenypálya lementve{eb1717} %d {17eb17}ms alatt!\\nKoordináták \"VOROS_K\"MySQL\"ZOLD_K\"-re lettek mentve!\", racen, finishtick);ShowPlayerDialog(playerid, DIALOG_FRACE, DIALOG_STYLE_MSGBOX, \"Race System\",sikerstring,\"Kilépés\",\"\");printf(\"%s egy új pályát készített || A pálya neve:%s\", PName(playerid), racen);}return 1;}
INSERT INTO `hotel`(`foglalasido`, `naphosz`) VALUES ( NOW(), 33), ( NOW(), 63), ( NOW(), 38), ( NOW(), 34)
rnstr2 = \"INSERT INTO `kserace` (`RaceNr` ,`RaceName` ,`RaceCreator` ,`raceX` ,`raceY` ,`raceZ`) VALUES\"; for(new i = 0; i < CPNumber[playerid];i++) { format(qstr, sizeof(qstr), \"%s ( NULL , \'%s\' , \'%s\', \'%f\', \'%f\', \'%f\'),\",qstr, racen, PName(playerid), X[playerid], Y[playerid], Z[playerid]); } format(savequery, sizeof(savequery), \"%s %s ( NULL , \'%s\' , \'%s\', \'%f\', \'%f\', \'%f\');\",rnstr2, qstr, racen, PName(playerid), X[playerid][CPNumber[playerid]], Y[playerid][CPNumber[playerid]], Z[playerid][CPNumber[playerid]]); format(query, sizeof(query), \"SELECT * FROM `kserace` WHERE `RaceName` = \'%s\'\", inputtext); mysql_function_query(FCH, query, true, \"CheckRaceName\", \"ds\",playerid, racen);
new bigstring[4000];
\'%s\' , \'%s\', \'%f\', \'%f\', \'%f\')
\'%s\',\'%s\',\'%f\',\'%f\',\'%f\')
new qstr[4000];
if(dialogid == DIALOG_CRACE) { if(response == 1) { if((strlen(inputtext) < 1)) { SendClientMessage(playerid, VOROS, \"A név minimum 1 karakter hosszú kell hogy legyen!\"); PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0); ShowPlayerDialog(playerid, DIALOG_CRACE, DIALOG_STYLE_INPUT, \"Race System\", \"\"VOROS_K\"HIBA:A név minimum 1 karakter kell hogy legyen!\\n\"ZOLD_K\"Írj egy nevet a pályanak!\", \"Elfogad\", \"\"); } else { new rnstr2[256]; new racen[100]; format(racen, sizeof(racen), \"%s\", inputtext); rnstr2 = \"INSERT INTO `kserace` (`RaceNr`,`RaceName`,`RaceCreator`,`raceX`,`raceY`,`raceZ`) VALUES\"; for(new i = 0; i < CPNumber[playerid];i++) { format(qstr, sizeof(qstr), \"%s( NULL ,\'%s\' ,\'%s\',\'%f\',\'%f\',\'%f\'),\",qstr, racen, PName(playerid), X[playerid], Y[playerid], Z[playerid]); } format(qstr, sizeof(qstr), \"%s %s ( NULL ,\'%s\' ,\'%s\',\'%f\',\'%f\',\'%f\');\",rnstr2, qstr, racen, PName(playerid), X[playerid][CPNumber[playerid]], Y[playerid][CPNumber[playerid]], Z[playerid][CPNumber[playerid]]); format(query, sizeof(query), \"SELECT * FROM `kserace` WHERE `RaceName` = \'%s\'\", inputtext); mysql_function_query(FCH, query, true, \"CheckRaceName\", \"ss\",playerid, racen); } } return 1;}
forward CheckRaceName(playerid, racen[]);public CheckRaceName(playerid, racen[]) {new rows, fields;cache_get_data(rows, fields);printf(\"rows:%d\", rows);if(rows) {ShowPlayerDialog(playerid, DIALOG_CRACE, DIALOG_STYLE_INPUT, \"Race System\", \"\"VOROS_K\"HIBA:Ilyen nevû versenypályánk már van!\"ZOLD_K\"Írj egy nevet a pályanak!\", \"Elfogad\", \"\");} else { printf(\"g:%d\", playerid); mysql_function_query(FCH, qstr, true, \"SaveChoords\", \"ss\", playerid,racen);}return 1;}
forward SaveChoords(playerid,racen);public SaveChoords(playerid,racen) { new sikerstring[300]; DisablePlayerRaceCheckpoint(playerid);RaceInfos[playerid][isBuilder] = 0;CPNumber[playerid] = 0;format(sikerstring, sizeof(sikerstring), \"Sikeresen létrehoztad a {eb1717} %s {17eb17} nevü versenypályát.\\nA versenypálya lementve MYSQL-re!\", racen);ShowPlayerDialog(playerid, DIALOG_FRACE, DIALOG_STYLE_MSGBOX, \"Race System\",sikerstring,\"Kilépés\",\"\");printf(\"%s egy új pályát készített || A pálya neve:%s\", PName(playerid), racen);return 1;}