[Help] dini_Get
#1

I got this code:

pawn Код:
HouseInfo[h][hOwner] = dini_Get(file, "Owner");
And I get this warning:

pawn Код:
error 006: must be assigned to an array
Uh whats wrong?
Reply
#2

Show the enum structure please.
Reply
#3

pawn Код:
enum hInfo
{
    Float:hEntrancex,
    Float:hEntrancey,
    Float:hEntrancez,
    Float:hExitx,
    Float:hExity,
    Float:hExitz,
    hInterior,
    hVirtualWorld,
    hPickup,
    hOwned,
    hOwner,
    Text3D:hLabel,
    hPrice,
    hDescription
}
Reply
#4

pawn Код:
enum hInfo
{
    Float:hEntrancex,
    Float:hEntrancey,
    Float:hEntrancez,
    Float:hExitx,
    Float:hExity,
    Float:hExitz,
    hInterior,
    hVirtualWorld,
    hPickup,
    hOwned,
    hOwner[MAX_PLAYER_NAME],
    Text3D:hLabel,
    hPrice,
    hDescription
}
That should do it.
Reply
#5

pawn Код:
error 047: array sizes do not match, or destination array is too small
Line:

pawn Код:
HouseInfo[h][hOwner] = dini_Get(file, "Owner");
Reply
#6

This is why I now don't like dini.

Try changing the size from MAX_PLAYER_NAME to like 128.
Reply
#7

Same error.
I've been looking for an include for MySQL, couldn't find a good one anywhere.
Reply
#8

pawn Код:
strmid(HouseData[h][hOwner], dini_Get("houses.txt", "Owner"), 0, strlen(HouseData[h][hOwner]));
That work?
Reply
#9

Where did you steal it from? ^^
and yeah, that worked, no errors, lemme test it In-Game
Reply
#10

I didn't, I just tested it in a new.pwn, proof:
pawn Код:
#include <a_samp>
#include <dini>

#define MAX_HOUSES  100

enum h_data
{
    hOwner[MAX_PLAYER_NAME]
}

new HouseData[MAX_HOUSES][h_data];

public OnFilterScriptInit()
{
    for(new i = 0; i < MAX_HOUSES; i++)
    {
        strmid(HouseData[i][hOwner], dini_Get("houses.txt", "Owner"), 0, strlen(HouseData[i][hOwner]));
    }
    return 1;
}
I don't steal code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)