AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need help in getting arg value with GetCmdArg (https://forums.alliedmods.net/showthread.php?t=338992)

itsJakub 08-08-2022 22:03

Need help in getting arg value with GetCmdArg
 
1 Attachment(s)
**closed**

Hello, thanks for any help in advance!
I am making a command plugin that does different things depending on the argument value (1 or 0). However, I am getting a loose identification error.

char arg[32];
GetCmdArg(1, arg, sizeof(arg));

int lgvalue = StringToInt(arg);

if (lgvalue = 1){

fysiks 08-08-2022 22:47

Re: Need help in getting arg value with GetCmdArg
 
This does not appear to be AMX Mod X code.

itsJakub 08-08-2022 23:18

Re: Need help in getting arg value with GetCmdArg
 
The solution to the sourcepawn script error (not AMX Mod X) was replacing spaces with a tab. After copying a line from someone who used spaces rather than tabbing over like in the rest of my script, decompile error 217 loose identation popped up. To my understanding you have to align code to fix error 217 in this case.

fysiks 08-09-2022 01:37

Re: Need help in getting arg value with GetCmdArg
 
For indentation warnings, other than the literal indentation consistency, a common issue is that people accidentally use both spaces and tabs for indentation.

FYI, if you want future help for SourcePawn, you'll get better support by posting in the SourceMod section of the forum (instead of here in the AMX Mod X section).


All times are GMT -4. The time now is 15:41.

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