PDA

View Full Version : Whats worng MYSQL max


luccagomes15
17/10/2015, 05:43 PM
(5613) : error 075: input line too long (after substitutions)
(5614) : error 037: invalid string (possibly non-terminated string)
(5614) : error 017: undefined symbol "INSERT"
(5614) : error 017: undefined symbol "INTO"
(5614) : fatal error 107: too many error messages on one line

5613 - `cargo1`, `cargo2`, `cargo3`, `cargo4`, `cargo5`, `cargo6`, `cargo7`, `cargo8`, `cargo9`, `cargo10`, `cargo11`, `cargo12`, `cargo13`, `cargo14`, `cargo15`) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s',\
5614 - '%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')"



public r@MySQL_CheckFaction(playerid, name[]) {
new field[11], exists;
cache_get_field_content(0, "exists", field, ConnectMYSQL);
exists = strval(field);

if(exists) {
// jŠ existe
return 1;
}

new cargocinco = 5;
new cargozero = 0;

new ept[30];
ept = "Empty";

new seunome[30];
seunome = PlayerName(playerid);

new query[1024];
format(query, sizeof(query), "INSERT INTO `factions` (`facname`, `membro1`, `membro2`, `membro3`, `membro4`, `membro5`, `membro6`, `membro7`, `membro8`, `membro9`, `membro10`, `membro11`, `membro12`, `membro13`, `membro14`, `membro15`,\
`cargo1`, `cargo2`, `cargo3`, `cargo4`, `cargo5`, `cargo6`, `cargo7`, `cargo8`, `cargo9`, `cargo10`, `cargo11`, `cargo12`, `cargo13`, `cargo14`, `cargo15`) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s',\
'%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')"
name,
seunome,
ept,
ept,
ept,
ept,
ept,
ept,
ept,
ept,
ept,
ept,
ept,
ept,
ept,
ept,
cargocinco,
cargozero,
cargozero,
cargozero,
cargozero,
cargozero,
cargozero,
cargozero,
cargozero,
cargozero,
cargozero,
cargozero,
cargozero,
cargozero,
cargozero,
cargozero);
mysql_function_query(ConnectMYSQL,query,true,"r@MySQL_CreateFaction","d",playerid);

new facid = fmembro[playerid];
FactionInfo[facid][facname][0] = EOS; // clear string
strcat(FactionInfo[facid][facname], name, 32); // 32 is the size of facname[32] in enum


FactionInfo[facid][membro1] = seunome;
FactionInfo[facid][membro2] = ept;
FactionInfo[facid][membro3] = ept;
FactionInfo[facid][membro4] = ept;
FactionInfo[facid][membro5] = ept;
FactionInfo[facid][membro6] = ept;
FactionInfo[facid][membro7] = ept;
FactionInfo[facid][membro8] = ept;
FactionInfo[facid][membro9] = ept;
FactionInfo[facid][membro10] = ept;
FactionInfo[facid][membro11] = ept;
FactionInfo[facid][membro12] = ept;
FactionInfo[facid][membro13] = ept;
FactionInfo[facid][membro14] = ept;
FactionInfo[facid][membro15] = ept;
FactionInfo[facid][facname] = name;

FactionInfo[facid][cargo1] = cargocinco;
FactionInfo[facid][cargo2] = cargozero;
FactionInfo[facid][cargo3] = cargozero;
FactionInfo[facid][cargo4] = cargozero;
FactionInfo[facid][cargo5] = cargozero;
FactionInfo[facid][cargo6] = cargozero;
FactionInfo[facid][cargo7] = cargozero;
FactionInfo[facid][cargo8] = cargozero;
FactionInfo[facid][cargo9] = cargozero;
FactionInfo[facid][cargo10] = cargozero;
FactionInfo[facid][cargo11] = cargozero;
FactionInfo[facid][cargo12] = cargozero;
FactionInfo[facid][cargo13] = cargozero;
FactionInfo[facid][cargo14] = cargozero;
FactionInfo[facid][cargo15] = cargozero;
return 1;
}
public r@MySQL_CreateFaction(playerid) {
new novafacid = cache_insert_id(ConnectMYSQL);
fmembro[playerid] = novafacid;
fcargo[playerid] = 5;
GivePlayerMoneyEx(playerid,-500000);
SendClientMessage(playerid,-1,"Faction successfully created!");
return 1;
}




CMD:fcreate(playerid,params[]) {
//new string[40],
new query[128], localfname[32];
if(sscanf(params,"s", localfname)) return SendClientMessage(playerid, -1, "Use: /fcreate [name]");
//if(scorelevel[playerid] < 500) return SendClientMessage(playerid, COLOR_RED, "VocÍ precisa ter score/level 500 para criar uma faction");
if(GetPlayerMoneyEx(playerid) < 500000) return SendClientMessage(playerid, COLOR_RED, "You do not have 500.000");
if(fmembro[playerid] > 0) return SendClientMessage(playerid, COLOR_RED, "VocÍ jŠ tem uma faction");

format(query,sizeof query,"SELECT COUNT(*) AS `exists` FROM factions WHERE facname='%s'",localfname);
mysql_function_query(ConnectMYSQL,query,true,"r@MySQL_CheckFaction","ds",playerid, localfname);
// /\ importante deixar o cache como TRUE.
return 1;
}

Kaperstone
17/10/2015, 05:51 PM
You will need to break format into two format's or use strcat

Why won't you break membro and cargo into two columns each ? one holding the number, the second holding what you wanted to store
so instead of having cargo15, you will just have :
cargoNum 15
cargoStore 'Whatsoever'

luccagomes15
18/10/2015, 01:53 PM
You will need to break format into two format's or use strcat

Why won't you break membro and cargo into two columns each ? one holding the number, the second holding what you wanted to store
so instead of having cargo15, you will just have :
cargoNum 15
cargoStore 'Whatsoever'



How to break in 2 parts or how to use strcat? Can give me a exemple?

And second part i dont understand, im learning english :(

luccagomes15
19/10/2015, 12:19 AM
??????????????????

luccagomes15
19/10/2015, 05:03 PM
Someone know do it? Pls!