AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   error name>Exception reported: Instruction contained invalid parameter (https://forums.alliedmods.net/showthread.php?t=310374)

kdaekiss 08-31-2018 23:44

error name>Exception reported: Instruction contained invalid parameter
 
Hello, that's the same error name as the title. Compile works well.

The code below is hook

Code:

public Action:SayHook(Client, Arguments)
The code below does not even operate an error message during the operation.
Code:

if(StrContains(Msg[1], "!강화포인트") != -1)
                {
                        if(!StrEqual(s_Buffer[1], "", false) || !StrEqual(s_Buffer[2], "", false))
                        {
                                new Target = GetTargetToName(s_Buffer[1]);
                                new wuppoint = StringToInt(s_Buffer[2]);
                                if(Target == -1)
                                {
                                        PrintToChat(Client, "\x070FF0FF[%s]\x01이라는 닉네임이 없습니다.", s_Buffer[1]);
                                        return Plugin_Handled;
                                }
                                if(Target == 0)
                                {
                                        PrintToChat(Client, "\x070FF0FF중복되는 사람이 있습니다.");
                                        return Plugin_Handled;
                                }
                                GetClientName(Target, s_Name, sizeof(s_Name));
                                PrintToChat(Client, "\x070FF0FF[%s]\x01님에게 강화 포인트를\x03[%d]\x01포인트를 드렸습니다.", s_Name, wuppoint);
                                PrintToChat(Target, "\x070FF0FF[Admin]\x01님께서 강화 포인트를\x03[%d]\x01포인트를 드렸습니다.", wuppoint);
                                wup[Target] += wuppoint;
                        }
                        else PrintToChat(Client, "\x070FF0FF사용법 : \x03!강화포인트 <닉네임> <포인트>");
                        return Plugin_Handled;
                }
        }
        return Plugin_Continue;
}

help me plz.. **The translation may be rather awkward.

This Game is CS:S

Fyren 09-01-2018 07:14

Re: error name>Exception reported: Instruction contained invalid parameter
 
The error means SM thinks there's something wrong with the compiled code.

You can try using the latest SM and compiler (either 1.9 or 1.10). If you already are, then you should provide the actual source code you're compiling.

If you're using an older versions of SM or the compiler (or ones you've modified), you're on your own.

Just for testing, I tried the following code with the 1.9 compiler:

PHP Code:

public void OnPluginStart() {
    
foo();
}

int GetTargetToName(char[] s) { return 1; }

public 
Action foo() {
    
int Client 1;
    
int wup[2];
    
char Msg[2][64] = { """!강화포인트" };
    
char s_Buffer[3][64] = { "a""b""3" };
    
char s_Name[64];

    if(
StrContains(Msg[1], "!강화포인트") != -1)
    {
        if(!
StrEqual(s_Buffer[1], ""false) || !StrEqual(s_Buffer[2], ""false))
        {
            new 
Target GetTargetToName(s_Buffer[1]);
            new 
wuppoint StringToInt(s_Buffer[2]);
            if(
Target == -1)
            {
                
PrintToChat(Client"\x070FF0FF[%s]\x01이라는 닉네임이 없습니다."s_Buffer[1]);
                return 
Plugin_Handled;
            }
            if(
Target == 0)
            {
                
PrintToChat(Client"\x070FF0FF중복되는 사람이 있습니다.");
                return 
Plugin_Handled;
            }
            
GetClientName(Targets_Namesizeof(s_Name));
            
PrintToServer("\x070FF0FF[%s]\x01님에게 강화 포인트를\x03[%d]\x01포인트를 드렸습니다."s_Namewuppoint);
            
//PrintToChat(Client, "\x070FF0FF[%s]\x01님에게 강화 포인트를\x03[%d]\x01포인트를 드렸습니다.", s_Name, wuppoint);
            
PrintToServer("\x070FF0FF[Admin]\x01님께서 강화 포인트를\x03[%d]\x01포인트를 드렸습니다."wuppoint);
            
//PrintToChat(Target, "\x070FF0FF[Admin]\x01님께서 강화 포인트를\x03[%d]\x01포인트를 드렸습니다.", wuppoint);
            
wup[Target] += wuppoint;
        }
        else 
PrintToServer("\x070FF0FF사용법 : \x03!강화포인트 <닉네임> <포인트>");
        
//else PrintToClient(Client, "\x070FF0FF사용법 : \x03!강화포인트 <닉네임> <포인트>");
        
return Plugin_Handled;
    }
    return 
Plugin_Continue;


It compiles and runs. I see the two expected lines printed.

kdaekiss 09-01-2018 10:15

Re: error name>Exception reported: Instruction contained invalid parameter
 
1 Attachment(s)
The compiler works well. Please check attached file and the error name is displayed in srcds.

PrintToChat works well on other systems No problem. And is the code CS:S? Or Is it strange how I write it?code

It's a new code that doesn't fit into my eyes.

Don't get me wrong. It's not a question. I'm curious, and if there's anything wrong, I'm trying to fix it.


All times are GMT -4. The time now is 06:46.

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