Raised This Month: $51 Target: $400
 12% 

Solved [Thread is Non-Actual]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ler
New Member
Join Date: Aug 2023
Location: Russia
Old 08-27-2023 , 01:54   [Thread is Non-Actual]
Reply With Quote #1

Code:
Don't Reply

Last edited by Ler; 09-16-2023 at 03:55. Reason: Non-Actual
Ler is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 08-27-2023 , 02:56   Re: Plugin is not compiling
Reply With Quote #2

Quote:
Originally Posted by Ler View Post
While compiling i get this errors
don't use ChatGPT for write plugins
__________________
Grey83 is offline
q1085909155
Member
Join Date: Oct 2021
Old 08-27-2023 , 03:26   Re: Plugin is not compiling
Reply With Quote #3

Yes, this is a huge grammatical error
Code:
public MenuHandler1(Handle:menu, MenuAction:action, client, param2) // Menu Handler
{
    if (action == MenuAction_Select)
    {
        new String:info[64];
        GetMenuItem(menu, param2, info, sizeof(info));
        GetClientName(client, name, sizeof(name));
        if(strcmp(info, "WardenCreatePrikaz") == 0) // Create a order command
        {
            new Handle:wrdnorder = CreateMenu(MenuHandler1);
            SetMenuTitle(wrdnorder, "Напишите в чат ваш приказ"); //Menu Title
            AddMenuItem(wrdnorder, ""); //Menu Item 1
            AddMenuItem(wrdnorder, "Знак + перед текстом - переход на новую строку"); // Menu item 2
            AddMenuItem(wrdnorder, ""); // Menu item 3
            SetMenuExitBackButton(wrdnorder, true); // Sets a Exit and Back Button
            DisplayMenu(wrdnorder, client, 0); // Displays a menu
            public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs) // Client writes in chat
            {
                if (client && IsClientInGame(client) && JWP_IsWarden(client) && (g_CvarOrderAlways.BoolValue || g_bChatListen))
                {
                    if (sArgs[0] != '!' && sArgs[0] != '/' && sArgs[0] != '@')
                    {
                        g_bChatListen = false; 
                        CreateOrderMsg(client, sArgs); 
                        PrecacheSound("buttons\blip2.wav") // Precaches a sound
                        if (g_cOrderSound[0]) // Emit Sound
                        EmitSoundToAll(g_cOrderSound);
                        if (!g_CvarOrderAlways.BoolValue)
            
                        return Plugin_Handled;
                    }
                }
            }
        }
        if(strcmp(info, "WardenOpenAllCells") == 0) // Opens a all doors
        {
            AcceptEntityInput(func_door_rotating, "Open");
            AcceptEntityInput(func_door, "Open");
        }
        if(strcmp(info, "WardenCloseAllCells") == 0) // Closes a all doors
        {
            AcceptEntityInput(func_door_rotating, "Close"); 
            AcceptEntityInput(func_door, "Close");
        }
        if(strcmp(info, "WardenOpenCell") == 0) // Opens a door from the crosshair
        {
            int TiB_GetAimInfo(int client)
            {
                float origin[3], angles[3];
                GetClientEyePosition(client, origin);
                GetClientEyeAngles(client, angles);
                TR_TraceRayFilter(origin, angles, MASK_SHOT, RayType_Infinite, TraceFilter_Callback, client);
                if (!TR_DidHit()) return -1;
                return TR_GetEntityIndex();
            }

            public bool TraceFilter_Callback(int ent, int mask, int client)
            {
                return (client != ent);
            }

            bool TiB_IsDoor(const char[] classname)
            {
                return (StrContains(classname, "movelinear", false) || StrContains(classname, "door", false) || StrContains(classname, "plat", false) || StrContains(classname, "rotating", false) || StrContains(classname, "tracktrain", false));
            }
        }
        if(strcmp(info, "WardenResign") == 0) // Resign cmd
        {
            new Handle:wrdnresign = CreateMenu(MenuHandler1);
            SetMenuTitle(wrdnresign, "ВЫ ДЕЙСТВИТЕЛЬНО ХОТИТЕ ПОКИНУТЬ ПОСТ КОМАНДИРА?");
            AddMenuItem(wrdnresign, "");
            AddMenuItem(wrdnresign, "Да", "WardenResignYes"); 
            AddMenuItem(wrdnresign, "Нет", "WardenResignNo");
            SetMenuExitBackButton(wrdnresign, true);
            DisplayMenu(wrdnresign, client, 0);
        }
    }
}
q1085909155 is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 08-27-2023 , 12:04   Re: Plugin is not compiling
Reply With Quote #4

Quote:
Originally Posted by Ler View Post
FSA (FireWaLL Super Admin)
BIG piece of shitcode
__________________
Grey83 is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 08-27-2023 , 13:35   Re: EN: Plugin is not compiling, RU: Плагин не компилируется
Reply With Quote #5

Quote:
Originally Posted by Ler View Post
Я убрал куски кода плагина FSA (FireWaLL Super Admin)
PHP Code:
public WardenOpenCell();
{
    ...

    public 
bool TraceFilter_Callback(int entint maskint client)
    {
        ...
    }

    
bool TiB_IsDoor(const char[] classname)
    {
        ...
    }

В SourceРawn так писать нельзя.
You can't write like that in SourceРawn.

https://wiki.alliedmods.net/Category...eMod_Scripting
https://hlmod.net/forums/130/
__________________

Last edited by Grey83; 08-27-2023 at 13:36.
Grey83 is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 09-04-2023 , 14:14   Re: EN: Plugin is not compiling, RU: Плагин не компилируется
Reply With Quote #6

This is a way too complex task to give a simple answer to. It would take significant time for a sourcemod developer to rewrite the code that you provided and make it do what you want. You can have more luck in this "plugin request" thread, but unless you are ready to pay for the job you have to fix all the syntax errors by yourself and post here only small, specific questions which would not require much time to answer to.
The best way that I see is to throw out the garbage code and start writing new code with a clean slate where each line would be carefully thought about.
ChatGPT can be helpful here, but it still doesn't understand the context and shouldn't be used blindly.
kadet.89 is offline
Send a message via Skype™ to kadet.89
Reply



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 18:00.


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