Kol9n99
Ученик
Всем привет. Сделал склад. Хочу чтоб все что было притащено в склад сохранялось на mysql. Помогите плизз.
Вот код:
А вот сам savestorage
В чем может быть проблема?
Вот код:
PHP:
else if(GetPVarInt(playerid,"CHECKPOINTID") == 10 && !IsPlayerInAnyVehicle(playerid) && IsPlayerInRangeOfPoint(playerid, 5.0, 2360.3162,-647.9174,128.2331))
{
new idx = 1;
SetPlayerSpecialAction (playerid, SPECIAL_ACTION_NONE);
new rand = random(sizeof(RandomSaw));
new les = GetPVarInt(playerid,"Les");
if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
SetPVarInt(playerid,"JobMoney",GetPVarInt(playerid,"JobMoney")+30);
format(string,32,"~g~+30$~n~~b~TOTAL:~w~ %i$",GetPVarInt(playerid,"JobMoney"));
GameTextForPlayer(playerid,string, 5000, 1);
ClearAnimations(playerid);
StorageInfo[idx][stValue]+=les;
SaveStorage();
SendClientMessage(playerid,COLOR_WHITE,"Âû ïðèíåñëè äåðåâî, ïðîäîëæàéòå ñâîþ ðàáîòó!");
SetPlayerCheckpoint(playerid, RandomSaw[rand][0], RandomSaw[rand][1], RandomSaw[rand][2], 2.0);
}
return true;
}
public ChainSaw(playerid)
{
ClearAnimations(playerid);
SetPlayerCheckpoint(playerid, 2360.3162,-647.9174,128.2331, 2.0);
new randomles = randomEx(1,4);
SetPVarInt(playerid,"CHECKPOINTID",10);
SetPVarInt(playerid,"Saw",0);
SetPVarInt(playerid,"Les",randomles);
SendClientMessage(playerid,COLOR_WHITE,"Âû óñïåøíî ñïèëèëè äåðåâî, îòíåñèòå åãî íà ñêëàä");
return true;
}
PHP:
public SaveStorage()
{
for(new idx = 1; idx <= TOTALENTERS; idx++) {
new temp[128];
mysql_format(DATABASE, QUERY, sizeof(QUERY), "UPDATE `"TABLE_STORAGE"` SET ");
format(temp,sizeof(temp),"`stID`= '%i',",StorageInfo[idx][stID]);strcat(QUERY,temp,sizeof(QUERY));
format(temp,sizeof(temp),"`stValue`= '%i',",StorageInfo[idx][stValue]);strcat(QUERY,temp,sizeof(QUERY));
format(temp,sizeof(temp),"`stX`= '%f',",StorageInfo[idx][stX]);strcat(QUERY,temp,sizeof(QUERY));
format(temp,sizeof(temp),"`stY`= '%f',",StorageInfo[idx][stY]);strcat(QUERY,temp,sizeof(QUERY));
format(temp,sizeof(temp),"`stZ`= '%f',",StorageInfo[idx][stZ]);strcat(QUERY,temp,sizeof(QUERY));
format(temp,sizeof(temp),"`stV`= '%i',",StorageInfo[idx][stV]);strcat(QUERY,temp,sizeof(QUERY));
format(temp,sizeof(temp),"`stI`= '%i',",StorageInfo[idx][stI]);strcat(QUERY,temp,sizeof(QUERY));
format(temp,sizeof(temp),"`stName`= '%s',",StorageInfo[idx][stName]);strcat(QUERY,temp,sizeof(QUERY));
format(temp,sizeof(temp)," WHERE stID = '%i'",StorageInfo[idx][stID]);strcat(QUERY,temp,sizeof(QUERY));
mysql_function_query(DATABASE, QUERY, true, "", ""); }
return true;
}
