AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Need some help with this (https://forums.alliedmods.net/showthread.php?t=334200)

Nubbe 09-05-2021 17:42

Need some help with this
 
i cant seem to figure out why this gives me errors

Code:

       
        char Target[64];
        char cl[32];
        GetCmdArg(1, Target, sizeof(Target));
        GetCmdArg(2, cl, sizeof(cl));

        char target_name[MAX_TARGET_LENGTH];
        int target_list[MAXPLAYERS], target_count;
        bool tn_is_ml;
 
        if ((target_count = ProcessTargetString(
                        Target,
                        client,
                        target_list,
                        MAXPLAYERS,
                        COMMAND_FILTER_CONNECTED,
                        target_name,
                        sizeof(target_name),
                        tn_is_ml)) <= 0)
        {
                void ReplyToTargetError (int client, int target_count)
                return Plugin_Handled;
        }

And it gives these errors when i compile
test.sp(53) : warning 219: local variable "ReplyToTargetError" shadows a variable at a preceding level
test.sp(53) : error 001: expected token: ";", but found "("
test.sp(53) : error 029: invalid expression, assumed zero
test.sp(53) : error 029: invalid expression, assumed zero
test.sp(53) : fatal error 190: too many error messages on one line

Psyk0tik 09-05-2021 17:46

Re: Need some help with this
 
Change this:
PHP Code:

void ReplyToTargetError (int clientint target_count

To this:
PHP Code:

ReplyToTargetError(clienttarget_count); 


Nubbe 09-05-2021 17:49

Re: Need some help with this
 
But isnt that old syntax ? because it works with that and when i then compile it, it doesnt give a replytotargeterror in chat ingame

And gives these errors in console

Code:

L 09/05/2021 - 23:51:37: [SM]  [0] ReplyToCommand
L 09/05/2021 - 23:51:37: [SM]  [1] Line 102, C:\Users\xxxxxDesktop\xxxxx\csgo\addons\sourcemod\scripting\include\commandfilters.inc::ReplyToTargetError
L 09/05/2021 - 23:51:37: [SM]  [2] Line 53, test.sp::Command_SetCT


Psyk0tik 09-05-2021 17:56

Re: Need some help with this
 
Quote:

Originally Posted by Nubbe (Post 2757035)
But isnt that old syntax ? because it works with that and when i then compile it, it doesnt give a replytotargeterror in chat ingame

And gives these errors in console

Code:

L 09/05/2021 - 23:51:37: [SM]  [0] ReplyToCommand
L 09/05/2021 - 23:51:37: [SM]  [1] Line 102, C:\Users\xxxxxDesktop\xxxxx\csgo\addons\sourcemod\scripting\include\commandfilters.inc::ReplyToTargetError
L 09/05/2021 - 23:51:37: [SM]  [2] Line 53, test.sp::Command_SetCT


The usage is still the same in both old and new syntax. You're confusing the function prototype with how it's used in actual code.

You need to post the full stack trace for that error if you want help. It's hard to tell what the error is without the "Exception reported" line.

Nubbe 09-05-2021 18:09

Re: Need some help with this
 
L 09/06/2021 - 00:03:08: "whattadoggo<2><STEAM_1:0:105693675><CT>" say "!setct nubbe surf"
L 09/06/2021 - 00:03:08: [SM] Exception reported: Language phrase "No matching client" not found (arg 4)
L 09/06/2021 - 00:03:08: [SM] Blaming: test.smx
L 09/06/2021 - 00:03:08: [SM] Call stack trace:
L 09/06/2021 - 00:03:08: [SM] [0] ReplyToCommand
L 09/06/2021 - 00:03:08: [SM] [1] Line 102, C:\Users\xxxxx\Desktop\xxx\csgo\addons\source mod\scripting\include\commandfilters.inc::Rep lyToTargetError
L 09/06/2021 - 00:03:08: [SM] [2] Line 54, test.sp::Command_SetCT

Nubbe 09-05-2021 18:13

Re: Need some help with this
 
I figured it out im stupid nvm Thank you very much dude

Nubbe 09-05-2021 18:13

Re: Need some help with this
 
Fixed with adding
Code:

public void OnPluginStart()
{
        RegAdminCmd("sm_setct", Command_SetCT, ADMFLAG_SLAY, "Set players clan tag");
        LoadTranslations("common.phrases");
}



All times are GMT -4. The time now is 01:36.

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