Car component saving [SQL] - 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: Car component saving [SQL] (
/showthread.php?tid=445640)
Car component saving [SQL] -
SMW - 22.06.2013
pawn Код:
else if(enterexit == 0) {
if(GetPVarInt(playerid, "pC") == 1) {
playerVariables[playerid][pMoney] = GetPVarInt(playerid,"lastUang");
playerVariables[playerid][pMoney] -= 20;
SendClientMessage(playerid, COLOR_WHITE, "Anda dikenakan biaya pajak sebesar $20");
DeletePVar(playerid, "pC");
DeletePVar(playerid, "lastUang");
}
foreach(Player, v) {
if(GetPlayerVehicleID(playerid) == playerVariables[v][pCarID][GetPlayerVehicleSlot(playerid)]) {
for(new i = 0; i < 14; i++) {
if(GetPlayerVehicleSlot(playerid) == 0) playerVariables[v][pCarMods1][i] = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), i);
else if(GetPlayerVehicleSlot(playerid) == 1) playerVariables[v][pCarMods2][i] = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), i);
else if(GetPlayerVehicleSlot(playerid) == 2) playerVariables[v][pCarMods3][i] = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), i);
else if(GetPlayerVehicleSlot(playerid) == 3) playerVariables[v][pCarMods4][i] = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), i);
else if(GetPlayerVehicleSlot(playerid) == 4) playerVariables[v][pCarMods5][i] = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), i);
}
}
}
}
its the function to get vehicle component saved into variables, i dont know what is wrong, but the component slot 0 is not saved, any help ?
Here's the code of saving into SQL
pawn Код:
format(saveQuery, sizeof(saveQuery), "%s, playerCar1Mod = '%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d'", saveQuery, playerVariables[playerid][pCarMods1][0], playerVariables[playerid][pCarMods1][1], playerVariables[playerid][pCarMods1][2], playerVariables[playerid][pCarMods1][3], playerVariables[playerid][pCarMods1][4], playerVariables[playerid][pCarMods1][5],
playerVariables[playerid][pCarMods1][6], playerVariables[playerid][pCarMods1][7], playerVariables[playerid][pCarMods1][8], playerVariables[playerid][pCarMods1][9], playerVariables[playerid][pCarMods1][10], playerVariables[playerid][pCarMods1][11], playerVariables[playerid][pCarMods1][12], playerVariables[playerid][pCarMods1][12]);