SA-MP Forums Archive
Help removing color tags from string and what does mysql_function_query returns? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help removing color tags from string and what does mysql_function_query returns? (/showthread.php?tid=362211)



Help removing color tags from string and what does mysql_function_query returns? - Ranama - 23.07.2012

Hello, I'm making my car-plate system. so I need to take away all the color tags from the string they input as car-plate so i can compare the data to the others and see that the car-plate is unique, so the first question is what how can i take away color tags from a string?, I've thought of sscanf(string, "p<{cccccc}>%s[9]") or something like that but i don't think it's going to work.

The secound question is what does mysql_function_query returns?
I need to know if there is any rows or not so what I've done is
Код:
stock CheckIfUsedCarPlate(string[]){
	sscanf(string, "p<{cccccc}>"
	new query[200];
 	format(query, sizeof(query), "SELECT carid FROM publiccars WHERE platenum = '%s'", string);
 	if(mysql_function_query(dbHandle, query, true, "CheckRows", "") == 0) return 0;
	else return 1;
}
public CheckRows(){
    new rows, fields;
    cache_get_data(rows, fields);
    if(rows) return 1;
    else return 0;
}
Will that work? otherwise what should i do?

Thanks for all answers


Re: Help removing color tags from string and what does mysql_function_query returns? - Ranama - 23.07.2012

I succeded to fix remove color codes by using strfind, strdel, etc, but i still want the answer of the 2nd question (what does mysql_function_query returns?)