error 047: array sizes do not match, or destination array is too small
#1

I receive the following error:
Quote:

Carabines.pwn(1284) : error 047: array sizes do not match, or destination array is too small

Quote:

ptask PLAYERTASK[1000](playerid)
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[4];
format(string, sizeof(string), "%d", GetPlayerSpeed(playerid));
PlayerTextDrawSetString(playerid, VEHICLE_SPEED_TEXTDRAW[playerid], string);
}
}

PS: I have used y_timers for a long time but this is the first the when i receive an error like this.
Reply
#2

On which line do you get error? i mean which is line 1284?
Reply
#3

Quote:
Originally Posted by MP2
Посмотреть сообщение
From ******:
Quote:

That error usually occurs when you change "MAX_PLAYERS" after including YSI instead of before, meaning that the different parts of your mode are using different values.

Always re-define MAX_PLAYERS like so:

[pawn]
#include <a_samp>
#undef MAX_PLAYERS
#define MAX_PLAYERS 123

// rest of script
[/[pawn]
SOLVED
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)