Please If You Know How To fix So please send me the fixed code in PM
Code:
#include <sourcemod>
#pragma semicolon 1
#pragma newdecls required
static String:kvfile[PLATFORM_MAX_PATH];
static String:Items[200][3][200];
public Plugin:myinfo = {
name = "Store Plugin"
author = "Foxy and Eyal282"
description = ""
url = ""
};
public OnPluginStart()
{
CreateDirectory("/addons/sourcemod/Configs/StorePlugin");
BuildPath(Path_SM, kvfile, sizeof(kvfile), "Configs/StorePlugin/items.txt");
RegAdminCmd("sm_loaditems", commandloaditems, ADMFLAG_ROOT, "");
RegConsoleCmd("sm_showitems", commandshowitems, "");
loadItems();
}
public itemsmenuhandle(Handle:menu, MenuAction:action, client, itempos)
{
if(action == MenuAction_Select)
{
new String:item[6];
GetMenuItem(menu, itempos, item, sizeof(item));
if(SpawnEntity(StringToInt(item)));
{
} else {
}
} else if(action == MenuAction_End) {
CloseHandle(manu);
}
}
public bool:SpawnEntity(itemid)
{
new ent = CreateEntityByName("prop_dynamic");
if(ent != -1 && DispatchSpawn(ent) && IsVaildEntity(ent))
{
DispatchKeyValue(ent, "model", value);
}
}
public Action:commandshowitems(client, args)
{
new Handle:menuhandle = CreateMenu(itemsmenuhandle);
SetMenuTitle(menuhandle, "Welcome To The Store\nYour Credits: %d\nInfo:\nName - Price", Credits[client]);
new String:buffer[250], String:itemindex[6];
for(new i = 0, i < sizeof(items), i++)
{
if(StrEqual(items[i][0], ""))
{
Format(buffer, sizeof(buffer), "%s - %s", Items[i][0], Items[i][1]);
Format(buffer, sizeof(itemindex), "%d", i);
AddMenuItem(menuhandle, itemindex, buffer);
}
}
SetMenuPagination(menuhandle, 8);
SetMenuExitButton(menuhandle, false);
CloseHandle(menuhandle);
return Plugin_Handled
}
public Action:commandloaditems(client, args)
{
loadItems();
return Plugin_Handled
}
public loadItems()
{
new Handle:db = CreateKeyValues("Itemlist");
FileToKeyValues(db, kvfile);
if(KvJumpToKey(db, "Items", false))
{
new String:index[6];
for (new i = 0; i < sizeof(items);i++)
{
Format(index, sizeof(index), "%d", i);
KvGetString(db, index, buffer, sizeofbuffer, "NULLSTRING");
if(buffer[0] != EOS)
{
decl String:tempstring[2][200]
ExplodeString(buffer, "--", tempstring, 3, 200)
Items[i][0] = tempstring[0];
Items[i][1] = tempstring[1];
Items[i][1] = tempstring[2];
} else {
if(mode == 1)
{
}
}
}
return true;
}
else
return false;
CloseHandle(db);
}