Help -
BlackEvils - 24.04.2015
Hi all i have a probelm,
i go this error "error 047: array sizes do not match, or destination array is too small"
it say thats wrong "cmd = strtok(params, idx);"
how i can resove it ?
Re: Help -
lanix - 24.04.2015
show code
Re: Help -
Alpay0098 - 24.04.2015
047: array sizes do not match, or destination array is too small
For array assignment, the arrays on the left and the right side of the assignment operator must have the same number of dimensions. In addition:
for multi-dimensional arrays, both arrays must have the same size;
for single arrays with a single dimension, the array on the left side of the assignment operator must have a size that is equal or bigger than the one on the right side.
PHP код:
new destination[8];
new msg[] = "Hello World!";
destination = msg;
In the above code, we try to fit 12 characters in an array that can only support 8. By increasing the array size of the destination, we can solve this. Note that a string also requires a null terminator so the total length of "Hello World!" plus the null terminator is, in fact, 13.
PHP код:
new destination[13];
new msg[] = "Hello World!";
destination = msg;
Resource : https://sampwiki.blast.hk/wiki/Errors_List
Good Luck.
Re: Help -
BlackEvils - 24.04.2015
Quote:
Originally Posted by lanix
show code
|
dcmd_V(playerid, params[])
{
new cmd[200], idx;
cmd = strtok(params, idx);
new String[200];
new tmp[256];
new Float
, Float:y, Float:z;
tmp = strtok(params, idx);
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLORE_ROSSO, "ERROR:You are already in a vehicle.");
if(!strlen(tmp)) return SendClientMessage(playerid, COLORE_ROSSO, "USE:/v [VehicleName/VehicleId].");
new vehicle = GetVehicleModelIDFromName(tmp);
if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, COLORE_ROSSO, "ERROR:That vehicle does not exist.");
new Float:a;
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid, x, y, z);
DestroyVehicle(PlayersVehicle);
PlayersVehicle = CreateVehicle(vehicle, x, y, z, a, -1, -1, -1);
format(String, sizeof(String), "INFO:You have spawned a %s", aVehicleNames[vehicle - 400]);
SendClientMessage(playerid, COLORE_VERDE, String);
PutPlayerInVehicle(playerid, PlayersVehicle, 0);
return 1;
}
Re: Help -
Alpay0098 - 24.04.2015
Try to increase
cmd's array size. (
new cmd[400], idx;)
Increase them from 200 to 400 then tell me the result.
Re: Help -
BlackEvils - 25.04.2015
Quote:
Originally Posted by Alpay0098
Try to increase cmd's array size. (new cmd[400], idx;)
Increase them from 200 to 400 then tell me the result.
|
omg work thx thx