Raised This Month: $ Target: $400
 0% 

I Need Help To Fix My Store Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FoxyTheDeveloper
Junior Member
Join Date: Jun 2020
Old 06-03-2020 , 08:18   I Need Help To Fix My Store Plugin
Reply With Quote #1

This is the code if you are actually can fix this so please send me the fixed code

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);
}
FoxyTheDeveloper is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 06-03-2020 , 09:42   Re: I Need Help To Fix My Store Plugin
Reply With Quote #2

This is AmxModX section.
Be more explicit. What does not work?
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]

Last edited by Shadows Adi; 06-03-2020 at 09:42.
Shadows Adi is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode