xyz.pwn(22109) : warning 214: possibly a "const" array argument was intended: "string"
#7

Quote:
Originally Posted by Calisthenics
View Post
The warning is not about expecting constant array but passing a literal value. Make a crime list that you can access anywhere.
pawn Code:
enum
{
    CRIME_UNKNOWN, // constant, its value is 0
    CRIME_FIRST_DEGREE_MURDER // constant, its value is 1
}

new const CrimeList[][] =
{
    "Unknown", // index 0
    "First Degree Murder" // index 1
};
pawn Code:
if(PlayerInfo[playerid][pTeam] != 5) SetPlayerCriminal(killerid, CrimeList[CRIME_UNKNOWN], CrimeList[CRIME_FIRST_DEGREE_MURDER ], 1);
ok. but
And if I put it as I said, is not it ok? I'm not receiving warning.

Like this:
BEFORE:
Quote:
Quote:

forward SetPlayerCriminal(playerid, declare[], reason[], wanted);

AFTER:
Quote:
Quote:

forward SetPlayerCriminal(playerid, const declare[], const reason[], wanted);

?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)