Код:
CMD:ujfrakcio(playerid, params[])
{
new string[80], f_name[30], f_type, count;
if(sscanf(params, "s[30]i", f_name, f_type))
return SendClientMessage(playerid, -1, "/ujfrakcio [nйv] [tнpus]");
format(string, sizeof(string), "Frakciу elkйszнtve! SQLID:%d FrakciуNйv: %s Tнpusa: %d!", count, f_name, f_type);
SendClientMessage(playerid, -1, string);
new query[2000];
mysql_format(mysql, query, sizeof(query), "INSERT INTO factions (fName, fType) VALUES ('%e', %i)", query, f_name, f_type);
mysql_tquery(mysql, query);
fData[count][fID] = count;
fData[count][fName] = f_name;
fData[count][fType] = f_type;
count ++;
return 1;
}
I create faction and sql table: fName: empty and fType: random number...(103,97,71,0)
Код:
mysql_format(mysql, query, sizeof(query), "INSERT INTO factions (fName, fType) VALUES ('%e', %i)", query, f_name, f_type);
Remove the red text. It takes empty string as name and the name as type because of that.