AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   I Need Help To Fix My Store Plugin (https://forums.alliedmods.net/showthread.php?t=324974)

FoxyTheDeveloper 06-03-2020 08:18

I Need Help To Fix My Store Plugin
 
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);
}


Shadows Adi 06-03-2020 09:42

Re: I Need Help To Fix My Store Plugin
 
This is AmxModX section.
Be more explicit. What does not work?


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

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