03.01.2018, 15:23
I did try something on saving dropped weed packs but i get this error in console when starting server.
YSI Warning: y_malloc set up via "CallLocalFunction", memory corruption is a remote possibility
What am i doing wrong?
saving:
loading:
YSI Warning: y_malloc set up via "CallLocalFunction", memory corruption is a remote possibility
What am i doing wrong?
saving:
Код:
if(strval(inputtext) > PlayerWeedInfo[playerid][Weed][DrugsList[playerid][ListChoice[playerid]]] || strval(inputtext) <= 0) return SendClientMessage(playerid, -1, "{FF0000}ERROR: {FFFFFF}You do not have that amount of drugs."); new lootID = Iter_Free(Loots), Float:PPosX,Float:PPosY,Float:PPosZ, file[64]; new slot = DrugsList[playerid][ListChoice[playerid]]; GetPlayerPos(playerid, PPosX, PPosY, PPosZ); PlayerWeedInfo[playerid][Weed][slot] -= strval(inputtext); LootInfo[lootID][LootX] = PPosX; LootInfo[lootID][LootY] = PPosY-0.1060; LootInfo[lootID][LootZ] = PPosZ-1; LootInfo[lootID][lObjectID] = CreateDynamicObject(1575, PPosX, PPosY-0.1060, PPosZ-1, 0, 0, 0); new title[124]; format(title, sizeof title, "{E1E858}[%i grams of %s] Press 'C' to pickup", strval(inputtext), SeedInformation[slot][SeedName]); new string[128]; format(string, sizeof string, "* {E1E858}You have packed and dropped %i grams of %s; %i left.", strval(inputtext), SeedInformation[slot][SeedName], PlayerWeedInfo[playerid][Weed][DrugsList[playerid][ListChoice[playerid]]]); SendClientMessage(playerid, -1, string); LootInfo[lootID][lLabel] = CreateDynamic3DTextLabel(title, -1, PPosX, PPosY-0.1060, PPosZ-0.8, 5); LootInfo[lootID][wGrams] = strval(inputtext); LootInfo[lootID][wType] = slot; Iter_Add(Loots, lootID); foreach(new i : Loots) { format(file, sizeof(file), "Loot/weed/%d.ini", i); INI_Create(file); INI_IntSet(file,"LootX",floatround(LootInfo[i][LootX])); INI_IntSet(file,"LootY",floatround(LootInfo[i][LootY])); INI_IntSet(file,"LootZ",floatround(LootInfo[i][LootY])); INI_IntSet(file,"lObjectID",LootInfo[i][lObjectID]); INI_IntSet(file,"wGrams", LootInfo[i][wGrams]); INI_IntSet(file,"wType", LootInfo[i][wType]); }
Код:
stock LoadDroppedWeedPacks( ) { new file[25], count = 0; for(new i=1; i < MAX_LOOTS; i++) { format(file, sizeof(file), "Loot/weed/%d.ini", i); if(!fexist(file))return 0; count ++; LootInfo[i][LootX]=INI_Int(file,"LootX"); LootInfo[i][LootY]=INI_Int(file,"LootY"); LootInfo[i][LootZ]=INI_Int(file,"LootZ"); LootInfo[i][lObjectID]=INI_Int(file,"lObjectID"); LootInfo[i][wGrams]=INI_Int(file,"wGrams"); LootInfo[i][wType]=INI_Int(file,"wType"); new lootID = Iter_Free(Loots); LootInfo[i][lObjectID] = CreateDynamicObject(1575, LootInfo[i][LootX], LootInfo[i][LootY]-0.1060, LootInfo[i][LootZ]-1, 0, 0, 0); new title[124], weedname[25]; if(LootInfo[i][wType]==0){weedname="White Widow";} if(LootInfo[i][wType]==1){weedname="Purple Haze";} if(LootInfo[i][wType]==2){weedname="Choco Kush";} format(title, sizeof title, "{E1E858}[%i grams of %s] Press 'C' to pickup", LootInfo[i][wGrams], weedname); LootInfo[i][lLabel] = CreateDynamic3DTextLabel(title, -1, LootInfo[i][LootX], LootInfo[i][LootY]-0.1060, LootInfo[i][LootZ]-0.8, 5); Iter_Add(Loots, lootID); LoadDroppedWeedPacks( ); } printf(" Loaded %d dropped weed packs", count); return 1; }