Jump to content
  • 0

SQLite format a big string...(lam fakt din nou ca vechiul a fost sters)



salls...am vazut ca multe posturi au fost sterse si cel care lam fakt inainte de a se inchide sa-mp.ro(perioada asta)

deci aici la SQLite, la OnPlayerDisconnect am asta:

format(Query, sizeof(Query), "UPDATE `ClanStats` SET (`ClanKills` = '%d', `ClanDeaths` = '%d') WHERE `ClanName` = '%s'",P_DATA[playerid][ClanKills], P_DATA[playerid][ClanDeaths]);
	db_free_result(db_query(Database, Query));
	format(Query, sizeof(Query), "UPDATE `ClanMembers` SET (`Member1` = '%s', `Member2` = '%s', `Member3` = '%s', `Member4` = '%s', `Member5` = '%s', `Member6` = '%s', `Member7` = '%s', `Member8` = '%s', `Member9` = '%s', `Member10` = '%s') WHERE `ClanSef` = '%s'", P_DATA[[playerid][Member1], P_DATA[[playerid][Member2], P_DATA[[playerid][Member3], P_DATA[[playerid][Member4], P_DATA[[playerid][Member5], P_DATA[[playerid][Member6], P_DATA[[playerid][Member7], P_DATA[[playerid][Member8], P_DATA[[playerid][Member9], P_DATA[[playerid][Member10], P_DATA[playerid][ClanSef]);
	db_free_result(db_query(Database, Query));
	return 1;

si imi da errorile ca formatul al doile este prea lung, si as vrea sa il scurtez...dar nu prea stiu cum...

Fara reclama in semnatura!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Guest farse

Il obligi sa aiba doar 10 membrii?Puteai sa le iei ID-urile primare din DB la fiecare si sa le idexezi intr-o variabila(gen:P_DATA[playerid][Members]="0,10,30,50,70" si cand aveai nevoie de numele lor SELECT `name` FROM `members` WHERE `Sef`='%s'" ,eh ,fa cum vrei :) )

P_DATA[[playerid][Member1], P_DATA[[playerid][Member2]

de ce P_DATA[[playerid][Member1], ? eh,il pot face in 2 linii

format(Query, sizeof(Query), "UPDATE `ClanMembers` SET (`Member1` = '%s', `Member2` = '%s', `Member3` = '%s', `Member4` = '%s', `Member5` = '%s',P_DATA[playerid][Member1], P_DATA[playerid][Member2], P_DATA[playerid][Member3], P_DATA[playerid][Member4], P_DATA[playerid][Member5]);
format(Query, sizeof Query , "%s`Member6` = '%s', `Member7` = '%s', `Member8` = '%s', `Member9` = '%s', `Member10` = '%s') WHERE `ClanSef` = '%s'",Query,  P_DATA[playerid][Member6], P_DATA[playerid][Member7], P_DATA[playerid][Member8], P_DATA[playerid][Member9], P_DATA[playerid][Member10], P_DATA[playerid][ClanSef])

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.