08.06.2012, 23:25
Hey guy's i'm trying to add one variable to my faction table so i can save what map icon type they have. It says that it saves but it does not change in the table, no errors or warnings are shown.
My Stock For Saving
The Command
Command For Saving Tables
My Stock For Saving
pawn Код:
stock saveGroup(const id) {
if(strlen(groupVariables[id][gGroupName]) >= 1) {
format(szLargeString, sizeof(szLargeString), "UPDATE groups SET groupName = '%s', groupHQExteriorPosX = '%f', groupHQExteriorPosY = '%f', groupHQExteriorPosZ = '%f'", groupVariables[id][gGroupName], groupVariables[id][gGroupExteriorPos][0], groupVariables[id][gGroupExteriorPos][1], groupVariables[id][gGroupExteriorPos][2]);
format(szLargeString, sizeof(szLargeString), "%s, groupHQInteriorID = '%d', groupHQLockStatus = '%d', groupHQInteriorPosX = '%f', groupHQInteriorPosY = '%f', groupHQInteriorPosZ = '%f', groupSafeMoney = '%d', groupSafeMats = '%d', groupMOTD = '%s'", szLargeString, groupVariables[id][gGroupHQInteriorID],
groupVariables[id][gGroupHQLockStatus], groupVariables[id][gGroupInteriorPos][0], groupVariables[id][gGroupInteriorPos][1], groupVariables[id][gGroupInteriorPos][2], groupVariables[id][gSafe][0], groupVariables[id][gSafe][1], groupVariables[id][gGroupMOTD]);
format(szLargeString, sizeof(szLargeString), "%s, groupRankName1 = '%s', groupRankName2 = '%s', groupRankName3 = '%s', groupRankName4 = '%s', groupRankName5 = '%s', groupRankName6 = '%s'", szLargeString, groupVariables[id][gGroupRankName1], groupVariables[id][gGroupRankName2], groupVariables[id][gGroupRankName3], groupVariables[id][gGroupRankName4], groupVariables[id][gGroupRankName5], groupVariables[id][gGroupRankName6]);
format(szLargeString, sizeof(szLargeString), "%s, groupSafePosX = '%f', groupSafePosY = '%f', groupSafePosZ = '%f', groupType = '%d' gMapIconID = '%d' WHERE groupID = '%d'", szLargeString, groupVariables[id][gSafePos][0], groupVariables[id][gSafePos][1], groupVariables[id][gSafePos][2], groupVariables[id][gGroupType], groupVariables[id][gMapIconID], id );
mysql_query(szLargeString);
}
else {
return 0;
}
return 1;
}
pawn Код:
CMD:gmapicon(playerid, params[]) {
if(playerVariables[playerid][pAdminLevel] >= 4) {
new
groupID,
groupMapIcon;
if(sscanf(params, "dd", groupID, groupMapIcon))
return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/gtype [groupid] [mapiconid]");
if(groupID > 0 && groupID < MAX_GROUPS) {
format(szMessage, sizeof(szMessage), "You have set group %s's group type to %d.", groupVariables[groupID][gGroupName], groupMapIcon);
SendClientMessage(playerid, COLOR_WHITE, szMessage);
groupVariables[groupID][gMapIconID] = groupMapIcon;
} else return SendClientMessage(playerid, COLOR_GREY, "Invalid Group ID!");
}
return 1;
}
pawn Код:
CMD:savedata(playerid, params[]) {
if(playerVariables[playerid][pAdminLevel] >= 5) {
foreach(Player, x) {
savePlayerData(x);
}
SendClientMessage(playerid, COLOR_YELLOW, "Player data saved.");
for(new xh = 0; xh < MAX_HOUSES; xh++) {
saveHouse(xh);
}
SendClientMessage(playerid, COLOR_YELLOW, "House data saved.");
for(new xf = 0; xf < MAX_GROUPS; xf++) {
saveGroup(xf);
}
SendClientMessage(playerid, COLOR_YELLOW, "Group data saved.");
for(new xf = 0; xf < MAX_BUSINESSES; xf++) {
saveBusiness(xf);
}
SendClientMessage(playerid, COLOR_YELLOW, "Business data saved.");
for(new xf = 0; xf < MAX_ASSETS; xf++) {
saveAsset(xf);
}
SendClientMessage(playerid, COLOR_YELLOW, "Server asset data saved.");
}
return 1;
}