[Help] dini_Get - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] dini_Get (
/showthread.php?tid=159288)
[Help] dini_Get -
Maxips2 - 12.07.2010
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?
Re: [Help] dini_Get -
Grim_ - 12.07.2010
Show the enum structure please.
Re: [Help] dini_Get -
Maxips2 - 12.07.2010
pawn Код:
enum hInfo
{
Float:hEntrancex,
Float:hEntrancey,
Float:hEntrancez,
Float:hExitx,
Float:hExity,
Float:hExitz,
hInterior,
hVirtualWorld,
hPickup,
hOwned,
hOwner,
Text3D:hLabel,
hPrice,
hDescription
}
Re: [Help] dini_Get -
Grim_ - 12.07.2010
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.
Re: [Help] dini_Get -
Maxips2 - 12.07.2010
pawn Код:
error 047: array sizes do not match, or destination array is too small
Line:
pawn Код:
HouseInfo[h][hOwner] = dini_Get(file, "Owner");
Re: [Help] dini_Get -
Grim_ - 12.07.2010
This is why I now don't like dini.
Try changing the size from MAX_PLAYER_NAME to like 128.
Re: [Help] dini_Get -
Maxips2 - 12.07.2010
Same error.
I've been looking for an include for MySQL, couldn't find a good one anywhere.
Re: [Help] dini_Get -
Grim_ - 12.07.2010
pawn Код:
strmid(HouseData[h][hOwner], dini_Get("houses.txt", "Owner"), 0, strlen(HouseData[h][hOwner]));
That work?
Re: [Help] dini_Get -
Maxips2 - 12.07.2010
Where did you steal it from? ^^
and yeah, that worked, no errors, lemme test it In-Game
Re: [Help] dini_Get -
Grim_ - 12.07.2010
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