SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 31/10/2018, 11:09 AM   #1
Michatex
Little Clucker
 
Join Date: Apr 2015
Posts: 8
Reputation: 0
Default warning 214...

Hi.

Recently, I updated the compiler to the latest version.
Suddenly, there were such errors:

Code:
warning 214: possibly a "const" array argument was intended: "text"
warning 214: possibly a "const" array argument was intended: "string"
Code:
stock bool:IsStringValid(string[])
{
    new num;
    new len = strlen(string);
    for(new i; i < len; i++)
        switch(string[i])
        {
            case 'A'..'Z':num++;
            case 'a'..'z':num++;
            case '0'..'9':num++;
        }
    if(num == len) return true;
    else return false;
}
Code:
stock SendClientMessageInRange(playerid, color, Float:range, text[])
{
	new Float:x, Float:y, Float:z;
	GetPlayerPos(playerid, x, y, z);
	foreach(new i : Player)
	{
		if(IsPlayerConnected(i))
		{
			if(IsPlayerInRangeOfPoint(i, range, x, y, z))
			{
				SendClientMessage(i, color, text);
			}
		}
	}
	return 1;
}
I have it at the top of the code:

Code:
forward bool:IsStringValid(string[]);
What's wrong with that?
Michatex is offline   Reply With Quote
Old 29/05/2020, 04:16 AM   #2
Sasino97
High-roller
 
Sasino97's Avatar
 
Join Date: Dec 2010
Location: Tampa, FL
Posts: 1,418
Reputation: 139
Default Re: warning 214...

I know it's an old topic, but for the sake of those who found this post via a search engine:

Either add const before those function args; in this case:
pawn Code:
SendClientMessageInRange(playerid, color, Float:range, const text[])
bool:IsStringValid(const string[]);

Or if you are getting tons of these errors, just add -w214 to the compiler params, nothing bad will happen, don't worry.
__________________
Sasino97 is offline   Reply With Quote
Old 29/05/2020, 09:14 AM   #3
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,734
Reputation: 1686
Default Re: warning 214...

Quote:
Originally Posted by Sasino97 View Post
Or if you are getting tons of these errors, just add -w214 to the compiler params, nothing bad will happen, don't worry.
Since it was bumped already anway; the parameter -w disables a specific warning.
Alternatively (if you're using community compiler), you can add this in your script aswell: #pragma warning disable 214 (or 214,239 to disable 239 aswell)
__________________
When the opportunity presents itself to flip-a da table, uh, you flip-a da table.

Discord: Kwarde#8009
Kwarde is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Warning 213: Tag mismatch and warning 202: number of arguments does not match definition ConnorG Scripting Help 5 12/01/2018 02:32 AM
[Ajuda] warning 217: loose indentation, warning 202: number of arguments does not match definition NATANGameron Português/Portuguese 7 05/04/2017 12:36 AM
warning (7784) : warning 202: number of arguments does not match definition b0b Scripting Help 3 08/06/2014 05:26 PM
warning 215: expression has no effect & warning 235: public function lacks forward declaration botak Scripting Help 4 27/12/2013 12:38 PM
[warning]como tira esse warning?? syslogg Português/Portuguese 3 06/01/2011 12:59 AM


All times are GMT. The time now is 04:48 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.