Raised This Month: $ Target: $400
 0% 

Need help in getting arg value with GetCmdArg


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
itsJakub
New Member
Join Date: Aug 2022
Old 08-08-2022 , 22:03   Need help in getting arg value with GetCmdArg
Reply With Quote #1

**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){
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	42
Size:	41.3 KB
ID:	196218  

Last edited by itsJakub; 08-08-2022 at 22:53. Reason: posted in the wrong forum
itsJakub is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-08-2022 , 22:47   Re: Need help in getting arg value with GetCmdArg
Reply With Quote #2

This does not appear to be AMX Mod X code.
__________________
fysiks is offline
itsJakub
New Member
Join Date: Aug 2022
Old 08-08-2022 , 23:18   Re: Need help in getting arg value with GetCmdArg
Reply With Quote #3

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.
itsJakub is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-09-2022 , 01:37   Re: Need help in getting arg value with GetCmdArg
Reply With Quote #4

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).
__________________
fysiks is offline
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 15:42.


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